本文整理汇总了Python中nupic.algorithms.temporal_memory.TemporalMemory.getCellsPerColumn方法的典型用法代码示例。如果您正苦于以下问题:Python TemporalMemory.getCellsPerColumn方法的具体用法?Python TemporalMemory.getCellsPerColumn怎么用?Python TemporalMemory.getCellsPerColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nupic.algorithms.temporal_memory.TemporalMemory
的用法示例。
在下文中一共展示了TemporalMemory.getCellsPerColumn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Client
# 需要导入模块: from nupic.algorithms.temporal_memory import TemporalMemory [as 别名]
# 或者: from nupic.algorithms.temporal_memory.TemporalMemory import getCellsPerColumn [as 别名]
class Client(object):
def __init__(self,
numberOfCols=16384,
cellsPerColumn=8,
activationThreshold=60,
minThreshold=60,
verbosity=0
):
self.tm = TM(
columnDimensions=(numberOfCols,),
cellsPerColumn=cellsPerColumn,
activationThreshold=activationThreshold,
minThreshold=minThreshold,
maxNewSynapseCount=164,
initialPermanence=0.21,
connectedPermanence=0.3,
permanenceIncrement=0.1,
permanenceDecrement=0.0,
predictedSegmentDecrement=0.0,
)
if verbosity > 0:
print "TM Params:"
print "columnDimensions: {}".format(self.tm.getColumnDimensions())
print "cellsPerColumn: {}".format(self.tm.getCellsPerColumn())
print "activationThreshold: {}".format(self.tm.getActivationThreshold())
print "minThreshold: {}".format(self.tm.getMinThreshold())
print "maxNewSynapseCount {}".format(self.tm.getMaxNewSynapseCount())
print "initialPermanence {}".format(self.tm.getInitialPermanence())
print "connectedPermanence {}".format(self.tm.getConnectedPermanence())
print "permanenceIncrement {}".format(self.tm.getPermanenceIncrement())
print "permanenceDecrement {}".format(self.tm.getPermanenceDecrement())
print "predictedSegmentDecrement {}".format(self.tm.getPredictedSegmentDecrement())
def feed(self, sdr, learn=True):
tm = self.tm
narr = numpy.array(sdr, dtype="uint32")
tm.compute(narr, learn=learn)
# This returns the indices of the predictive minicolumns.
predictiveCells = tm.getPredictiveCells()
return numpy.unique(numpy.array(predictiveCells) / tm.getCellsPerColumn())
def reset(self):
self.tm.reset()