12 #ifndef MLPACK_METHODS_ANN_LAYER_C_RELU_IMPL_HPP 13 #define MLPACK_METHODS_ANN_LAYER_C_RELU_IMPL_HPP 21 template<
typename InputDataType,
typename OutputDataType>
27 template<
typename InputDataType,
typename OutputDataType>
28 template<
typename InputType,
typename OutputType>
30 const InputType& input, OutputType& output)
32 output = arma::join_cols(arma::max(input, 0.0 * input), arma::max(
33 (-1 * input), 0.0 * input));
36 template<
typename InputDataType,
typename OutputDataType>
37 template<
typename DataType>
39 const DataType& input,
const DataType& gy, DataType& g)
42 temp = gy % (input >= 0.0);
43 g = temp.rows(0, (input.n_rows / 2 - 1)) - temp.rows(input.n_rows / 2,
47 template<
typename InputDataType,
typename OutputDataType>
48 template<
typename Archive>
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
CReLU()
Create the CReLU object.
Definition: c_relu_impl.hpp:22
void Forward(const InputType &input, OutputType &output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
Definition: c_relu_impl.hpp:29
void serialize(Archive &, const uint32_t)
Serialize the layer.
Definition: c_relu_impl.hpp:49
void Backward(const DataType &input, const DataType &gy, DataType &g)
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backw...
Definition: c_relu_impl.hpp:38