Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Optimal default params #3143

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 10 additions & 11 deletions examples/opf/experiments/anomaly/temporal/hotgym/description.py
Expand Up @@ -127,10 +127,9 @@
# (value generated from DS_ENCODER_SCHEMA)
'encoders': { 'consumption': { 'clipInput': True,
'fieldname': u'consumption',
'n': 100,
'name': u'consumption',
'type': 'AdaptiveScalarEncoder',
'w': 21},
'type': 'RandomDistributedScalarEncoder',
'numBuckets': 130.0},
'timestamp_dayOfWeek': { 'dayOfWeek': (21, 1),
'fieldname': u'timestamp',
'name': u'timestamp_dayOfWeek',
Expand Down Expand Up @@ -185,7 +184,7 @@
# What percent of the columns's receptive field is available
# for potential synapses. At initialization time, we will
# choose potentialPct * (2*potentialRadius+1)^2
'potentialPct': 0.5,
'potentialPct': 0.8,

# The default connected threshold. Any synapse whose
# permanence value is above the connected threshold is
Expand All @@ -196,11 +195,11 @@
# threshold set below this default value.
# (This concept applies to both SP and TP and so 'cells'
# is correct here as opposed to 'columns')
'synPermConnected': 0.1,
'synPermConnected': 0.2,

'synPermActiveInc': 0.1,
'synPermActiveInc': 0.003,

'synPermInactiveDec': 0.01,
'synPermInactiveDec': 0.0005,
},

# Controls whether TP is enabled or disabled;
Expand Down Expand Up @@ -275,22 +274,22 @@
# during search for the best-matching segments.
# None=use default
# Replaces: tpMinThreshold
'minThreshold': 12,
'minThreshold': 10,

# Segment activation threshold.
# A segment is active if it has >= tpSegmentActivationThreshold
# connected synapses that are active due to infActiveState
# None=use default
# Replaces: tpActivationThreshold
'activationThreshold': 12,
'activationThreshold': 13,

'outputType': 'normal',

# "Pay Attention Mode" length. This tells the TP how many new
# elements to append to the end of a learned sequence at a time.
# Smaller values are better for datasets with short sequences,
# higher values are better for datasets with long sequences.
'pamLength': 1,
'pamLength': 3,
},

'clParams': {
Expand All @@ -305,7 +304,7 @@

# This controls how fast the classifier learns/forgets. Higher values
# make it adapt faster and forget older patterns faster.
'alpha': 0.0001,
'alpha': 0.0358,

# This is set after the call to updateConfigFromSubConfig and is
# computed from the aggregationInfo and predictAheadTime.
Expand Down
Expand Up @@ -57,7 +57,6 @@
"numActiveColumnsPerInhArea": 40,
"seed": 1956,
"spVerbosity": 0,
"spatialImp": "cpp",
"synPermActiveInc": 0.003,
"synPermConnected": 0.2,
"synPermInactiveDec": 0.0005
Expand Down
22 changes: 11 additions & 11 deletions src/nupic/research/TP.py
Expand Up @@ -62,31 +62,31 @@ class TP(ConsolePrinterMixin):
"""

def __init__(self,
numberOfCols=500,
cellsPerColumn=10,
initialPerm=0.11,
numberOfCols=2048,
cellsPerColumn=32,
initialPerm=0.21,
connectedPerm=0.50,
minThreshold=8,
newSynapseCount=15,
minThreshold=10,
newSynapseCount=20,
permanenceInc=0.10,
permanenceDec=0.10,
permanenceMax=1.0,
globalDecay=0.10,
activationThreshold=12,
globalDecay=0.0, #disabled
activationThreshold=13,
doPooling=False,
segUpdateValidDuration=5,
burnIn=2,
collectStats=False,
seed=42,
verbosity=VERBOSITY,
checkSynapseConsistency=False, # for cpp only -- ignored
pamLength=1,
pamLength=3,
maxInfBacktrack=10,
maxLrnBacktrack=5,
maxAge=100000,
maxAge=0,
maxSeqLength=32,
maxSegmentsPerCell=-1,
maxSynapsesPerSegment=-1,
maxSegmentsPerCell=128,
maxSynapsesPerSegment=32,
outputType='normal',
):
"""
Expand Down
24 changes: 8 additions & 16 deletions src/nupic/research/TP_shim.py
Expand Up @@ -43,25 +43,17 @@ class TPShimMixin(object):
TP => Temporal Memory shim class.
"""
def __init__(self,
numberOfCols=500,
cellsPerColumn=10,
initialPerm=0.11,
numberOfCols=2048,
cellsPerColumn=32,
initialPerm=0.21,
connectedPerm=0.50,
minThreshold=8,
newSynapseCount=15,
minThreshold=10,
newSynapseCount=20,
permanenceInc=0.10,
permanenceDec=0.10,
permanenceMax=1.0,
activationThreshold=12,
predictedSegmentDecrement=0,
maxSegmentsPerCell=255,
maxSynapsesPerSegment=255,
globalDecay=0.10,
maxAge=100000,
pamLength=1,
verbosity=0,
outputType="normal",
seed=42):
seed=42,
):

"""
Translate parameters and initialize member variables specific to `TP.py`.
"""
Expand Down
18 changes: 9 additions & 9 deletions src/nupic/research/spatial_pooler.py
Expand Up @@ -111,21 +111,21 @@ class SpatialPooler(object):

def __init__(self,
inputDimensions=(32, 32),
columnDimensions=(64, 64),
columnDimensions=(2048,1),
potentialRadius=16,
potentialPct=0.5,
globalInhibition=False,
potentialPct=0.8,
globalInhibition=True,
localAreaDensity=-1.0,
numActiveColumnsPerInhArea=10.0,
numActiveColumnsPerInhArea=40,
stimulusThreshold=0,
synPermInactiveDec=0.008,
synPermActiveInc=0.05,
synPermConnected=0.10,
synPermInactiveDec=0.0005,
synPermActiveInc=0.003,
synPermConnected=0.2,
minPctOverlapDutyCycle=0.001,
minPctActiveDutyCycle=0.001,
dutyCyclePeriod=1000,
maxBoost=10.0,
seed=-1,
maxBoost=1.0, # 1.0=effectively disabled
seed=1956,
spVerbosity=0,
wrapAround=True
):
Expand Down
4 changes: 2 additions & 2 deletions src/nupic/research/temporal_memory.py
Expand Up @@ -51,8 +51,8 @@ def __init__(self,
permanenceIncrement=0.10,
permanenceDecrement=0.10,
predictedSegmentDecrement=0.0,
maxSegmentsPerCell=255,
maxSynapsesPerSegment=255,
maxSegmentsPerCell=128,
maxSynapsesPerSegment=32,
seed=42,
**kwargs):
"""
Expand Down