mlpack  3.1.1
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
prereqs.hpp
mlpack::ann::NegativeLogLikelihood::Delta
OutputDataType & Delta() const
Get the delta.
Definition: negative_log_likelihood.hpp:80
mlpack::ann::NegativeLogLikelihood::InputParameter
InputDataType & InputParameter() const
Get the input parameter.
Definition: negative_log_likelihood.hpp:70
mlpack::ann::NegativeLogLikelihood
Implementation of the negative log likelihood layer.
Definition: negative_log_likelihood.hpp:35
mlpack
@serialization.hpp
Definition: add_to_po.hpp:21
mlpack::ann::NegativeLogLikelihood::Backward
void Backward(const InputType &&input, const TargetType &&target, OutputType &&output)
Ordinary feed backward pass of a neural network.
mlpack::ann::NegativeLogLikelihood::InputParameter
InputDataType & InputParameter()
Modify the input parameter.
Definition: negative_log_likelihood.hpp:72
mlpack::ann::NegativeLogLikelihood::serialize
void serialize(Archive &, const unsigned int)
Serialize the layer.
mlpack::ann::NegativeLogLikelihood::OutputParameter
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: negative_log_likelihood.hpp:77
mlpack::ann::NegativeLogLikelihood::Delta
OutputDataType & Delta()
Modify the delta.
Definition: negative_log_likelihood.hpp:82
mlpack::ann::NegativeLogLikelihood::NegativeLogLikelihood
NegativeLogLikelihood()
Create the NegativeLogLikelihoodLayer object.
mlpack::ann::NegativeLogLikelihood::Forward
double Forward(const InputType &&input, TargetType &&target)
Computes the Negative log likelihood.
mlpack::ann::NegativeLogLikelihood::OutputParameter
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: negative_log_likelihood.hpp:75