本文整理汇总了Python中nupic.algorithms.temporal_memory.TemporalMemory.cellsForColumn方法的典型用法代码示例。如果您正苦于以下问题:Python TemporalMemory.cellsForColumn方法的具体用法?Python TemporalMemory.cellsForColumn怎么用?Python TemporalMemory.cellsForColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nupic.algorithms.temporal_memory.TemporalMemory
的用法示例。
在下文中一共展示了TemporalMemory.cellsForColumn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testCellsForColumn2D
# 需要导入模块: from nupic.algorithms.temporal_memory import TemporalMemory [as 别名]
# 或者: from nupic.algorithms.temporal_memory.TemporalMemory import cellsForColumn [as 别名]
def testCellsForColumn2D(self):
tm = TemporalMemory(
columnDimensions=[64, 64],
cellsPerColumn=4
)
expectedCells = [256, 257, 258, 259]
self.assertEqual(tm.cellsForColumn(64), expectedCells)
示例2: testCellsForColumnInvalidColumn
# 需要导入模块: from nupic.algorithms.temporal_memory import TemporalMemory [as 别名]
# 或者: from nupic.algorithms.temporal_memory.TemporalMemory import cellsForColumn [as 别名]
def testCellsForColumnInvalidColumn(self):
tm = TemporalMemory(
columnDimensions=[64, 64],
cellsPerColumn=4
)
try:
tm.cellsForColumn(4095)
except IndexError:
self.fail("IndexError raised unexpectedly")
args = [4096]
self.assertRaises(IndexError, tm.cellsForColumn, *args)
args = [-1]
self.assertRaises(IndexError, tm.cellsForColumn, *args)
示例3: testCellsForColumn1D
# 需要导入模块: from nupic.algorithms.temporal_memory import TemporalMemory [as 别名]
# 或者: from nupic.algorithms.temporal_memory.TemporalMemory import cellsForColumn [as 别名]
def testCellsForColumn1D(self):
tm = TemporalMemory(
columnDimensions=[2048],
cellsPerColumn=5
)
expectedCells = [5, 6, 7, 8, 9]
self.assertEqual(tm.cellsForColumn(1), expectedCells)