def testColumnForCell2D(self): tm = ExtendedTemporalMemory(columnDimensions=[64, 64], cellsPerColumn=4) self.assertEqual(tm.columnForCell(0), 0) self.assertEqual(tm.columnForCell(3), 0) self.assertEqual(tm.columnForCell(4), 1) self.assertEqual(tm.columnForCell(16383), 4095)
def testColumnForCellInvalidCell(self): tm = ExtendedTemporalMemory(columnDimensions=[64, 64], cellsPerColumn=4) try: tm.columnForCell(16383) except IndexError: self.fail("IndexError raised unexpectedly") args = [16384] self.assertRaises(IndexError, tm.columnForCell, *args) args = [-1] self.assertRaises(IndexError, tm.columnForCell, *args)
def testColumnForCellInvalidCell(self): tm = ExtendedTemporalMemory(columnDimensions=[64, 64], cellsPerColumn=4) try: tm.columnForCell(16383) except IndexError: self.fail("IndexError raised unexpectedly") args = [16384] self.assertRaises(IndexError, tm.columnForCell, *args) args = [-1] self.assertRaises(IndexError, tm.columnForCell, *args)
def testColumnForCell2D(self): tm = ExtendedTemporalMemory(columnDimensions=[64, 64], cellsPerColumn=4) self.assertEqual(tm.columnForCell(0), 0) self.assertEqual(tm.columnForCell(3), 0) self.assertEqual(tm.columnForCell(4), 1) self.assertEqual(tm.columnForCell(16383), 4095)
def testColumnForCell1D(self): tm = ExtendedTemporalMemory(columnDimensions=[2048], cellsPerColumn=5) self.assertEqual(tm.columnForCell(0), 0) self.assertEqual(tm.columnForCell(4), 0) self.assertEqual(tm.columnForCell(5), 1) self.assertEqual(tm.columnForCell(10239), 2047)
def testColumnForCell1D(self): tm = ExtendedTemporalMemory(columnDimensions=[2048], cellsPerColumn=5) self.assertEqual(tm.columnForCell(0), 0) self.assertEqual(tm.columnForCell(4), 0) self.assertEqual(tm.columnForCell(5), 1) self.assertEqual(tm.columnForCell(10239), 2047)