The Kullback–Leibler divergence is often used for continuous distributions (direct regression). More...
Public Member Functions | |
KLDivergence (const bool takeMean=false) | |
Create the Kullback–Leibler Divergence object with the specified parameters. 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... | |
template < typename PredictionType , typename TargetType > | |
PredictionType::elem_type | Forward (const PredictionType &prediction, const TargetType &target) |
Computes the Kullback–Leibler divergence error function. More... | |
OutputDataType & | OutputParameter () const |
Get the output parameter. More... | |
OutputDataType & | OutputParameter () |
Modify the output parameter. More... | |
template < typename Archive > | |
void | serialize (Archive &ar, const uint32_t) |
Serialize the loss function. More... | |
bool | TakeMean () const |
Get the value of takeMean. More... | |
bool & | TakeMean () |
Modify the value of takeMean. More... | |
The Kullback–Leibler divergence is often used for continuous distributions (direct regression).
For more information, see the following paper.
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 45 of file kl_divergence.hpp.
KLDivergence | ( | const bool | takeMean = false | ) |
Create the Kullback–Leibler Divergence object with the specified parameters.
takeMean | Boolean variable to specify whether to take mean or not. |
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. |
PredictionType::elem_type Forward | ( | const PredictionType & | prediction, |
const TargetType & | target | ||
) |
Computes the Kullback–Leibler divergence error function.
prediction | Predictions used for evaluating the specified loss function. |
target | Target data to compare with. |
|
inline |
Get the output parameter.
Definition at line 81 of file kl_divergence.hpp.
|
inline |
Modify the output parameter.
Definition at line 83 of file kl_divergence.hpp.
void serialize | ( | Archive & | ar, |
const uint32_t | |||
) |
Serialize the loss function.
Referenced by KLDivergence< InputDataType, OutputDataType >::TakeMean().
|
inline |
Get the value of takeMean.
Definition at line 86 of file kl_divergence.hpp.
|
inline |
Modify the value of takeMean.
Definition at line 88 of file kl_divergence.hpp.
References KLDivergence< InputDataType, OutputDataType >::serialize().