10 return std::max(0.0, x);
16 return x > 0.0 ? 1.0 : 0.0;
23 return 1.0 / (1.0 + std::exp(-x));
30 return fx * (1.0 - fx);
52 return MatrixD(x.rows(), x.cols());
59 return MatrixD(x.rows(), x.cols());
70 return x > 0.0 ? x : alpha_ * x;
76 return x > 0.0 ? 1.0 : alpha_;
LeakyReLU(double alpha=0.01)
Constructor with configurable leak parameter.
double backward(double x)
Compute Leaky ReLU derivative.
double forward(double x)
Compute Leaky ReLU forward pass.
double forward(double x)
Compute ReLU forward pass.
double backward(double x)
Compute ReLU derivative.
double forward(double x)
Compute sigmoid forward pass.
double backward(double x)
Compute sigmoid derivative.
MatrixD backward(const MatrixD &x)
Compute softmax Jacobian matrix.
MatrixD forward(const MatrixD &x)
Compute softmax forward pass.
double backward(double x)
Compute tanh derivative.
double forward(double x)
Compute tanh forward pass.
Activation functions for neural networks.