The binary-cross-entropy performance function measures the Binary Cross Entropy between the target and the output. More...
Public Member Functions | |
| BCELoss (const double eps=1e-10, const bool reduction=true) | |
| Create the BinaryCrossEntropyLoss object. More... | |
template < typename PredictionType , typename TargetType , typename LossType > | |
| void | Backward (const PredictionType &prediction, const TargetType &target, LossType &loss) |
| Ordinary feed backward pass of a neural network. More... | |
| double | Eps () const |
| Get the epsilon. More... | |
| double & | Eps () |
| Modify the epsilon. More... | |
template < typename PredictionType , typename TargetType > | |
| PredictionType::elem_type | Forward (const PredictionType &prediction, const TargetType &target) |
| Computes the cross-entropy function. More... | |
| OutputDataType & | OutputParameter () const |
| Get the output parameter. More... | |
| OutputDataType & | OutputParameter () |
| Modify the output parameter. More... | |
| bool | Reduction () const |
| Get the reduction. More... | |
| bool & | Reduction () |
| Set the reduction. More... | |
template < typename Archive > | |
| void | serialize (Archive &ar, const uint32_t) |
| Serialize the layer. More... | |
The binary-cross-entropy performance function measures the Binary Cross Entropy between the target and the output.
| 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 33 of file binary_cross_entropy_loss.hpp.
| BCELoss | ( | const double | eps = 1e-10, |
| const bool | reduction = true |
||
| ) |
Create the BinaryCrossEntropyLoss object.
| eps | The minimum value used for computing logarithms and denominators in a numerically stable way. |
| reduction | Reduction type. If true, it returns the mean of the loss. Else, it returns the sum. |
| void Backward | ( | const PredictionType & | prediction, |
| const TargetType & | target, | ||
| LossType & | loss | ||
| ) |
Ordinary feed backward pass of a neural network.
| prediction | Predictions used for evaluating the specified loss function. |
| target | The target vector. |
| loss | The calculated error. |
|
inline |
Get the epsilon.
Definition at line 76 of file binary_cross_entropy_loss.hpp.
|
inline |
Modify the epsilon.
Definition at line 78 of file binary_cross_entropy_loss.hpp.
| PredictionType::elem_type Forward | ( | const PredictionType & | prediction, |
| const TargetType & | target | ||
| ) |
Computes the cross-entropy function.
| prediction | Predictions used for evaluating the specified loss function. |
| target | The target vector. |
|
inline |
Get the output parameter.
Definition at line 71 of file binary_cross_entropy_loss.hpp.
|
inline |
Modify the output parameter.
Definition at line 73 of file binary_cross_entropy_loss.hpp.
|
inline |
Get the reduction.
Definition at line 81 of file binary_cross_entropy_loss.hpp.
|
inline |
Set the reduction.
Definition at line 83 of file binary_cross_entropy_loss.hpp.
References BCELoss< InputDataType, OutputDataType >::serialize().
| void serialize | ( | Archive & | ar, |
| const uint32_t | |||
| ) |
Serialize the layer.
Referenced by BCELoss< InputDataType, OutputDataType >::Reduction().