code: def test_forward(self):
      fwd = self.hmm.forward(OBS_SEQ)
      self.assertTrue(np.allclose(fwd, CORRECT_FWD))
      # two runs must yield identical results
      fwd = self.hmm.forward(OBS_SEQ)
      self.assertTrue(np.allclose(fwd, CORRECT_FWD))
      # after resetting the HMM, it must produce the same output as before
      self.hmm.reset()
      fwd = np.vstack(
          [
              self.hmm.forward(np.atleast_1d(o), reset=False)
              for o in OBS_SEQ
          ]
      )
      self.assertTrue(np.allclose(fwd, CORRECT_FWD))
      # without resetting it produces different results
      fwd = np.vstack(
          [
              self.hmm.forward(np.atleast_1d(o), reset=False)
              for o in OBS_SEQ
          ]
      )
      self.assertFalse(np.allclose(fwd, CORRECT_FWD))
      # after resetting it must yield the correct result again
      self.hmm.reset()
      fwd = np.vstack(
          [
              self.hmm.forward(np.atleast_1d(o), reset=False)
              for o in OBS_SEQ
          ]
      )
      self.assertTrue(np.allclose(fwd, CORRECT_FWD))
      # initialisation must not change
      self.assertTrue(np.allclose(self.hmm.initial_distribution, PRIOR))
  
imports: from __future__ import absolute_import, division, print_function
  import sys
  import unittest
  from madmom.ml.hmm import *
label_desc: Use image node_id 3 for calling the TestHiddenMarkovModelClass obj's underlying member method code with example usage: obj.test_forward() without return types