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 
67  template<typename PredictionType, typename TargetType>
68  inline typename PredictionType::elem_type Forward(
69  const PredictionType& prediction,
70  const TargetType& target);
71 
80  template<typename PredictionType, typename TargetType, typename LossType>
81  inline void Backward(const PredictionType& prediction,
82  const TargetType& target,
83  LossType& loss);
84 
86  OutputDataType& OutputParameter() const { return outputParameter; }
88  OutputDataType& OutputParameter() { return outputParameter; }
89 
93  template<typename Archive>
94  void serialize(Archive& ar, const uint32_t /* version */);
95 
96  private:
98  OutputDataType outputParameter;
99 }; // class SigmoidCrossEntropy
100 
101 } // namespace ann
102 } // namespace mlpack
103 
104 // Include implementation.
105 #include "sigmoid_cross_entropy_error_impl.hpp"
106 
107 #endif
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Linear algebra utility functions, generally performed on matrices or vectors.
SigmoidCrossEntropyError()
Create the SigmoidCrossEntropyError object.
OutputDataType & OutputParameter()
Modify the output parameter.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the Sigmoid CrossEntropy Error functions.
OutputDataType & OutputParameter() const
Get the output parameter.
The SigmoidCrossEntropyError performance function measures the network&#39;s performance according to the...