chainerx.gaussian_kl_divergence¶
-
chainerx.
gaussian_kl_divergence
()¶ Element-wise KL-divergence of Gaussian variables from the standard one.
Given two variable
mean
representing \(\mu\) andln_var
representing \(\log(\sigma^2)\), this function calculates the element-wise KL-divergence between the given multi-dimensional Gaussian \(N(\mu, S)\) and the standard Gaussian \(N(0, I)\)\[D_{\mathbf{KL}}(N(\mu, S) \| N(0, I)),\]where \(S\) is a diagonal matrix such that \(S_{ii} = \sigma_i^2\) and \(I\) is an identity matrix.
- Parameters
- Returns
A variable representing KL-divergence between given gaussian distribution and the standard gaussian.
- Return type