MCPcopy Create free account
hub / github.com/PythonOT/POT / test_gaussian_pdf

Function test_gaussian_pdf

test/test_gmm.py:52–69  ·  view source on GitHub ↗
(nx)

Source from the content-addressed store, hash-verified

50
51
52def test_gaussian_pdf(nx):
53 rng = np.random.RandomState(seed=42)
54 n = 7
55 d = 3
56 x = nx.from_numpy(rng.randn(n, d))
57 m, _, C, _, _, _ = get_gmms(nx)
58 pdf = gaussian_pdf(x, m[0], C[0])
59 assert pdf.shape == (n,)
60
61 x = nx.from_numpy(rng.randn(n, n, d))
62 pdf = gaussian_pdf(x, m[0], C[0])
63 assert pdf.shape == (
64 n,
65 n,
66 )
67
68 with pytest.raises(AssertionError):
69 gaussian_pdf(x, m[0, :-1], C[0])
70
71
72def test_gmm_pdf(nx):

Callers

nothing calls this directly

Calls 4

gaussian_pdfFunction · 0.90
get_gmmsFunction · 0.85
from_numpyMethod · 0.80
randnMethod · 0.45

Tested by

no test coverage detected