本文整理匯總了Python中nupic.vision.regions.ImageSensorExplorers.BaseExplorer.BaseExplorer.update方法的典型用法代碼示例。如果您正苦於以下問題:Python BaseExplorer.update方法的具體用法?Python BaseExplorer.update怎麽用?Python BaseExplorer.update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nupic.vision.regions.ImageSensorExplorers.BaseExplorer.BaseExplorer
的用法示例。
在下文中一共展示了BaseExplorer.update方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: update
# 需要導入模塊: from nupic.vision.regions.ImageSensorExplorers.BaseExplorer import BaseExplorer [as 別名]
# 或者: from nupic.vision.regions.ImageSensorExplorers.BaseExplorer.BaseExplorer import update [as 別名]
def update(self, **kwargs):
"""
Update state with new parameters from ImageSensor and call first().
"""
numFilters = kwargs.get('numFilters', None)
if numFilters is not None and self.allDimensions:
# Remove existing filter dimensions
for dimension in self.dimensions[:]:
if type(dimension['name']) is int:
self.dimensions.remove(dimension)
# Reset the probabilities from the existing dimensions
for d in self.dimensions:
d['probability'] = None
# Add the new filter dimensions
self.dimensions += \
[self._newSweepDictionary(name=name) for name in range(numFilters)]
numImages = kwargs.get('numImages', None)
if numImages is not None and self.pattern:
# Parse all the filenames
self._parseFilenames(numImages)
self._calculateProbabilities()
BaseExplorer.update(self, **kwargs)