12 #ifndef MLPACK_METHODS_ANN_LOSS_FUNCTIONS_EARTH_MOVER_DISTANCE_IMPL_HPP 13 #define MLPACK_METHODS_ANN_LOSS_FUNCTIONS_EARTH_MOVER_DISTANCE_IMPL_HPP 21 template<
typename InputDataType,
typename OutputDataType>
27 template<
typename InputDataType,
typename OutputDataType>
28 template<
typename PredictionType,
typename TargetType>
29 typename PredictionType::elem_type
31 const PredictionType& prediction,
32 const TargetType& target)
34 return -arma::accu(target % prediction);
37 template<
typename InputDataType,
typename OutputDataType>
38 template<
typename PredictionType,
typename TargetType,
typename LossType>
40 const PredictionType& ,
41 const TargetType& target,
47 template<
typename InputDataType,
typename OutputDataType>
48 template<
typename Archive>
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Ordinary feed forward pass of a neural network.
Definition: earth_mover_distance_impl.hpp:30
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: earth_mover_distance_impl.hpp:49
EarthMoverDistance()
Create the EarthMoverDistance object.
Definition: earth_mover_distance_impl.hpp:22
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
Definition: earth_mover_distance_impl.hpp:39