13 #ifndef MLPACK_METHODS_ANN_LOSS_FUNCTION_HINGE_LOSS_HPP 14 #define MLPACK_METHODS_ANN_LOSS_FUNCTION_HINGE_LOSS_HPP 34 typename InputDataType = arma::mat,
35 typename OutputDataType = arma::mat
58 template<
typename PredictionType,
typename TargetType>
59 typename PredictionType::elem_type
Forward(
const PredictionType& prediction,
60 const TargetType& target);
70 template<
typename PredictionType,
typename TargetType,
typename LossType>
71 void Backward(
const PredictionType& prediction,
72 const TargetType& target,
88 template<
typename Archive>
89 void serialize(Archive& ar,
const uint32_t );
93 OutputDataType outputParameter;
103 #include "hinge_loss_impl.hpp" OutputDataType & OutputParameter() const
Get the output parameter.
Computes the hinge loss between and .
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
HingeLoss(const bool reduction=true)
Create HingeLoss object.
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
OutputDataType & OutputParameter()
Modify the output parameter.
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the Hinge loss function.
bool Reduction() const
Get the type of reduction used.
bool & Reduction()
Modify the type of reduction used.