13 #ifndef MLPACK_ANN_LOSS_FUNCTION_TRIPLET_MARGIN_LOSS_HPP 14 #define MLPACK_ANN_LOSS_FUNCTION_TRIPLET_MARGIN_LOSS_HPP 45 typename InputDataType = arma::mat,
46 typename OutputDataType = arma::mat
66 template<
typename PredictionType,
typename TargetType>
67 typename PredictionType::elem_type
Forward(
const PredictionType& prediction,
68 const TargetType& target);
76 template<
typename PredictionType,
typename TargetType,
typename LossType>
77 void Backward(
const PredictionType& prediction,
78 const TargetType& target,
87 double Margin()
const {
return margin; }
94 template<
typename Archive>
95 void serialize(Archive& ar,
const unsigned int );
99 OutputDataType outputParameter;
TripletMarginLoss(const double margin=1.0)
Create the TripletMarginLoss object.
Definition: triplet_margin_loss_impl.hpp:23
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: triplet_margin_loss.hpp:84
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
double & Margin()
Modify the value of margin.
Definition: triplet_margin_loss.hpp:89
The core includes that mlpack expects; standard C++ includes and Armadillo.
double Margin() const
Get the value of margin.
Definition: triplet_margin_loss.hpp:87
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the Triplet Margin Loss function.
Definition: triplet_margin_loss_impl.hpp:32
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: triplet_margin_loss.hpp:82
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
Definition: triplet_margin_loss_impl.hpp:51
The Triplet Margin Loss performance function measures the network's performance according to the rela...
Definition: triplet_margin_loss.hpp:48
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
Definition: triplet_margin_loss_impl.hpp:64