当前位置: 首页>>代码示例>>Python>>正文


Python PyRegion.__init__方法代码示例

本文整理汇总了Python中PyRegion.PyRegion.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python PyRegion.__init__方法的具体用法?Python PyRegion.__init__怎么用?Python PyRegion.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyRegion.PyRegion的用法示例。


在下文中一共展示了PyRegion.__init__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PyRegion import PyRegion [as 别名]
# 或者: from PyRegion.PyRegion import __init__ [as 别名]
  def __init__(self,
               columnCount,   # Number of columns in the SP, a required parameter
               inputWidth,    # Size of inputs to the SP, a required parameter
               spatialImp=getDefaultSPImp(),   #'py', 'cpp'
               **kwargs):

    if columnCount <= 0 or inputWidth <=0:
      raise TypeError("Parameters columnCount and inputWidth must be > 0")

    # Pull out the spatial arguments automatically
    # These calls whittle down kwargs and create instance variables of SPRegion
    self.SpatialClass = getSPClass(spatialImp)
    sArgTuples = _buildArgs(self.SpatialClass.__init__, self, kwargs)

    # Make a list of automatic spatial arg names for later use
    self._spatialArgNames = [t[0] for t in sArgTuples]

    # Learning and SP parameters.
    # By default we start out in stage learn with inference disabled
    self.learningMode   = True
    self.inferenceMode  = False
    self.anomalyMode    = False
    self.topDownMode    = False
    self.columnCount    = columnCount
    self.inputWidth     = inputWidth

    PyRegion.__init__(self, **kwargs)

    # Initialize all non-persistent base members, as well as give
    # derived class an opportunity to do the same.
    self._loaded = False
    self._initializeEphemeralMembers()

    # Debugging support, used in _conditionalBreak
    self.breakPdb = False
    self.breakKomodo = False

    # Defaults for all other parameters
    self.logPathInput = ''
    self.logPathOutput = ''
    self.logPathOutputDense = ''
    self._fpLogSPInput = None
    self._fpLogSP = None
    self._fpLogSPDense = None


    #
    # Variables set up in initInNetwork()
    #

    # Spatial instance
    self._sfdr                = None

    # Spatial pooler's bottom-up output value: hang on to this  output for
    # top-down inference and for debugging
    self._spatialPoolerOutput = None

    # Spatial pooler's bottom-up input: hang on to this for supporting the
    # spInputNonZeros parameter
    self._spatialPoolerInput  = None
开发者ID:NunoEdgarGub1,项目名称:nupic,代码行数:62,代码来源:SPRegion.py

示例2: __init__

# 需要导入模块: from PyRegion import PyRegion [as 别名]
# 或者: from PyRegion.PyRegion import __init__ [as 别名]
  def __init__(self,

               columnCount,   # Number of columns in the SP, a required parameter
               inputWidth,    # Size of inputs to the SP, a required parameter
               cellsPerColumn, # Number of cells per column, required

               # Constructor arguments are picked up automatically. There is no
               # need to add them anywhere in TPRegion, unless you need to do
               # something special with them. See docstring above.

               orColumnOutputs=False,
               cellsSavePath='',
               temporalImp=gDefaultTemporalImp,
               anomalyMode=False,

               **kwargs):

    # Which Temporal implementation?
    FDRTemporalClass = _getTPClass(temporalImp)

    # Make a list of automatic temporal arg names for later use
    # Pull out the temporal arguments automatically
    # These calls whittle down kwargs and create instance variables of TPRegion
    tArgTuples = _buildArgs(FDRTemporalClass.__init__, self, kwargs)

    self._temporalArgNames = [t[0] for t in tArgTuples]

    self.learningMode   = True      # Start out with learning enabled
    self.inferenceMode  = False
    self.anomalyMode    = anomalyMode
    self.topDownMode    = False
    self.columnCount    = columnCount
    self.inputWidth     = inputWidth
    self.outputWidth    = columnCount * cellsPerColumn
    self.cellsPerColumn = cellsPerColumn

    PyRegion.__init__(self, **kwargs)

    # Initialize all non-persistent base members, as well as give
    # derived class an opportunity to do the same.
    self._loaded = False
    self._initialize()

    # Debugging support, used in _conditionalBreak
    self.breakPdb = False
    self.breakKomodo = False

    # TPRegion only, or special handling
    self.orColumnOutputs = orColumnOutputs
    self.temporalImp = temporalImp

    # Various file names
    self.storeDenseOutput = False
    self.logPathOutput = ''
    self.cellsSavePath = cellsSavePath
    self._fpLogTPOutput = None

    # Variables set up in initInNetwork()
    self._tfdr                = None  # FDRTemporal instance
开发者ID:ARK1988,项目名称:nupic,代码行数:61,代码来源:TPRegion.py


注:本文中的PyRegion.PyRegion.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。