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;
HingeLoss(const bool reduction=true)
Create HingeLoss object.
Definition: hinge_loss_impl.hpp:23
Computes the hinge loss between and .
Definition: hinge_loss.hpp:37
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: hinge_loss.hpp:78
bool Reduction() const
Get the type of reduction used.
Definition: hinge_loss.hpp:81
bool & Reduction()
Modify the type of reduction used.
Definition: hinge_loss.hpp:83
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
Definition: hinge_loss_impl.hpp:51
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: hinge_loss.hpp:76
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the Hinge loss function.
Definition: hinge_loss_impl.hpp:32
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: hinge_loss_impl.hpp:65