Ejemplo n.º 1
0
def test_multi_mass(T, m):
    trivial_idx = 2

    Q = T[:, trivial_idx:trivial_idx + m]

    ref = naive.multi_mass(Q, T, m)

    M_T, Σ_T = core.compute_mean_std(T, m)
    comp = _multi_mass(Q, T, m, M_T, Σ_T, M_T[:, trivial_idx],
                       Σ_T[:, trivial_idx])

    npt.assert_almost_equal(ref, comp, decimal=config.STUMPY_TEST_PRECISION)
Ejemplo n.º 2
0
def test_multi_mass_seeded():
    np.random.seed(5)
    T = np.random.uniform(-1000, 1000, [3, 10]).astype(np.float64)
    m = 5

    trivial_idx = 2

    Q = T[:, trivial_idx:trivial_idx + m]

    ref = naive.multi_mass(Q, T, m)

    M_T, Σ_T = core.compute_mean_std(T, m)
    comp = _multi_mass(Q, T, m, M_T, Σ_T, M_T[:, trivial_idx],
                       Σ_T[:, trivial_idx])

    npt.assert_almost_equal(ref, comp, decimal=config.STUMPY_TEST_PRECISION)