From b869597717c5f6b8b8ab4065ca9d662c25e8c846 Mon Sep 17 00:00:00 2001 From: Johannes Fischer Date: Mon, 2 Aug 2021 19:15:02 +0200 Subject: [PATCH] extend comment on divergence --- src/metrics.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/metrics.py b/src/metrics.py index fc28f7f..5e4997f 100644 --- a/src/metrics.py +++ b/src/metrics.py @@ -83,6 +83,11 @@ def divergence(p, q, type='kl', n_components=0): Args: p (torch.tensor): (n) samples from p q (torch.tensor): (m) samples from q + type (str): divergence to use + n_components (int): method to use to compute kl divergence + n_components < 0: approximate samples with histogram density + n_components == 0: approximate samples by Gaussian distributions and compute analytically + n_components > 0: approximate samples as Gaussian mixture models with n_components components Returns: d (float): approximate divergence """