本文整理汇总了Python中nupic.bindings.algorithms.SpatialPooler.getActiveDutyCycles方法的典型用法代码示例。如果您正苦于以下问题:Python SpatialPooler.getActiveDutyCycles方法的具体用法?Python SpatialPooler.getActiveDutyCycles怎么用?Python SpatialPooler.getActiveDutyCycles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nupic.bindings.algorithms.SpatialPooler
的用法示例。
在下文中一共展示了SpatialPooler.getActiveDutyCycles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SpatialPoolerAPITest
# 需要导入模块: from nupic.bindings.algorithms import SpatialPooler [as 别名]
# 或者: from nupic.bindings.algorithms.SpatialPooler import getActiveDutyCycles [as 别名]
#.........这里部分代码省略.........
def testGetBoostFactors(self):
numInputs = 3
numColumns = 3
self.sp.initialize(columnDimensions=[numInputs],
inputDimensions=[numColumns])
inParam = numpy.array([1, 1.2, 1.3, ]).astype(realType)
self.sp.setBoostFactors(inParam)
outParam = numpy.zeros(numInputs).astype(realType)
self.sp.getBoostFactors(outParam)
self.assertListEqual(list(inParam),list(outParam))
def testGetOverlapDutyCycles(self):
numInputs = 3
numColumns = 3
self.sp.initialize(columnDimensions=[numInputs],
inputDimensions=[numColumns])
inParam = numpy.array([0.9, 0.3, 0.1]).astype(realType)
self.sp.setOverlapDutyCycles(inParam)
outParam = numpy.zeros(numInputs).astype(realType)
self.sp.getOverlapDutyCycles(outParam)
self.assertListEqual(list(inParam),list(outParam))
def testGetActiveDutyCycles(self):
numInputs = 3
numColumns = 3
self.sp.initialize(columnDimensions=[numInputs],
inputDimensions=[numColumns])
inParam = numpy.array([0.9, 0.99, 0.999, ]).astype(realType)
self.sp.setActiveDutyCycles(inParam)
outParam = numpy.zeros(numInputs).astype(realType)
self.sp.getActiveDutyCycles(outParam)
self.assertListEqual(list(inParam),list(outParam))
def testGetMinOverlapDutyCycles(self):
numInputs = 3
numColumns = 3
self.sp.initialize(columnDimensions=[numInputs],
inputDimensions=[numColumns])
inParam = numpy.array([0.01, 0.02, 0.035, ]).astype(realType)
self.sp.setMinOverlapDutyCycles(inParam)
outParam = numpy.zeros(numInputs).astype(realType)
self.sp.getMinOverlapDutyCycles(outParam)
self.assertListEqual(list(inParam),list(outParam))
def testGetPotential(self):
self.sp.initialize(columnDimensions=[3], inputDimensions=[3])
numInputs = 3
numColumns = 3
self.sp.initialize(columnDimensions=[numInputs],
inputDimensions=[numColumns])
inParam1 = numpy.array([1, 0, 1]).astype(uintType)
self.sp.setPotential(0, inParam1)
inParam2 = numpy.array([1, 1, 0]).astype(uintType)
self.sp.setPotential(1, inParam2)
outParam1 = numpy.zeros(numInputs).astype(uintType)
outParam2 = numpy.zeros(numInputs).astype(uintType)
self.sp.getPotential(0, outParam1)
self.sp.getPotential(1, outParam2)
self.assertListEqual(list(inParam1),list(outParam1))