sigmoid_cross_entropy_error.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_ANN_LAYER_SIGMOID_CROSS_ENTROPY_ERROR_HPP
13 #define MLPACK_METHODS_ANN_LAYER_SIGMOID_CROSS_ENTROPY_ERROR_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace ann {
19 
47 template <
48  typename InputDataType = arma::mat,
49  typename OutputDataType = arma::mat
50 >
52 {
53  public:
58 
59  /*
60  * Computes the Sigmoid CrossEntropy Error functions.
61  *
62  * @param input Input data used for evaluating the specified function.
63  * @param output Resulting output activation.
64  */
65  template<typename eT>
66  inline double Forward(const arma::Mat<eT>&& input,
67  const arma::Mat<eT>&& target);
75  template<typename eT>
76  inline void Backward(const arma::Mat<eT>&& input,
77  const arma::Mat<eT>&& target,
78  arma::Mat<eT>&& output);
79 
81  InputDataType& InputParameter() const { return inputParameter; }
83  InputDataType& InputParameter() { return inputParameter; }
84 
86  OutputDataType& OutputParameter() const { return outputParameter; }
88  OutputDataType& OutputParameter() { return outputParameter; }
89 
91  OutputDataType& Delta() const { return delta; }
93  OutputDataType& Delta() { return delta; }
94 
98  template<typename Archive>
99  void serialize(Archive& ar, const unsigned int /* version */);
100 
101  private:
103  OutputDataType delta;
104 
106  InputDataType inputParameter;
107 
109  OutputDataType outputParameter;
110 }; // class SigmoidCrossEntropy
111 
112 } // namespace ann
113 } // namespace mlpack
114 
115 // Include implementation.
116 #include "sigmoid_cross_entropy_error_impl.hpp"
117 
118 #endif
.hpp
Definition: add_to_po.hpp:21
SigmoidCrossEntropyError()
Create the SigmoidCrossEntropyError object.
OutputDataType & OutputParameter()
Modify the output parameter.
void Backward(const arma::Mat< eT > &&input, const arma::Mat< eT > &&target, arma::Mat< eT > &&output)
Ordinary feed backward pass of a neural network.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType & Delta() const
Get the delta.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
InputDataType & InputParameter() const
Get the input parameter.
OutputDataType & Delta()
Modify the delta.
OutputDataType & OutputParameter() const
Get the output parameter.
double Forward(const arma::Mat< eT > &&input, const arma::Mat< eT > &&target)
The SigmoidCrossEntropyError performance function measures the network&#39;s performance according to the...
InputDataType & InputParameter()
Modify the input parameter.