diff --git a/examples/opf/experiments/anomaly/temporal/hotgym/description.py b/examples/opf/experiments/anomaly/temporal/hotgym/description.py index 6fabc08c46..7f56289a29 100644 --- a/examples/opf/experiments/anomaly/temporal/hotgym/description.py +++ b/examples/opf/experiments/anomaly/temporal/hotgym/description.py @@ -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', @@ -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 @@ -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; @@ -275,14 +274,14 @@ # 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', @@ -290,7 +289,7 @@ # 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': { @@ -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. diff --git a/src/nupic/frameworks/opf/common_models/anomaly_params_random_encoder/best_single_metric_anomaly_params.json b/src/nupic/frameworks/opf/common_models/anomaly_params_random_encoder/best_single_metric_anomaly_params.json index e477fca9e0..f17dca210c 100644 --- a/src/nupic/frameworks/opf/common_models/anomaly_params_random_encoder/best_single_metric_anomaly_params.json +++ b/src/nupic/frameworks/opf/common_models/anomaly_params_random_encoder/best_single_metric_anomaly_params.json @@ -57,7 +57,6 @@ "numActiveColumnsPerInhArea": 40, "seed": 1956, "spVerbosity": 0, - "spatialImp": "cpp", "synPermActiveInc": 0.003, "synPermConnected": 0.2, "synPermInactiveDec": 0.0005 diff --git a/src/nupic/research/TP.py b/src/nupic/research/TP.py index 6dc00ea547..441d547354 100644 --- a/src/nupic/research/TP.py +++ b/src/nupic/research/TP.py @@ -62,17 +62,17 @@ 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, @@ -80,13 +80,13 @@ def __init__(self, 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', ): """ diff --git a/src/nupic/research/TP_shim.py b/src/nupic/research/TP_shim.py index d8e9364911..2cf43b896f 100644 --- a/src/nupic/research/TP_shim.py +++ b/src/nupic/research/TP_shim.py @@ -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`. """ diff --git a/src/nupic/research/spatial_pooler.py b/src/nupic/research/spatial_pooler.py index 6de241429b..4775f7d29d 100644 --- a/src/nupic/research/spatial_pooler.py +++ b/src/nupic/research/spatial_pooler.py @@ -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 ): diff --git a/src/nupic/research/temporal_memory.py b/src/nupic/research/temporal_memory.py index e94bf70194..afe4ca8538 100644 --- a/src/nupic/research/temporal_memory.py +++ b/src/nupic/research/temporal_memory.py @@ -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): """