def test_unambiguous_decoding(self): means = np.array([0.0, 5.0, 10.0]) scales = np.array([1.0, 1.0, 1.0]) durations = np.array([ [0.1, 0.0, 0.0, 0.9], [0.1, 0.0, 0.9, 0.0], [0.1, 0.9, 0.0, 0.0] ]) tmat = np.array([ [0.0, 0.5, 0.5], [0.5, 0.0, 0.5], [0.5, 0.5, 0.0] ]) hsmm = HSMMModel( GaussianEmissions(means, scales), durations, tmat ) observations, states = hsmm.sample(1000) new_states = hsmm.decode(observations) np.testing.assert_array_equal(states, new_states)
def test_unambiguous_decoding(self): emissions = np.array([ [0.5, 0.5, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.5, 0.5, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.5, 0.5] ]) durations = np.array([ [0.1, 0.0, 0.0, 0.9], [0.1, 0.0, 0.9, 0.0], [0.1, 0.9, 0.0, 0.0] ]) tmat = np.array([ [0.0, 0.5, 0.5], [0.5, 0.0, 0.5], [0.5, 0.5, 0.0] ]) hsmm = HSMMModel( MultinomialEmissions(emissions), durations, tmat) observations, states = hsmm.sample(1000) new_states = hsmm.decode(observations) np.testing.assert_array_equal(states, new_states)