12 #ifndef MLPACK_ANN_LOSS_FUNCTION_MARGIN_RANKING_LOSS_HPP 13 #define MLPACK_ANN_LOSS_FUNCTION_MARGIN_RANKING_LOSS_HPP 32 typename InputDataType = arma::mat,
33 typename OutputDataType = arma::mat
52 template<
typename PredictionType,
typename TargetType>
53 typename PredictionType::elem_type
Forward(
const PredictionType& prediction,
54 const TargetType& target);
65 typename PredictionType,
69 void Backward(
const PredictionType& prediction,
70 const TargetType& target,
79 double Margin()
const {
return margin; }
86 template<
typename Archive>
87 void serialize(Archive& ar,
const uint32_t );
91 OutputDataType outputParameter;
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: margin_ranking_loss_impl.hpp:68
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: margin_ranking_loss.hpp:74
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.
double Margin() const
Get the margin parameter.
Definition: margin_ranking_loss.hpp:79
MarginRankingLoss(const double margin=1.0)
Create the MarginRankingLoss object with Hyperparameter margin.
Definition: margin_ranking_loss_impl.hpp:22
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
Definition: margin_ranking_loss_impl.hpp:50
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the Margin Ranking Loss function.
Definition: margin_ranking_loss_impl.hpp:31
double & Margin()
Modify the margin parameter.
Definition: margin_ranking_loss.hpp:81
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: margin_ranking_loss.hpp:76
Margin ranking loss measures the loss given inputs and a label vector with values of 1 or -1...
Definition: margin_ranking_loss.hpp:35