powered by
This function computes \(D_{KL}(p||q)\), where \(p\sim \text{U}(a,b)\) and \(q\sim \mathcal{N}(\mu,\sigma^2)\).
kld_uniform_gaussian(a = 0, b = 1, mu = 0, sigma2 = 1)
A scalar (the Kullback-Leibler divergence)
Parameters of uniform (true) distribution
Parameters of Gaussian (approximate) distribution
Run the code above in your browser using DataLab