r""" Computes the (Generalized) Kullback-Leibler divergence. This function follows the api from :any:`scipy.stats.entropy`. Parameter eps is used to avoid numerical errors and is added in the log. .. math:: KL(p,q) = \langle \mathbf{p}, log(\mathbf{p}
(self, p, q, mass=False, eps=1e-16)
| 982 | raise NotImplementedError() |
| 983 | |
| 984 | def kl_div(self, p, q, mass=False, eps=1e-16): |
| 985 | r""" |
| 986 | Computes the (Generalized) Kullback-Leibler divergence. |
| 987 | |
| 988 | This function follows the api from :any:`scipy.stats.entropy`. |
| 989 | |
| 990 | Parameter eps is used to avoid numerical errors and is added in the log. |
| 991 | |
| 992 | .. math:: |
| 993 | KL(p,q) = \langle \mathbf{p}, log(\mathbf{p} / \mathbf{q} + eps \rangle |
| 994 | + \mathbb{1}_{mass=True} \langle \mathbf{q} - \mathbf{p}, \mathbf{1} \rangle |
| 995 | |
| 996 | See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.entropy.html |
| 997 | """ |
| 998 | raise NotImplementedError() |
| 999 | |
| 1000 | def isfinite(self, a): |
| 1001 | r""" |
no outgoing calls