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
54 template<
typename InputType,
typename TargetType>
55 typename InputType::elem_type
Forward(
const InputType& input,
56 const TargetType& target);
65 template<
typename InputType,
typename TargetType,
typename OutputType>
66 void Backward(
const InputType& input,
67 const TargetType& target,
83 template<
typename Archive>
84 void serialize(Archive& ar,
const unsigned int );
88 OutputDataType outputParameter;
98 #include "soft_margin_loss_impl.hpp" InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the Soft Margin Loss function.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType & OutputParameter() const
Get the output parameter.
bool Reduction() const
Get the type of reduction used.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
bool & Reduction()
Modify the type of reduction used.
SoftMarginLoss(const bool reduction=true)
Create the SoftMarginLoss object.
void Backward(const InputType &input, const TargetType &target, OutputType &output)
Ordinary feed backward pass of a neural network.
OutputDataType & OutputParameter()
Modify the output parameter.