mlpack 3.4.2
softmin.hpp
Go to the documentation of this file.
1
13#ifndef MLPACK_METHODS_ANN_LAYER_SOFTMIN_HPP
14#define MLPACK_METHODS_ANN_LAYER_SOFTMIN_HPP
15
16#include <mlpack/prereqs.hpp>
17
18namespace mlpack {
19namespace ann {
20
31template <
32 typename InputDataType = arma::mat,
33 typename OutputDataType = arma::mat
34>
36{
37 public:
42
50 template<typename InputType, typename OutputType>
51 void Forward(const InputType& input, OutputType& output);
52
62 template<typename eT>
63 void Backward(const arma::Mat<eT>& input,
64 const arma::Mat<eT>& gy,
65 arma::Mat<eT>& g);
66
68 OutputDataType& OutputParameter() const { return outputParameter; }
70 OutputDataType& OutputParameter() { return outputParameter; }
71
73 InputDataType& Delta() const { return delta; }
75 InputDataType& Delta() { return delta; }
76
80 template<typename Archive>
81 void serialize(Archive& /* ar */, const unsigned int /* version */);
82
83 private:
85 OutputDataType delta;
86
88 OutputDataType outputParameter;
89}; // class Softmin
90
91} // namespace ann
92} // namespace mlpack
93
94// Include implementation.
95#include "softmin_impl.hpp"
96
97#endif
Implementation of the Softmin layer.
Definition: softmin.hpp:36
void Forward(const InputType &input, OutputType &output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: softmin.hpp:68
Softmin()
Create the Softmin object.
void Backward(const arma::Mat< eT > &input, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backw...
InputDataType & Delta()
Modify the delta.
Definition: softmin.hpp:75
void serialize(Archive &, const unsigned int)
Serialize the layer.
InputDataType & Delta() const
Get the delta.
Definition: softmin.hpp:73
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: softmin.hpp:70
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.