code: def test_discrete_bam_sync(self):
      bamnet = algorithms.DiscreteBAM(mode="sync")
      bamnet.train(self.data, self.hints)
  
      data_before = self.data.copy()
      hints_before = self.hints.copy()
  
      np.testing.assert_array_almost_equal(
          bamnet.predict(half_zero)[1], zero_hint
      )
      np.testing.assert_array_almost_equal(
          bamnet.predict_output(half_one)[1], one_hint
      )
      np.testing.assert_array_almost_equal(
          bamnet.predict_input(zero_hint)[0], zero
      )
      np.testing.assert_array_almost_equal(
          bamnet.predict_input(one_hint)[0], one
      )
  
      # Test 1d input array prediction
      np.testing.assert_array_almost_equal(
          bamnet.predict_input(one_hint.ravel())[0], one
      )
  
      # Test 1d output array input prediction
      np.testing.assert_array_almost_equal(
          bamnet.predict_output(half_one.ravel())[1], one_hint
      )
  
      # Test multiple input values prediction
      input_matrix = np.vstack([one, zero])
      output_matrix = np.vstack([one_hint, zero_hint])
      output_matrix_before = output_matrix.copy()
      input_matrix_before = input_matrix.copy()
  
      np.testing.assert_array_almost_equal(
          bamnet.predict_input(output_matrix)[0], input_matrix
      )
      np.testing.assert_array_almost_equal(
          bamnet.predict(input_matrix)[1], output_matrix
      )
  
      np.testing.assert_array_equal(self.data, data_before)
      np.testing.assert_array_equal(self.hints, hints_before)
      np.testing.assert_array_equal(output_matrix, output_matrix_before)
      np.testing.assert_array_equal(input_matrix, input_matrix_before)
  
file_path: neupy/tests/algorithms/memory/test_bam.py
imports: import pickle
  import numpy
  from neupy import algorithms
  from neupy.exceptions import NotTrained
  from algorithms.memory.data import zero, one, half_one, half_zero
  from base import BaseTestCase
  from helpers import vectors_for_testing
label_desc: Use image node_id 5 for calling the BAMTestCase obj's underlying member method code with example usage: obj.test_discrete_bam_sync() without return types