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 InputType,
typename TargetType>
53 typename InputType::elem_type
Forward(
const InputType& input,
54 const TargetType& target);
68 void Backward(
const InputType& input,
69 const TargetType& target,
78 double Margin()
const {
return margin; }
85 template<
typename Archive>
86 void serialize(Archive& ar,
const unsigned int );
90 OutputDataType outputParameter;
100 #include "margin_ranking_loss_impl.hpp" 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.
void Backward(const InputType &input, const TargetType &target, OutputType &output)
Ordinary feed backward pass of a neural network.
MarginRankingLoss(const double margin=1.0)
Create the MarginRankingLoss object with Hyperparameter margin.
void serialize(Archive &ar, const unsigned int)
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.
InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the Margin Ranking Loss function.
OutputDataType & OutputParameter()
Modify the output parameter.