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 InputType , typename TargetType , typename OutputType > | |
| void | Backward (const InputType &&input, const TargetType &&target, OutputType &&output) |
| Ordinary feed backward pass of a neural network. More... | |
| OutputDataType & | Delta () const |
| Get the delta. More... | |
| OutputDataType & | Delta () |
| Modify the delta. More... | |
template < typename InputType , typename TargetType > | |
| double | Forward (const InputType &&input, const TargetType &&target) |
| Computes the Kullback–Leibler divergence error function. More... | |
| InputDataType & | InputParameter () const |
| Get the input parameter. More... | |
| InputDataType & | InputParameter () |
| Modify the input parameter. More... | |
| OutputDataType & | OutputParameter () const |
| Get the output parameter. More... | |
| OutputDataType & | OutputParameter () |
| Modify the output parameter. More... | |
template < typename Archive > | |
| void | serialize (Archive &ar, const unsigned int) |
| 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 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 delta.
Definition at line 88 of file kl_divergence.hpp.
|
inline |
Modify the delta.
Definition at line 90 of file kl_divergence.hpp.
| double Forward | ( | const InputType && | input, |
| const TargetType && | target | ||
| ) |
Computes the Kullback–Leibler divergence error function.
| input | Input data used for evaluating the specified function. |
| target | Target data to compare with. |
|
inline |
Get the input parameter.
Definition at line 78 of file kl_divergence.hpp.
|
inline |
Modify the input parameter.
Definition at line 80 of file kl_divergence.hpp.
|
inline |
Get the output parameter.
Definition at line 83 of file kl_divergence.hpp.
|
inline |
Modify the output parameter.
Definition at line 85 of file kl_divergence.hpp.
| void serialize | ( | Archive & | ar, |
| const unsigned | int | ||
| ) |
Serialize the loss function.
Referenced by KLDivergence< InputDataType, OutputDataType >::TakeMean().
|
inline |
Get the value of takeMean.
Definition at line 93 of file kl_divergence.hpp.
|
inline |
Modify the value of takeMean.
Definition at line 95 of file kl_divergence.hpp.
References KLDivergence< InputDataType, OutputDataType >::serialize().