mlpack 3.4.2
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
18namespace mlpack {
19namespace ann {
20
32template <
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
The reconstruction loss performance function measures the network's performance equal to the negative...
ReconstructionLoss()
Create the ReconstructionLoss object.
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.
InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the reconstruction loss.
OutputDataType & OutputParameter()
Modify the output parameter.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.