Skip to content
Snippets Groups Projects

Port of I-Vector to python

Merged Yannick DAYER requested to merge ivector into master
2 files
+ 24
27
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -130,11 +130,10 @@ def test_ivector_machine_training():
test_data.sum_px = np.array([[8, 0, 4], [6, 6, 6]])
test_data.sum_pxx = np.array([[10, 20, 30], [60, 70, 80]])
projected = machine.project(test_data)
print([f"{p:.8f}" for p in projected])
proj_reference = np.array([0.94234370, -0.61558459])
np.testing.assert_almost_equal(projected, proj_reference, decimal=7)
np.testing.assert_almost_equal(projected, proj_reference, decimal=4)
def _load_references_from_file(filename):
@@ -202,7 +201,7 @@ def test_trainer_nosigma():
)
# M-Step
m_step(m, [stats])
m_step(m, stats)
np.testing.assert_almost_equal(references[it]["T"], m.T, decimal=5)
np.testing.assert_equal(
init_sigma, m.sigma
@@ -260,7 +259,7 @@ def test_trainer_update_sigma():
)
# M-Step
m_step(m, [stats])
m_step(m, stats)
np.testing.assert_almost_equal(references[it]["T"], m.T, decimal=5)
np.testing.assert_almost_equal(
references[it]["sigma"], m.sigma, decimal=5
Loading