12 #ifndef MLPACK_METHODS_ANN_LAYER_SPATIAL_DROPOUT_HPP 13 #define MLPACK_METHODS_ANN_LAYER_SPATIAL_DROPOUT_HPP 45 typename InputDataType = arma::mat,
46 typename OutputDataType = arma::mat
68 void Forward(
const arma::Mat<eT>& input, arma::Mat<eT>& output);
78 void Backward(
const arma::Mat<eT>& input,
79 const arma::Mat<eT>& gy,
88 OutputDataType
const&
Delta()
const {
return delta; }
90 OutputDataType&
Delta() {
return delta; }
93 size_t Size()
const {
return size; }
96 size_t&
Size() {
return size; }
104 double Ratio()
const {
return ratio; }
110 scale = 1.0 / (1.0 - ratio);
116 template<
typename Archive>
117 void serialize(Archive& ar,
const uint32_t );
121 OutputDataType delta;
124 OutputDataType outputParameter;
void Forward(const arma::Mat< eT > &input, arma::Mat< eT > &output)
Ordinary feed forward pass of the SpatialDropout layer.
Definition: spatial_dropout_impl.hpp:51
OutputDataType const & Delta() const
Get the delta.
Definition: spatial_dropout.hpp:88
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t Size() const
Get the number of channels.
Definition: spatial_dropout.hpp:93
void Backward(const arma::Mat< eT > &input, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
Ordinary feed backward pass of the SpatialDropout layer.
Definition: spatial_dropout_impl.hpp:87
double Ratio() const
Get the probability value.
Definition: spatial_dropout.hpp:104
bool Deterministic() const
Get the value of the deterministic parameter.
Definition: spatial_dropout.hpp:99
OutputDataType const & OutputParameter() const
Get the output parameter.
Definition: spatial_dropout.hpp:83
OutputDataType & Delta()
Modify the delta.
Definition: spatial_dropout.hpp:90
SpatialDropout()
Create the SpatialDropout object.
Definition: spatial_dropout_impl.hpp:22
size_t & Size()
Modify the number of channels.
Definition: spatial_dropout.hpp:96
bool & Deterministic()
Modify the value of the deterministic parameter.
Definition: spatial_dropout.hpp:101
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: spatial_dropout_impl.hpp:102
Implementation of the SpatialDropout layer.
Definition: spatial_dropout.hpp:48
void Ratio(const double r)
Modify the probability value.
Definition: spatial_dropout.hpp:107
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: spatial_dropout.hpp:85