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  typename InputType::elem_type Forward(const InputType& input,
53  const TargetType& target);
54 
62  template<typename InputType, typename TargetType, typename OutputType>
63  void Backward(const InputType& input,
64  const TargetType& target,
65  OutputType& output);
66 
68  OutputDataType& OutputParameter() const { return outputParameter; }
70  OutputDataType& OutputParameter() { return outputParameter; }
71 
75  template<typename Archive>
76  void serialize(Archive& ar, const unsigned int /* version */);
77 
78  private:
80  DistType dist;
81 
83  OutputDataType outputParameter;
84 }; // class ReconstructionLoss
85 
86 } // namespace ann
87 } // namespace mlpack
88 
89 // Include implementation.
90 #include "reconstruction_loss_impl.hpp"
91 
92 #endif
void Backward(const InputType &input, const TargetType &target, OutputType &output)
Ordinary feed backward pass of a neural network.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: add_to_po.hpp:21
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
ReconstructionLoss()
Create the ReconstructionLoss object.
The core includes that mlpack expects; standard C++ includes and Armadillo.
InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the reconstruction loss.
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.