本文整理匯總了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,
)