26 void forward(Eigen::MatrixXd &out,
const Eigen::MatrixXd &x)
override
30 out = (x.array() < 0.0).select(0.0, x);
39 void backward(Eigen::MatrixXd &out,
const Eigen::MatrixXd &dx)
override
Base class for all activation functions.
Definition Activation.hpp:24
Eigen::MatrixXd _forward_input
Definition Activation.hpp:37
ReLU activation function.
Definition ReLU.hpp:13
void backward(Eigen::MatrixXd &out, const Eigen::MatrixXd &dx) override
Backward pass of the ReLU activation function.
Definition ReLU.hpp:39
void forward(Eigen::MatrixXd &out, const Eigen::MatrixXd &x) override
Forward pass of the ReLU activation function.
Definition ReLU.hpp:26
ReLU()
Construct a new ReLU object.
Definition ReLU.hpp:18
Definition Activation.hpp:6
ActivationType
Enum class for activation types.
Definition Activation.hpp:11