16 #ifndef MLPACK_ANN_LOSS_FUNCTION_SOFT_MARGIN_LOSS_HPP 17 #define MLPACK_ANN_LOSS_FUNCTION_SOFT_MARGIN_LOSS_HPP 31 typename InputDataType = arma::mat,
32 typename OutputDataType = arma::mat
55 template<
typename PredictionType,
typename TargetType>
56 typename PredictionType::elem_type
Forward(
const PredictionType& prediction,
57 const TargetType& target);
67 template<
typename PredictionType,
typename TargetType,
typename LossType>
68 void Backward(
const PredictionType& prediction,
69 const TargetType& target,
85 template<
typename Archive>
86 void serialize(Archive& ar,
const uint32_t version);
90 OutputDataType outputParameter;
SoftMarginLoss(const bool reduction=true)
Create the SoftMarginLoss object.
Definition: soft_margin_loss_impl.hpp:23
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the Soft Margin Loss function.
Definition: soft_margin_loss_impl.hpp:31
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.
bool & Reduction()
Modify the type of reduction used.
Definition: soft_margin_loss.hpp:80
bool Reduction() const
Get the type of reduction used.
Definition: soft_margin_loss.hpp:78
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
Definition: soft_margin_loss_impl.hpp:45
Definition: soft_margin_loss.hpp:34
void serialize(Archive &ar, const uint32_t version)
Serialize the layer.
Definition: soft_margin_loss_impl.hpp:62
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: soft_margin_loss.hpp:73
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: soft_margin_loss.hpp:75