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