32 #ifndef SHARK_RNG_KULLBACK_LEIBER_DIVERGENCE_H 33 #define SHARK_RNG_KULLBACK_LEIBER_DIVERGENCE_H 48 template<
typename DistributionP,
typename DistributionQ>
51 throw(
shark::Exception(
"kullback_leiber_divergence: Trial count needs to be larger than 0.", __FILE__, __LINE__ ) );
55 for (
unsigned int i = 0; i < trials; i++ ) {
57 t += ::log( p.p( x ) / q.p( x ) );