Public Member Functions | |
MultiLabelSoftMarginLoss (const bool reduction=true, const arma::rowvec &weights=arma::rowvec()) | |
Create the MultiLabelSoftMarginLoss object. More... | |
template < typename InputType , typename TargetType , typename OutputType > | |
void | Backward (const InputType &input, const TargetType &target, OutputType &output) |
Ordinary feed backward pass of a neural network. More... | |
const arma::rowvec & | ClassWeights () const |
Get the weights assigned to each class. More... | |
arma::rowvec & | ClassWeights () |
Modify the weights assigned to each class. More... | |
template < typename InputType , typename TargetType > | |
InputType::elem_type | Forward (const InputType &input, const TargetType &target) |
Computes the Multi Label 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 < typename Archive > | |
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 multilabel_softmargin_loss.hpp.
MultiLabelSoftMarginLoss | ( | const bool | reduction = true , |
const arma::rowvec & | weights = arma::rowvec() |
||
) |
Create the MultiLabelSoftMarginLoss 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. |
weights | A manual rescaling weight given to each class. It is a (1, numClasses) row vector. |
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. |
|
inline |
Get the weights assigned to each class.
Definition at line 79 of file multilabel_softmargin_loss.hpp.
|
inline |
Modify the weights assigned to each class.
Definition at line 81 of file multilabel_softmargin_loss.hpp.
InputType::elem_type Forward | ( | const InputType & | input, |
const TargetType & | target | ||
) |
Computes the Multi Label 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 74 of file multilabel_softmargin_loss.hpp.
|
inline |
Modify the output parameter.
Definition at line 76 of file multilabel_softmargin_loss.hpp.
|
inline |
Get the type of reduction used.
Definition at line 84 of file multilabel_softmargin_loss.hpp.
|
inline |
Modify the type of reduction used.
Definition at line 86 of file multilabel_softmargin_loss.hpp.
References MultiLabelSoftMarginLoss< InputDataType, OutputDataType >::serialize().
void serialize | ( | Archive & | ar, |
const unsigned | int | ||
) |
Serialize the layer.
Referenced by MultiLabelSoftMarginLoss< InputDataType, OutputDataType >::Reduction().