Function slam_mer::statistics::kl_divergence(const dictionary_t<keyframe_id_t, int>&, const dictionary_t<keyframe_id_t, int>&, bool, float)

Function Documentation

float slam_mer::statistics::kl_divergence(const dictionary_t<keyframe_id_t, int> &P_, const dictionary_t<keyframe_id_t, int> &Q_, bool normalize_ = true, float epsilon_ = 1e-12)

Compute KL(P || Q) for two histograms P and Q.

Parameters:
  • P_ – Histogram counts for distribution P, indexed by keyframe ID.

  • Q_ – Histogram counts for distribution Q, indexed by keyframe ID.

  • normalize_ – Enables conversion of counts into probability vectors.

  • epsilon_ – Nonnegative Laplace-smoothing factor added per bin.

Returns:

Kullback-Leibler divergence value KL(P || Q).