12 #ifndef MLPACK_METHODS_ANN_LAYER_VIRTUALBATCHNORM_HPP 13 #define MLPACK_METHODS_ANN_LAYER_VIRTUALBATCHNORM_HPP 43 typename InputDataType = arma::mat,
44 typename OutputDataType = arma::mat
46 class VirtualBatchNorm
63 const double eps = 1e-8);
79 void Forward(
const arma::Mat<eT>&& input, arma::Mat<eT>&& output);
89 void Backward(
const arma::Mat<eT>&& ,
100 template<
typename eT>
101 void Gradient(
const arma::Mat<eT>&& ,
102 arma::Mat<eT>&& error,
103 arma::Mat<eT>&& gradient);
116 OutputDataType
const&
Delta()
const {
return delta; }
118 OutputDataType&
Delta() {
return delta; }
121 OutputDataType
const&
Gradient()
const {
return gradient; }
128 template<
typename Archive>
129 void serialize(Archive& ar,
const unsigned int );
142 OutputDataType gamma;
148 OutputDataType weights;
151 OutputDataType referenceBatchMean;
154 OutputDataType referenceBatchMeanSquared;
157 double oldCoefficient;
160 double newCoefficient;
166 OutputDataType variance;
169 OutputDataType gradient;
172 OutputDataType delta;
175 OutputDataType outputParameter;
178 OutputDataType inputParameter;
181 OutputDataType normalized;
184 OutputDataType inputSubMean;
191 #include "virtual_batch_norm_impl.hpp"
OutputDataType const & OutputParameter() const
Get the output parameter.
void Backward(const arma::Mat< eT > &&, arma::Mat< eT > &&gy, arma::Mat< eT > &&g)
Backward pass through the layer.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType const & Gradient() const
Get the gradient.
void Forward(const arma::Mat< eT > &&input, arma::Mat< eT > &&output)
Forward pass of the Virtual Batch Normalization layer.
void Reset()
Reset the layer parameters.
OutputDataType & Gradient()
Modify the gradient.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
VirtualBatchNorm()
Create the VirtualBatchNorm object.
OutputDataType & Delta()
Modify the delta.
OutputDataType const & Delta() const
Get the delta.
OutputDataType const & Parameters() const
Get the parameters.
OutputDataType & Parameters()
Modify the parameters.
OutputDataType & OutputParameter()
Modify the output parameter.