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;
115 #include "constant_impl.hpp" OutputDataType & OutputParameter()
Modify the output parameter.
Linear algebra utility functions, generally performed on matrices or vectors.
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...
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t OutSize() const
Get the output size.
OutputDataType & OutputParameter() const
Get the output parameter.
void Forward(const InputType &input, OutputType &output)
Ordinary feed forward pass of a neural network.
OutputDataType & Delta()
Modify the delta.
OutputDataType & Delta() const
Get the delta.
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
size_t WeightSize() const
Get the size of the weights.
Implementation of the constant layer.
void Backward(const DataType &, const DataType &, DataType &g)
Ordinary feed backward pass of a neural network.