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;
   100 #include "soft_margin_loss_impl.hpp" Linear algebra utility functions, generally performed on matrices or vectors. 
 
void serialize(Archive &ar, const uint32_t version)
Serialize the layer. 
 
The core includes that mlpack expects; standard C++ includes and Armadillo. 
 
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the Soft Margin Loss function. 
 
OutputDataType & OutputParameter() const
Get the output parameter. 
 
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network. 
 
bool Reduction() const
Get the type of reduction used. 
 
bool & Reduction()
Modify the type of reduction used. 
 
SoftMarginLoss(const bool reduction=true)
Create the SoftMarginLoss object. 
 
OutputDataType & OutputParameter()
Modify the output parameter.