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);
90 const arma::Mat<eT>& gy,
100 template<
typename eT>
101 void Gradient(
const arma::Mat<eT>& ,
102 const 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; }
134 template<
typename Archive>
135 void serialize(Archive& ar,
const uint32_t );
148 OutputDataType gamma;
154 OutputDataType weights;
157 OutputDataType referenceBatchMean;
160 OutputDataType referenceBatchMeanSquared;
163 double oldCoefficient;
166 double newCoefficient;
172 OutputDataType variance;
175 OutputDataType gradient;
178 OutputDataType delta;
181 OutputDataType outputParameter;
184 OutputDataType inputParameter;
187 OutputDataType normalized;
190 OutputDataType inputSubMean;
197 #include "virtual_batch_norm_impl.hpp" void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Linear algebra utility functions, generally performed on matrices or vectors.
OutputDataType const & OutputParameter() const
Get the output parameter.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Forward(const arma::Mat< eT > &input, arma::Mat< eT > &output)
Forward pass of the Virtual Batch Normalization layer.
OutputDataType const & Gradient() const
Get the gradient.
void Reset()
Reset the layer parameters.
OutputDataType & Gradient()
Modify the gradient.
VirtualBatchNorm()
Create the VirtualBatchNorm object.
OutputDataType & Delta()
Modify the delta.
OutputDataType const & Delta() const
Get the delta.
OutputDataType const & Parameters() const
Get the parameters.
size_t InSize() const
Get the number of input units.
OutputDataType & Parameters()
Modify the parameters.
OutputDataType & OutputParameter()
Modify the output parameter.
void Backward(const arma::Mat< eT > &, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
Backward pass through the layer.
double Epsilon() const
Get the epsilon value.