sigmoid_cross_entropy_error.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_METHODS_ANN_LOSS_FUNCTION_SIGMOID_CROSS_ENTROPY_ERROR_HPP
14 #define MLPACK_METHODS_ANN_LOSS_FUNCTION_SIGMOID_CROSS_ENTROPY_ERROR_HPP
15 
16 #include <mlpack/prereqs.hpp>
17 
18 namespace mlpack {
19 namespace ann {
20 
48 template <
49  typename InputDataType = arma::mat,
50  typename OutputDataType = arma::mat
51 >
53 {
54  public:
59 
60  /*
61  * Computes the Sigmoid CrossEntropy Error functions.
62  *
63  * @param input Input data used for evaluating the specified function.
64  * @param output Resulting output activation.
65  */
66  template<typename eT>
67  inline double Forward(const arma::Mat<eT>&& input,
68  const arma::Mat<eT>&& target);
76  template<typename eT>
77  inline void Backward(const arma::Mat<eT>&& input,
78  const arma::Mat<eT>&& target,
79  arma::Mat<eT>&& output);
80 
82  InputDataType& InputParameter() const { return inputParameter; }
84  InputDataType& InputParameter() { return inputParameter; }
85 
87  OutputDataType& OutputParameter() const { return outputParameter; }
89  OutputDataType& OutputParameter() { return outputParameter; }
90 
92  OutputDataType& Delta() const { return delta; }
94  OutputDataType& Delta() { return delta; }
95 
99  template<typename Archive>
100  void serialize(Archive& ar, const unsigned int /* version */);
101 
102  private:
104  OutputDataType delta;
105 
107  InputDataType inputParameter;
108 
110  OutputDataType outputParameter;
111 }; // class SigmoidCrossEntropy
112 
113 } // namespace ann
114 } // namespace mlpack
115 
116 // Include implementation.
117 #include "sigmoid_cross_entropy_error_impl.hpp"
118 
119 #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.