-
Notifications
You must be signed in to change notification settings - Fork 0
Models
Models are used by the Online Prediction Framework (OPF). However, "The OPF does not create models. It is up to the client code to figure out how many models to run, and to instantiate the correct types of models"
nupic.frameworks.opf.modelfactory
nupic.frameworks.opf.clamodel.CLAModel
Standard model to apply the CLA to the OPF.
nupic.frameworks.opf.two_gram_model.TwoGramModel
...
nupic.frameworks.opf.previousvaluemodel.PreviousValueModel
Takes the current sensor input and predicts that the next input will be that value, with the probability of 1.
...
You can subclass nupic.frameworks.opf.model.Model to create your own OPF model.
The OPF provides a ModelFactory class that can simplify the process of creating new models.
nupic.frameworks.opf.modelfactory.ModelFactory takes a configuration, modelParams, which is a declaration of parameters as a nested dict.
If you create your own Model subclass, you will need to create this yourself as ModelFactory will not know what to do here.
For demonstrated usage, see the hotgym and cpu examples.
- model
- String field. Controls the type of model which will be created by ModelFactory. Values are case sensitive.
Legal values include:- "CLA" =>
nupic.frameworks.opf.clamodel.CLAModel - "TwoGram" =>
nupic.frameworks.opf.two_gram_model.TwoGramModel - "PreviousValue" =>
nupic.frameworks.opf.previousvaluemodel.PreviousValueModel
- "CLA" =>
- version
- Integer field. Describes the format of the modelParams dict.
- predictAheadTime
- ...
- modelParams
-
dictfield. Defines the parameters for the model.- anomalyParams
-
- anomalyCacheRecords
- ... can be None
- autoDetectThreshold
- ... can be None
- autoDetectWaitRecords
- ... can be None
- inferenceType
- String field. The type of inference that this model will perform.
Legal values include- TemporalAnomaly
- TemporalNextStep
- TemporalMultiStep
- sensorParams
-
dictfield.- verbosity
- Integer field. Sensor diagnostic output verbosity control. When greater than 0, the sensor region prints out on screen what it's sensing at each step.
- aggregationInfo
-
dictfield. Controls which field in the modelInput are aggregated and by how much.
This example will tells the model to aggregate the consumption and sum fields into hour bins.{ 'days': 0, 'fields': [('consumption', 'sum')], 'hours': 1, 'microseconds': 0, 'milliseconds': 0, 'minutes': 0, 'months': 0, 'seconds': 0, 'weeks': 0, 'years': 0 }
<dt>encoders</dt><dd><code>dict</code> field.</dd> </dl> - sensorAutoReset
-
dictfield that acceptsNone. Controls the period for automatically-generated resets from aRecordSensor. Legal values include:-
None=> disable automatically-generated resets. (They are also disabled if all of the specified values evaluate to 0). -
dict(kwargs)wherekwargsis combination of the following:days,hours,minutes,seconds,milliseconds,microseconds, andweeks, e.g. `dict(days=1,hours=12)`
-
- spEnable
- Boolean field. Controls whether spatial pooling (SP) is enabled.
- spParams
-
- spVerbosity
- Integer field. Controls the verbosity of the spatial pooling. Legal values are 0-6.
- globalInhibition
- Integer field.
- columnCount
- Integer field. Controls the number of cell columns in the cortical region. Should be the same number as the temporal pooling.
- inputWidth
- Integer field.
- maxBoost
- Float field.
- numActivePerInhArea
- Integer field. Controls the maximum number of active colums in the spatial pooling region's output. When there are more columns than the maximum, weaker columns are suppressed.
- seed
- Integer field.
- coincInputPoolPct
- Float field. Controls what percent of columns' receptive fields are available for potential synapses. At initialization time, we will choose
coincInputPoolPct * (2*coincInputRadius+1)^2 - synPermConnected
- Float field. Controls the default threshold of when synapses are deemed to be connected. Any synapse whose permanence value is above the connected threshold is a "connected synapse", meaning it can contribute to the cell's firing. Typical value is 0.10. Cells whose activity level before inhibition falls below
minDutyCycleBeforeInhwill have their own internalsynPermConnectedCellthreshold set below this default value. - synPermActiveInc
- Float field.
- synPermInactiveDec
- Float field.
- tpEnable
- Whether temporal pooling (TP) is enabled. Legal values include
TrueandFalse. TP is necessary for making temporal predictions, such as predicting subsequent inputs. Without TP, the model is only capable of reconstructing missing sensor inputs (via spatial pooling). - tpParams
-
- verbosity
- Integer field. Controls the output of the temporal pooling. Legal values are 0-6/
- columnCount
- Integer field. Controls the number of cell columns in the cortical region. Should be the same number as spatial pooling.
- cellsPerCount
- Integer field. Controls the number of cells, i.e. states, that are allocated per column.
- inputWidth
- Integer field.
- seed
- Integer field.
- temporalImp
- String field. Selects which implementation of Temporal Pooling to use. Legal values include cpp.
- newSynapseCount
- Integer field that accepts
None. Controls the count of new synapse formation. When set toNone, use the value ofspNumActivePerInhArea. - maxSynapsesPerSegment
- Integer field. Controls the maximum number of synapses per segment. > 0 for fixed-size CLA. -1 for non-fixed-size CLA.
- maxSegmentsPerCell
- Integer field. Controls the maximum number of segments per cell. > 0 for fixed-size CLA. -1 for non-fixed-size CLA.
- initialPerm
- Float field.
- permanenceInc
- Float field.
- permanenceDec
- Float field that accepts
None. Controls the permanence decrement. If set toNone, defaults to the value oftpPermanenceInc. - globalDecay
- Float field.
- maxAge
- Integer field.
- minThreshold
- Integer field that accepts
None. Controls the minimum number of active synapses for a segment to be considered during search for the best-matching segments. IfNoneis given, then use the default value. - activationThreshold
- Integer field that accepts
None. Controls the segment activation threshold. A segment is active if it has <=tpSegmentActivationThresholdconnected synapses that are active due toinfActiveState. IfNoneis given, then use the default value. - outputType
- String field. Legal values include "normal".
- pamLenth
- Integer field. "Pay Attention Mode" length. This tells the Temporal Pooler 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.
- clParams
-
- regionName
- ...
- clVerbosity
- Integer field. Controls the classifier diagnostic output verbosity. Legal values are the integers 0-6 inclusive.
- alpha
- Float field. Controls how fast the classifier learns and forgets. Higher values make it adapt faster, meaning it forgets older patterns more quickly.
- steps
- Integer field. This is set after the call to
updateConfigFromSubConfigand is computed from theaggregationInfoandpredictAheadTime.
- trainSPNetOnlyIfRequested
- ...
-Maintained by the NuPIC Community.