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

Function test_gmm_pdf

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

Source from the content-addressed store, hash-verified

70
71
72def test_gmm_pdf(nx):
73 rng = np.random.RandomState(seed=42)
74 n = 7
75 d = 3
76 x = nx.from_numpy(rng.randn(n, d))
77 m, _, C, _, w, _ = get_gmms(nx)
78 pdf = gmm_pdf(x, m, C, w)
79 assert pdf.shape == (n,)
80
81 x = nx.from_numpy(rng.randn(n, n, d))
82 pdf = gmm_pdf(x, m, C, w)
83 assert pdf.shape == (
84 n,
85 n,
86 )
87
88 with pytest.raises(AssertionError):
89 gmm_pdf(x, m[:-1], C, w)
90
91
92@pytest.skip_backend("tf") # skips because of array assignment

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected