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;
109 #include "triplet_margin_loss_impl.hpp" double Margin() const
Get the value of margin.
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 value of margin.
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 Triplet Margin Loss function.
OutputDataType & OutputParameter()
Modify the output parameter.
TripletMarginLoss(const double margin=1.0)
Create the TripletMarginLoss object.
The Triplet Margin Loss performance function measures the network's performance according to the rela...
void serialize(Archive &ar, const unsigned int)
Serialize the layer.