negative_log_likelihood.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_ANN_LAYER_NEGATIVE_LOG_LIKELIHOOD_HPP
13 #define MLPACK_METHODS_ANN_LAYER_NEGATIVE_LOG_LIKELIHOOD_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace ann {
19 
31 template <
32  typename InputDataType = arma::mat,
33  typename OutputDataType = arma::mat
34 >
36 {
37  public:
42 
50  template<typename InputType, typename TargetType>
51  double Forward(const InputType&& input, TargetType&& target);
52 
64  template<typename InputType, typename TargetType, typename OutputType>
65  void Backward(const InputType&& input,
66  const TargetType&& target,
67  OutputType&& output);
68 
70  InputDataType& InputParameter() const { return inputParameter; }
72  InputDataType& InputParameter() { return inputParameter; }
73 
75  OutputDataType& OutputParameter() const { return outputParameter; }
77  OutputDataType& OutputParameter() { return outputParameter; }
78 
80  OutputDataType& Delta() const { return delta; }
82  OutputDataType& Delta() { return delta; }
83 
87  template<typename Archive>
88  void serialize(Archive& /* ar */, const unsigned int /* version */);
89 
90  private:
92  OutputDataType delta;
93 
95  InputDataType inputParameter;
96 
98  OutputDataType outputParameter;
99 }; // class NegativeLogLikelihood
100 
101 } // namespace ann
102 } // namespace mlpack
103 
104 // Include implementation.
105 #include "negative_log_likelihood_impl.hpp"
106 
107 #endif
OutputDataType & OutputParameter() const
Get the output parameter.
OutputDataType & Delta()
Modify the delta.
.hpp
Definition: add_to_po.hpp:21
The core includes that mlpack expects; standard C++ includes and Armadillo.
Implementation of the negative log likelihood layer.
NegativeLogLikelihood()
Create the NegativeLogLikelihoodLayer object.
InputDataType & InputParameter() const
Get the input parameter.
void Backward(const InputType &&input, const TargetType &&target, OutputType &&output)
Ordinary feed backward pass of a neural network.
void serialize(Archive &, const unsigned int)
Serialize the layer.
OutputDataType & OutputParameter()
Modify the output parameter.
double Forward(const InputType &&input, TargetType &&target)
Computes the Negative log likelihood.
InputDataType & InputParameter()
Modify the input parameter.
OutputDataType & Delta() const
Get the delta.