本文整理汇总了Python中nupic.research.TP.TP.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python TP.__init__方法的具体用法?Python TP.__init__怎么用?Python TP.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nupic.research.TP.TP
的用法示例。
在下文中一共展示了TP.__init__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from nupic.research.TP import TP [as 别名]
# 或者: from nupic.research.TP.TP import __init__ [as 别名]
def __init__(self,
numberOfCols =500,
burnIn =2, # Used for evaluating the prediction score
collectStats =False, # If true, collect training and inference stats
seed =42,
verbosity =VERBOSITY,
predictionMethod = 'random', # "random" or "zeroth"
**kwargs
):
# Init the base class
TP.__init__(self,
numberOfCols = numberOfCols,
cellsPerColumn = 1,
burnIn = burnIn,
collectStats = collectStats,
seed = seed,
verbosity = verbosity)
self.predictionMethod = predictionMethod
#---------------------------------------------------------------------------------
# Create basic data structures for keeping track of column statistics
# Number of times each column has been active during learning
self.columnCount = numpy.zeros(numberOfCols, dtype="int32")
# Running average of input density
self.averageDensity = 0.05
示例2: __init__
# 需要导入模块: from nupic.research.TP import TP [as 别名]
# 或者: from nupic.research.TP.TP import __init__ [as 别名]
def __init__(self,
numberOfCols = 500,
cellsPerColumn = 10,
initialPerm = 0.11, # TODO: check perm numbers with Ron
connectedPerm = 0.50,
minThreshold = 8,
newSynapseCount = 15,
permanenceInc = 0.10,
permanenceDec = 0.10,
permanenceMax = 1.0, # never exceed this value
globalDecay = 0.10,
activationThreshold = 12, # 3/4 of newSynapseCount TODO make fraction
doPooling = False, # allows to turn off pooling
segUpdateValidDuration = 5,
burnIn = 2, # Used for evaluating the prediction score
collectStats = False, # If true, collect training and inference stats
seed = 42,
verbosity = VERBOSITY,
checkSynapseConsistency = False,
# List (as string) of trivial predictions to compute alongside
# the full TP. See TrivialPredictor.py for a list of allowed methods
trivialPredictionMethods = '',
pamLength = 1,
maxInfBacktrack = 10,
maxLrnBacktrack = 5,
maxAge = 100000,
maxSeqLength = 32,
# Fixed size mode params
maxSegmentsPerCell = -1,
maxSynapsesPerSegment = -1,
# Output control
outputType = 'normal',
):
#---------------------------------------------------------------------------------
# Save our __init__ args for debugging
self._initArgsDict = _extractCallingMethodArgs()
#---------------------------------------------------------------------------------
# These two variables are for testing
# If set to True, Cells4 will perform (time consuming) invariance checks
self.checkSynapseConsistency = checkSynapseConsistency
# If set to False, Cells4 will *not* be treated as an ephemeral member
# and full TP10X pickling is possible. This is useful for testing
# pickle/unpickle without saving Cells4 to an external file
self.makeCells4Ephemeral = True
#---------------------------------------------------------------------------------
# Init the base class
TP.__init__(self,
numberOfCols = numberOfCols,
cellsPerColumn = cellsPerColumn,
initialPerm = initialPerm,
connectedPerm = connectedPerm,
minThreshold = minThreshold,
newSynapseCount = newSynapseCount,
permanenceInc = permanenceInc,
permanenceDec = permanenceDec,
permanenceMax = permanenceMax, # never exceed this value
globalDecay = globalDecay,
activationThreshold = activationThreshold,
doPooling = doPooling,
segUpdateValidDuration = segUpdateValidDuration,
burnIn = burnIn,
collectStats = collectStats,
seed = seed,
verbosity = verbosity,
trivialPredictionMethods = trivialPredictionMethods,
pamLength = pamLength,
maxInfBacktrack = maxInfBacktrack,
maxLrnBacktrack = maxLrnBacktrack,
maxAge = maxAge,
maxSeqLength = maxSeqLength,
maxSegmentsPerCell = maxSegmentsPerCell,
maxSynapsesPerSegment = maxSynapsesPerSegment,
outputType = outputType,
)