13 #ifndef MLPACK_METHODS_ANN_LAYER_MULTIPLY_CONSTANT_HPP 14 #define MLPACK_METHODS_ANN_LAYER_MULTIPLY_CONSTANT_HPP 31 typename InputDataType = arma::mat,
32 typename OutputDataType = arma::mat
61 template<
typename InputType,
typename OutputType>
62 void Forward(
const InputType& input, OutputType& output);
72 template<
typename DataType>
73 void Backward(
const DataType& ,
const DataType& gy, DataType& g);
81 OutputDataType&
Delta()
const {
return delta; }
83 OutputDataType&
Delta() {
return delta; }
86 double Scalar()
const {
return scalar; }
96 template<
typename Archive>
97 void serialize(Archive& ar,
const uint32_t );
104 OutputDataType delta;
107 OutputDataType outputParameter;
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
double & Scalar()
Modify the scalar multiplier.
Definition: multiply_constant.hpp:88
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t WeightSize() const
Get the size of the weights.
Definition: multiply_constant.hpp:91
void Backward(const DataType &, const DataType &gy, DataType &g)
Ordinary feed backward pass of a neural network.
Definition: multiply_constant_impl.hpp:79
OutputDataType & Delta()
Modify the delta.
Definition: multiply_constant.hpp:83
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: multiply_constant.hpp:78
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: multiply_constant_impl.hpp:87
double Scalar() const
Get the scalar multiplier.
Definition: multiply_constant.hpp:86
void Forward(const InputType &input, OutputType &output)
Ordinary feed forward pass of a neural network.
Definition: multiply_constant_impl.hpp:71
OutputDataType & Delta() const
Get the delta.
Definition: multiply_constant.hpp:81
Implementation of the multiply constant layer.
Definition: multiply_constant.hpp:34
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: multiply_constant.hpp:76
MultiplyConstant & operator=(const MultiplyConstant &layer)
Copy assignment operator.
Definition: multiply_constant_impl.hpp:47
MultiplyConstant(const double scalar=1.0)
Create the MultiplyConstant object.
Definition: multiply_constant_impl.hpp:23