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;
101 #include "margin_ranking_loss_impl.hpp" void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
Linear algebra utility functions, generally performed on matrices or vectors.
double & Margin()
Modify the margin parameter.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType & OutputParameter() const
Get the output parameter.
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the Margin Ranking Loss function.
MarginRankingLoss(const double margin=1.0)
Create the MarginRankingLoss object with Hyperparameter margin.
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Margin ranking loss measures the loss given inputs and a label vector with values of 1 or -1...
double Margin() const
Get the margin parameter.
OutputDataType & OutputParameter()
Modify the output parameter.