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