reconstruction_loss.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_ANN_LOSS_FUNCTION_RECONSTRUCTION_LOSS_HPP
13 #define MLPACK_METHODS_ANN_LOSS_FUNCTION_RECONSTRUCTION_LOSS_HPP
14 
15 #include <mlpack/prereqs.hpp>
17 
18 namespace mlpack {
19 namespace ann {
20 
32 template <
33  typename InputDataType = arma::mat,
34  typename OutputDataType = arma::mat,
35  typename DistType = BernoulliDistribution<InputDataType>
36 >
38 {
39  public:
44 
51  template<typename InputType, typename TargetType>
52  double Forward(const InputType&& input, const TargetType&& target);
53 
61  template<typename InputType, typename TargetType, typename OutputType>
62  void Backward(const InputType&& input,
63  const TargetType&& target,
64  OutputType&& output);
65 
67  OutputDataType& OutputParameter() const { return outputParameter; }
69  OutputDataType& OutputParameter() { return outputParameter; }
70 
74  template<typename Archive>
75  void serialize(Archive& ar, const unsigned int /* version */);
76 
77  private:
79  DistType dist;
80 
82  OutputDataType outputParameter;
83 }; // class ReconstructionLoss
84 
85 } // namespace ann
86 } // namespace mlpack
87 
88 // Include implementation.
89 #include "reconstruction_loss_impl.hpp"
90 
91 #endif
strip_type.hpp
Definition: add_to_po.hpp:21
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
double Forward(const InputType &&input, const TargetType &&target)
Computes the reconstruction loss.
ReconstructionLoss()
Create the ReconstructionLoss object.
The core includes that mlpack expects; standard C++ includes and Armadillo.
The reconstruction loss performance function measures the network&#39;s performance equal to the negative...
OutputDataType & OutputParameter()
Modify the output parameter.
OutputDataType & OutputParameter() const
Get the output parameter.
void Backward(const InputType &&input, const TargetType &&target, OutputType &&output)
Ordinary feed backward pass of a neural network.