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() const
Get the output parameter.
void Backward(const InputType &input, const TargetType &target, OutputType &output)
Ordinary feed backward pass of a neural network.
InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the Soft Margin Loss function.
SoftMarginLoss(const bool reduction=true)
Create the SoftMarginLoss object.
OutputDataType & OutputParameter()
Modify the output parameter.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
bool Reduction() const
Get the type of reduction used.
bool & Reduction()
Modify 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.