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);
69 const TargetType& target,
78 double Margin()
const {
return margin; }
85 template<
typename Archive>
90 OutputDataType outputParameter;
100#include "margin_ranking_loss_impl.hpp"
Margin ranking loss measures the loss given inputs and a label vector with values of 1 or -1.
MarginRankingLoss(const double margin=1.0)
Create the MarginRankingLoss object with Hyperparameter margin.
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.
double & Margin()
Modify the margin parameter.
InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the Margin Ranking Loss function.
double Margin() const
Get the margin parameter.
OutputDataType & OutputParameter()
Modify the output parameter.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.