Public Member Functions | |
SoftMarginLoss (const bool reduction=true) | |
Create the SoftMarginLoss object. More... | |
template | |
void | Backward (const InputType &input, const TargetType &target, OutputType &output) |
Ordinary feed backward pass of a neural network. More... | |
template | |
InputType::elem_type | Forward (const InputType &input, const TargetType &target) |
Computes the Soft Margin Loss function. More... | |
OutputDataType & | OutputParameter () const |
Get the output parameter. More... | |
OutputDataType & | OutputParameter () |
Modify the output parameter. More... | |
bool | Reduction () const |
Get the type of reduction used. More... | |
bool & | Reduction () |
Modify the type of reduction used. More... | |
template | |
void | serialize (Archive &ar, const unsigned int) |
Serialize the layer. More... | |
InputDataType | Type of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
OutputDataType | Type of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
Definition at line 34 of file soft_margin_loss.hpp.
SoftMarginLoss | ( | const bool | reduction = true | ) |
Create the SoftMarginLoss object.
reduction | Specifies the reduction to apply to the output. If false, 'mean' reduction is used, where sum of the output will be divided by the number of elements in the output. If true, 'sum' reduction is used and the output will be summed. It is set to true by default. |
void Backward | ( | const InputType & | input, |
const TargetType & | target, | ||
OutputType & | output | ||
) |
Ordinary feed backward pass of a neural network.
input | The propagated input activation. |
target | The target vector. |
output | The calculated error. |
InputType::elem_type Forward | ( | const InputType & | input, |
const TargetType & | target | ||
) |
Computes the Soft Margin Loss function.
input | Input data used for evaluating the specified function. |
target | The target vector with same shape as input. |
|
inline |
Get the output parameter.
Definition at line 71 of file soft_margin_loss.hpp.
|
inline |
Modify the output parameter.
Definition at line 73 of file soft_margin_loss.hpp.
|
inline |
Get the type of reduction used.
Definition at line 76 of file soft_margin_loss.hpp.
|
inline |
Modify the type of reduction used.
Definition at line 78 of file soft_margin_loss.hpp.
References SoftMarginLoss< InputDataType, OutputDataType >::serialize().
void serialize | ( | Archive & | ar, |
const unsigned | int | ||
) |
Serialize the layer.
Referenced by SoftMarginLoss< InputDataType, OutputDataType >::Reduction().