mlpack 3.4.2
earth_mover_distance.hpp
Go to the documentation of this file.
1
12#ifndef MLPACK_METHODS_ANN_LOSS_FUNCTIONS_EARTH_MOVER_DISTANCE_HPP
13#define MLPACK_METHODS_ANN_LOSS_FUNCTIONS_EARTH_MOVER_DISTANCE_HPP
14
15#include <mlpack/prereqs.hpp>
16
17namespace mlpack {
18namespace ann {
19
29template <
30 typename InputDataType = arma::mat,
31 typename OutputDataType = arma::mat
32>
34{
35 public:
40
47 template<typename InputType, typename TargetType>
48 typename InputType::elem_type Forward(const InputType& input,
49 const TargetType& target);
50
58 template<typename InputType, typename TargetType, typename OutputType>
59 void Backward(const InputType& input,
60 const TargetType& target,
61 OutputType& output);
62
64 OutputDataType& OutputParameter() const { return outputParameter; }
66 OutputDataType& OutputParameter() { return outputParameter; }
67
71 template<typename Archive>
72 void serialize(Archive& ar, const unsigned int /* version */);
73
74 private:
76 OutputDataType outputParameter;
77}; // class EarthMoverDistance
78
79} // namespace ann
80} // namespace mlpack
81
82// Include implementation.
83#include "earth_mover_distance_impl.hpp"
84
85#endif
The earth mover distance function measures the network's performance according to the Kantorovich-Rub...
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)
Ordinary feed forward pass of a neural network.
OutputDataType & OutputParameter()
Modify the output parameter.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
EarthMoverDistance()
Create the EarthMoverDistance object.
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.