13 #ifndef MLPACK_METHODS_ANN_LAYER_CONSTANT_HPP 14 #define MLPACK_METHODS_ANN_LAYER_CONSTANT_HPP 31 typename InputDataType = arma::mat,
32 typename OutputDataType = arma::mat
44 Constant(
const size_t outSize = 0,
const double scalar = 0.0);
53 template<
typename InputType,
typename OutputType>
54 void Forward(
const InputType& input, OutputType& output);
64 template<
typename DataType>
75 OutputDataType&
Delta()
const {
return delta; }
77 OutputDataType&
Delta() {
return delta; }
80 size_t OutSize()
const {
return outSize; }
91 template<
typename Archive>
92 void serialize(Archive& ar,
const uint32_t );
102 OutputDataType constantOutput;
105 OutputDataType delta;
108 OutputDataType outputParameter;
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: constant.hpp:72
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
OutputDataType & Delta()
Modify the delta.
Definition: constant.hpp:77
The core includes that mlpack expects; standard C++ includes and Armadillo.
Constant(const size_t outSize=0, const double scalar=0.0)
Create the Constant object that outputs a given constant scalar value given any input value...
Definition: constant_impl.hpp:23
size_t WeightSize() const
Get the size of the weights.
Definition: constant.hpp:83
void Forward(const InputType &input, OutputType &output)
Ordinary feed forward pass of a neural network.
Definition: constant_impl.hpp:35
OutputDataType & Delta() const
Get the delta.
Definition: constant.hpp:75
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: constant.hpp:70
void Backward(const DataType &, const DataType &, DataType &g)
Ordinary feed backward pass of a neural network.
Definition: constant_impl.hpp:48
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: constant_impl.hpp:56
Implementation of the constant layer.
Definition: constant.hpp:34
size_t OutSize() const
Get the output size.
Definition: constant.hpp:80