Documentation
¶
Overview ¶
htm contains ports of Numenta's spatial and temporal poolers as they are currently implemented in the Nupic framework.
Index ¶
- Variables
- type DenseBinaryMatrix
- func (sm *DenseBinaryMatrix) Clear()
- func (sm *DenseBinaryMatrix) Copy() *DenseBinaryMatrix
- func (sm *DenseBinaryMatrix) Entries() []SparseEntry
- func (sm *DenseBinaryMatrix) FillRow(row int, val bool)
- func (sm *DenseBinaryMatrix) Flatten() []bool
- func (sm *DenseBinaryMatrix) Get(row int, col int) bool
- func (sm *DenseBinaryMatrix) GetDenseRow(row int) []bool
- func (sm *DenseBinaryMatrix) GetRowIndices(row int) []int
- func (sm *DenseBinaryMatrix) NonZeroRows() []int
- func (sm *DenseBinaryMatrix) Or(sm2 *DenseBinaryMatrix) *DenseBinaryMatrix
- func (sm *DenseBinaryMatrix) ReplaceRow(row int, values []bool)
- func (sm *DenseBinaryMatrix) ReplaceRowByIndices(row int, indices []int)
- func (sm *DenseBinaryMatrix) RowAndSum(row []bool) []int
- func (sm *DenseBinaryMatrix) Set(row int, col int, value bool)
- func (sm *DenseBinaryMatrix) SetRowFromDense(row int, denseRow []bool)
- func (sm *DenseBinaryMatrix) ToString() string
- func (sm *DenseBinaryMatrix) TotalNonZeroCount() int
- func (sm *DenseBinaryMatrix) TotalTrueRows() int
- type DynamicState
- type PredictorMethod
- type ProcessAction
- type Segment
- type SegmentStats
- type SegmentUpdate
- type SpParams
- type SparseBinaryMatrix
- func (sm *SparseBinaryMatrix) Clear()
- func (sm *SparseBinaryMatrix) Copy() *SparseBinaryMatrix
- func (sm *SparseBinaryMatrix) Entries() []SparseEntry
- func (sm *SparseBinaryMatrix) FillRow(row int, val bool)
- func (sm *SparseBinaryMatrix) Flatten() []bool
- func (sm *SparseBinaryMatrix) Get(row int, col int) bool
- func (sm *SparseBinaryMatrix) GetDenseRow(row int) []bool
- func (sm *SparseBinaryMatrix) GetRowIndices(row int) []int
- func (sm *SparseBinaryMatrix) NonZeroRows() []int
- func (sm *SparseBinaryMatrix) Or(sm2 *SparseBinaryMatrix) *SparseBinaryMatrix
- func (sm *SparseBinaryMatrix) ReplaceRow(row int, values []bool)
- func (sm *SparseBinaryMatrix) ReplaceRowByIndices(row int, indices []int)
- func (sm *SparseBinaryMatrix) RowAndSum(row []bool) []int
- func (sm *SparseBinaryMatrix) Set(row int, col int, value bool)
- func (sm *SparseBinaryMatrix) SetRowFromDense(row int, denseRow []bool)
- func (sm *SparseBinaryMatrix) ToString() string
- func (sm *SparseBinaryMatrix) TotalNonZeroCount() int
- func (sm *SparseBinaryMatrix) TotalTrueCols() int
- func (sm *SparseBinaryMatrix) TotalTrueRows() int
- type SparseEntry
- type SpatialPooler
- type Synapse
- type SynapseUpdateState
- type TemporalMemory
- type TemporalMemoryConnections
- func (tmc *TemporalMemoryConnections) CellForSegment(segment int) int
- func (tmc *TemporalMemoryConnections) CellsForColumn(column int) []int
- func (tmc *TemporalMemoryConnections) ColumnForCell(cell int) int
- func (tmc *TemporalMemoryConnections) CreateSegment(cell int) int
- func (tmc *TemporalMemoryConnections) CreateSynapse(segment int, sourceCell int, permanence float64) *TmSynapse
- func (tmc *TemporalMemoryConnections) DataForSynapse(synapse int) *TmSynapse
- func (tmc *TemporalMemoryConnections) NumberOfColumns() int
- func (tmc *TemporalMemoryConnections) NumberOfcells() int
- func (tmc *TemporalMemoryConnections) SegmentsForCell(cell int) []int
- func (tmc *TemporalMemoryConnections) SynapsesForSegment(segment int) []int
- func (tmc *TemporalMemoryConnections) SynapsesForSourceCell(sourceCell int) []int
- func (tmc *TemporalMemoryConnections) UpdateSynapsePermanence(synapse int, permanence float64)
- type TemporalMemoryParams
- type TemporalPooler
- type TemporalPoolerParams
- type TmSynapse
- type TpOutputType
- type TpStats
- type TrivialPredictor
- type TrivialPredictorState
- type UpdateState
Constants ¶
This section is empty.
Variables ¶
var SegmentDutyCycleAlphas = []float64{0, 0.0032, 0.0010, 0.00032,
0.00010, 0.000032, 0.00001, 0.0000032,
0.0000010}
var SegmentDutyCycleTiers = []int{0, 100, 320, 1000,
3200, 10000, 32000, 100000, 320000}
Functions ¶
This section is empty.
Types ¶
type DenseBinaryMatrix ¶
Sparse binary matrix stores indexes of non-zero entries in matrix to conserve space
func NewDenseBinaryMatrix ¶
func NewDenseBinaryMatrix(height, width int) *DenseBinaryMatrix
Create new sparse binary matrix of specified size
func NewDenseBinaryMatrixFromDense ¶
func NewDenseBinaryMatrixFromDense(values [][]bool) *DenseBinaryMatrix
Create sparse binary matrix from specified dense matrix
func NewDenseBinaryMatrixFromDense1D ¶
func NewDenseBinaryMatrixFromDense1D(values []bool, rows, cols int) *DenseBinaryMatrix
Create sparse binary matrix from specified dense matrix
func NewDenseBinaryMatrixFromInts ¶
func NewDenseBinaryMatrixFromInts(values [][]int) *DenseBinaryMatrix
Creates a sparse binary matrix from specified integer array (any values greater than 0 are true)
func (*DenseBinaryMatrix) Copy ¶
func (sm *DenseBinaryMatrix) Copy() *DenseBinaryMatrix
Copys a matrix
func (*DenseBinaryMatrix) Entries ¶
func (sm *DenseBinaryMatrix) Entries() []SparseEntry
Returns all true/on indices
func (*DenseBinaryMatrix) FillRow ¶
func (sm *DenseBinaryMatrix) FillRow(row int, val bool)
Fills specified row with specified value
func (*DenseBinaryMatrix) Flatten ¶
func (sm *DenseBinaryMatrix) Flatten() []bool
Returns flattend dense represenation
func (*DenseBinaryMatrix) Get ¶
func (sm *DenseBinaryMatrix) Get(row int, col int) bool
Get value at col,row position
func (*DenseBinaryMatrix) GetDenseRow ¶
func (sm *DenseBinaryMatrix) GetDenseRow(row int) []bool
Returns dense row
func (*DenseBinaryMatrix) GetRowIndices ¶
func (sm *DenseBinaryMatrix) GetRowIndices(row int) []int
Returns a rows "on" indices
func (*DenseBinaryMatrix) NonZeroRows ¶
func (sm *DenseBinaryMatrix) NonZeroRows() []int
Returns row indexes with at least 1 true column
func (*DenseBinaryMatrix) Or ¶
func (sm *DenseBinaryMatrix) Or(sm2 *DenseBinaryMatrix) *DenseBinaryMatrix
Ors 2 matrices
func (*DenseBinaryMatrix) ReplaceRow ¶
func (sm *DenseBinaryMatrix) ReplaceRow(row int, values []bool)
Replaces specified row with values, assumes values is ordered correctly
func (*DenseBinaryMatrix) ReplaceRowByIndices ¶
func (sm *DenseBinaryMatrix) ReplaceRowByIndices(row int, indices []int)
Replaces row with true values at specified indices
func (*DenseBinaryMatrix) RowAndSum ¶
func (sm *DenseBinaryMatrix) RowAndSum(row []bool) []int
In a normal matrix this would be multiplication in binary terms we just and then sum the true entries
func (*DenseBinaryMatrix) Set ¶
func (sm *DenseBinaryMatrix) Set(row int, col int, value bool)
Set value at row,col position
func (*DenseBinaryMatrix) SetRowFromDense ¶
func (sm *DenseBinaryMatrix) SetRowFromDense(row int, denseRow []bool)
Sets a sparse row from dense representation
func (*DenseBinaryMatrix) ToString ¶
func (sm *DenseBinaryMatrix) ToString() string
func (*DenseBinaryMatrix) TotalNonZeroCount ¶
func (sm *DenseBinaryMatrix) TotalNonZeroCount() int
Returns total true entries
func (*DenseBinaryMatrix) TotalTrueRows ¶
func (sm *DenseBinaryMatrix) TotalTrueRows() int
Returns # of rows with at least 1 true value
type DynamicState ¶
type DynamicState struct {
//orginally dynamic vars
LrnActiveState *SparseBinaryMatrix // t
LrnActiveStateLast *SparseBinaryMatrix // t-1
LrnPredictedState *SparseBinaryMatrix
LrnPredictedStateLast *SparseBinaryMatrix
InfActiveState *SparseBinaryMatrix
InfActiveStateLast *SparseBinaryMatrix
InfActiveStateBackup *SparseBinaryMatrix
InfActiveStateCandidate *SparseBinaryMatrix
InfPredictedState *SparseBinaryMatrix
InfPredictedStateLast *SparseBinaryMatrix
InfPredictedStateBackup *SparseBinaryMatrix
InfPredictedStateCandidate *SparseBinaryMatrix
CellConfidence *matrix.DenseMatrix
CellConfidenceLast *matrix.DenseMatrix
CellConfidenceCandidate *matrix.DenseMatrix
ColConfidence []float64
ColConfidenceLast []float64
ColConfidenceCandidate []float64
}
func (*DynamicState) Copy ¶
func (ds *DynamicState) Copy() *DynamicState
type PredictorMethod ¶
type PredictorMethod int
const ( Random PredictorMethod = 1 Zeroth PredictorMethod = 2 Last PredictorMethod = 3 All PredictorMethod = 4 Lots PredictorMethod = 5 )
type ProcessAction ¶
type ProcessAction int
const ( Update ProcessAction = 0 Keep ProcessAction = 1 Remove ProcessAction = 2 )
type Segment ¶
type Segment struct {
// contains filtered or unexported fields
}
The Segment struct is a container for all of the segment variables and the synapses it owns.
func NewSegment ¶
func NewSegment(tp *TemporalPooler, isSequenceSeg bool) *Segment
Creates a new segment
func (*Segment) AddSynapse ¶
Adds a new synapse
func (*Segment) ToString ¶
Print segment information for verbose messaging and debugging. This uses the following format:
ID:54413 True 0.64801 (24/36) 101 [9,1]0.75 [10,1]0.75 [11,1]0.75
where: 54413 - is the unique segment id True - is sequence segment 0.64801 - moving average duty cycle (24/36) - (numPositiveActivations / numTotalActivations) 101 - age, number of iterations since last activated [9,1]0.75 - synapse from column 9, cell #1, strength 0.75 [10,1]0.75 - synapse from column 10, cell #1, strength 0.75 [11,1]0.75 - synapse from column 11, cell #1, strength 0.75
type SegmentStats ¶
type SegmentUpdate ¶
type SegmentUpdate struct {
// contains filtered or unexported fields
}
type SpParams ¶
type SpParams struct {
InputDimensions []int
ColumnDimensions []int
PotentialRadius int
PotentialPct float64
GlobalInhibition bool
LocalAreaDensity float64
NumActiveColumnsPerInhArea int
StimulusThreshold int
SynPermInactiveDec float64
SynPermActiveInc float64
SynPermConnected float64
MinPctOverlapDutyCycle float64
MinPctActiveDutyCycle float64
DutyCyclePeriod int
MaxBoost float64
Seed int
SpVerbosity int
}
type SparseBinaryMatrix ¶
Sparse binary matrix stores indexes of non-zero entries in matrix to conserve space
func NewSparseBinaryMatrix ¶
func NewSparseBinaryMatrix(height, width int) *SparseBinaryMatrix
Create new sparse binary matrix of specified size
func NewSparseBinaryMatrixFromDense ¶
func NewSparseBinaryMatrixFromDense(values [][]bool) *SparseBinaryMatrix
Create sparse binary matrix from specified dense matrix
func NewSparseBinaryMatrixFromDense1D ¶
func NewSparseBinaryMatrixFromDense1D(values []bool, rows, cols int) *SparseBinaryMatrix
Create sparse binary matrix from specified dense matrix
func NewSparseBinaryMatrixFromInts ¶
func NewSparseBinaryMatrixFromInts(values [][]int) *SparseBinaryMatrix
Creates a sparse binary matrix from specified integer array (any values greater than 0 are true)
func (*SparseBinaryMatrix) Copy ¶
func (sm *SparseBinaryMatrix) Copy() *SparseBinaryMatrix
Copys a matrix
func (*SparseBinaryMatrix) Entries ¶
func (sm *SparseBinaryMatrix) Entries() []SparseEntry
Returns all true/on indices
func (*SparseBinaryMatrix) FillRow ¶
func (sm *SparseBinaryMatrix) FillRow(row int, val bool)
Fills specified row with specified value
func (*SparseBinaryMatrix) Flatten ¶
func (sm *SparseBinaryMatrix) Flatten() []bool
Returns flattend dense represenation
func (*SparseBinaryMatrix) Get ¶
func (sm *SparseBinaryMatrix) Get(row int, col int) bool
Get value at col,row position
func (*SparseBinaryMatrix) GetDenseRow ¶
func (sm *SparseBinaryMatrix) GetDenseRow(row int) []bool
Returns dense row
func (*SparseBinaryMatrix) GetRowIndices ¶
func (sm *SparseBinaryMatrix) GetRowIndices(row int) []int
Returns a rows "on" indices
func (*SparseBinaryMatrix) NonZeroRows ¶
func (sm *SparseBinaryMatrix) NonZeroRows() []int
Returns row indexes with at least 1 true column
func (*SparseBinaryMatrix) Or ¶
func (sm *SparseBinaryMatrix) Or(sm2 *SparseBinaryMatrix) *SparseBinaryMatrix
Ors 2 matrices
func (*SparseBinaryMatrix) ReplaceRow ¶
func (sm *SparseBinaryMatrix) ReplaceRow(row int, values []bool)
Replaces specified row with values, assumes values is ordered correctly
func (*SparseBinaryMatrix) ReplaceRowByIndices ¶
func (sm *SparseBinaryMatrix) ReplaceRowByIndices(row int, indices []int)
Replaces row with true values at specified indices
func (*SparseBinaryMatrix) RowAndSum ¶
func (sm *SparseBinaryMatrix) RowAndSum(row []bool) []int
In a normal matrix this would be multiplication in binary terms we just and then sum the true entries
func (*SparseBinaryMatrix) Set ¶
func (sm *SparseBinaryMatrix) Set(row int, col int, value bool)
Set value at row,col position
func (*SparseBinaryMatrix) SetRowFromDense ¶
func (sm *SparseBinaryMatrix) SetRowFromDense(row int, denseRow []bool)
Sets a sparse row from dense representation
func (*SparseBinaryMatrix) ToString ¶
func (sm *SparseBinaryMatrix) ToString() string
func (*SparseBinaryMatrix) TotalNonZeroCount ¶
func (sm *SparseBinaryMatrix) TotalNonZeroCount() int
Returns total true entries
func (*SparseBinaryMatrix) TotalTrueCols ¶
func (sm *SparseBinaryMatrix) TotalTrueCols() int
Returns # of cols with at least 1 true value
func (*SparseBinaryMatrix) TotalTrueRows ¶
func (sm *SparseBinaryMatrix) TotalTrueRows() int
Returns # of rows with at least 1 true value
type SparseEntry ¶
entries are positions of non-zero values
type SpatialPooler ¶
type SpatialPooler struct {
ColumnDimensions []int
InputDimensions []int
PotentialRadius int
PotentialPct float64
GlobalInhibition bool
NumActiveColumnsPerInhArea int
LocalAreaDensity float64
StimulusThreshold int
SynPermInactiveDec float64
SynPermActiveInc float64
SynPermBelowStimulusInc float64
SynPermConnected float64
MinPctOverlapDutyCycles float64
MinPctActiveDutyCycles float64
DutyCyclePeriod int
MaxBoost float64
SpVerbosity int
// Extra parameter settings
SynPermMin float64
SynPermMax float64
SynPermTrimThreshold float64
UpdatePeriod int
InitConnectedPct float64
// Internal state
Version float64
IterationNum int
IterationLearnNum int
//random seed
Seed int
// contains filtered or unexported fields
}
func NewSpatialPooler ¶
func NewSpatialPooler(spParams SpParams) *SpatialPooler
Creates a new spatial pooler
func (*SpatialPooler) Compute ¶
func (sp *SpatialPooler) Compute(inputVector []bool, learn bool, activeArray []bool, inhibitColumns inhibitColFunc)
This is the primary public method of the SpatialPooler class. This function takes a input vector and outputs the indices of the active columns. If 'learn' is set to True, this method also updates the permanences of the columns.
Parameters: ---------------------------- inputVector: a numpy array of 0's and 1's thata comprises the input to
the spatial pooler. The array will be treated as a one dimensional array, therefore the dimensions of the array do not have to much the exact dimensions specified in the class constructor. In fact, even a list would suffice. The number of input bits in the vector must, however, match the number of bits specified by the call to the constructor. Therefore there must be a '0' or '1' in the array for every input bit.
learn: a boolean value indicating whether learning should be
performed. Learning entails updating the permanence values of the synapses, and hence modifying the 'state' of the model. Setting learning to 'off' freezes the SP and has many uses. For example, you might want to feed in various inputs and examine the resulting SDR's.
activeArray: an array whose size is equal to the number of columns.
Before the function returns this array will be populated
with 1's at the indices of the active columns, and 0's
everywhere else.
func (*SpatialPooler) InhibitColumns ¶
func (sp *SpatialPooler) InhibitColumns(overlaps []float64, inhibitColumnsGlobal, inhibitColumnsLocal inhibitColumnsFunc) []int
func (*SpatialPooler) NumColumns ¶
func (sp *SpatialPooler) NumColumns() int
Returns number of columns
type SynapseUpdateState ¶
type TemporalMemory ¶
type TemporalMemory struct {
ActiveCells []int
PredictiveCells []int
ActiveSegments []int
ActiveSynapsesForSegment map[int][]int
WinnerCells []int
Connections *TemporalMemoryConnections
// contains filtered or unexported fields
}
Temporal memory
func NewTemporalMemory ¶
func NewTemporalMemory(params *TemporalMemoryParams) *TemporalMemory
Create new temporal memory
func (*TemporalMemory) Compute ¶
func (tm *TemporalMemory) Compute(activeColumns []int, learn bool)
Feeds input record through TM, performing inference and learning. Updates member variables with new state.
func (*TemporalMemory) Reset ¶
func (tm *TemporalMemory) Reset()
Indicates the start of a new sequence. Resets sequence state of the TM.
type TemporalMemoryConnections ¶
type TemporalMemoryConnections struct {
ColumnDimensions []int
CellsPerColumn int
// contains filtered or unexported fields
}
Structure holds data representing the connectivity of a layer of cells,
that the TM operates on.
func NewTemporalMemoryConnections ¶
func NewTemporalMemoryConnections(maxSynCount int, cellsPerColumn int, colDimensions []int) *TemporalMemoryConnections
Create a new temporal memory
func (*TemporalMemoryConnections) CellForSegment ¶
func (tmc *TemporalMemoryConnections) CellForSegment(segment int) int
Returns the cell that a segment belongs to.
func (*TemporalMemoryConnections) CellsForColumn ¶
func (tmc *TemporalMemoryConnections) CellsForColumn(column int) []int
Returns the indices of cells that belong to a column.
func (*TemporalMemoryConnections) ColumnForCell ¶
func (tmc *TemporalMemoryConnections) ColumnForCell(cell int) int
Returns the index of the column that a cell belongs to.
func (*TemporalMemoryConnections) CreateSegment ¶
func (tmc *TemporalMemoryConnections) CreateSegment(cell int) int
Creates a new segment on specified cell, returns segment index
func (*TemporalMemoryConnections) CreateSynapse ¶
func (tmc *TemporalMemoryConnections) CreateSynapse(segment int, sourceCell int, permanence float64) *TmSynapse
func (*TemporalMemoryConnections) DataForSynapse ¶
func (tmc *TemporalMemoryConnections) DataForSynapse(synapse int) *TmSynapse
Returns synapse data for specified index
func (*TemporalMemoryConnections) NumberOfColumns ¶
func (tmc *TemporalMemoryConnections) NumberOfColumns() int
Returns the number of columns in this layer.
func (*TemporalMemoryConnections) NumberOfcells ¶
func (tmc *TemporalMemoryConnections) NumberOfcells() int
Returns the number of cells in this layer.
func (*TemporalMemoryConnections) SegmentsForCell ¶
func (tmc *TemporalMemoryConnections) SegmentsForCell(cell int) []int
Returns the segments that belong to a cell.
func (*TemporalMemoryConnections) SynapsesForSegment ¶
func (tmc *TemporalMemoryConnections) SynapsesForSegment(segment int) []int
Returns the synapses on a segment.
func (*TemporalMemoryConnections) SynapsesForSourceCell ¶
func (tmc *TemporalMemoryConnections) SynapsesForSourceCell(sourceCell int) []int
Returns the synapses for the source cell that they synapse on.
func (*TemporalMemoryConnections) UpdateSynapsePermanence ¶
func (tmc *TemporalMemoryConnections) UpdateSynapsePermanence(synapse int, permanence float64)
Updates the permanence for a synapse.
type TemporalMemoryParams ¶
type TemporalMemoryParams struct {
//Column dimensions
ColumnDimensions []int
CellsPerColumn int
//If the number of active connected synapses on a segment is at least
//this threshold, the segment is said to be active.
ActivationThreshold int
//Radius around cell from which it can sample to form distal dendrite
//connections.
LearningRadius int
InitialPermanence float64
//If the permanence value for a synapse is greater than this value, it is said
//to be connected.
ConnectedPermanence float64
//If the number of synapses active on a segment is at least this threshold,
//it is selected as the best matching cell in a bursing column.
MinThreshold int
//The maximum number of synapses added to a segment during learning.
MaxNewSynapseCount int
PermanenceIncrement float64
PermanenceDecrement float64
//rand seed
Seed int
}
Params for intializing temporal memory
func NewTemporalMemoryParams ¶
func NewTemporalMemoryParams() *TemporalMemoryParams
Create default temporal memory params
type TemporalPooler ¶
type TemporalPooler struct {
CurrentOutput *SparseBinaryMatrix
DynamicState *DynamicState
// contains filtered or unexported fields
}
func NewTemporalPooler ¶
func NewTemporalPooler(tParams TemporalPoolerParams) *TemporalPooler
Initializes a new temporal pooler
func (*TemporalPooler) Compute ¶
func (tp *TemporalPooler) Compute(bottomUpInput []bool, enableLearn bool, computeInfOutput bool) []bool
Handle one compute, possibly learning.
param bottomUpInput The bottom-up input, typically from a spatial pooler param enableLearn If true, perform learning param computeInfOutput If None, default behavior is to disable the inference output when enableLearn is on. If true, compute the inference output If false, do not compute the inference output
It is an error to have both enableLearn and computeInfOutput set to False ¶
By default, we don't compute the inference output when learning because it slows things down, but you can override this by passing in True for computeInfOutput
func (*TemporalPooler) GetSegId ¶
func (tp *TemporalPooler) GetSegId() int
Returns new unique segment id
func (*TemporalPooler) Predict ¶
func (tp *TemporalPooler) Predict(nSteps int) *matrix.DenseMatrix
This function gives the future predictions for <nSteps> timesteps starting
from the current TP state. The TP is returned to its original state at the end before returning.
- We save the TP state. - Loop for nSteps - Turn-on with lateral support from the current active cells - Set the predicted cells as the next step's active cells. This step in learn and infer methods use input here to correct the predictions. We don't use any input here. - Revert back the TP state to the time before prediction
param nSteps The number of future time steps to be predicted returns all the future predictions - floating point matrix and shape (nSteps, numberOfCols). The ith row gives the tp prediction for each column at a future timestep (t+i+1).
func (*TemporalPooler) Reset ¶
func (tp *TemporalPooler) Reset()
Reset the state of all cells.
This is normally used between sequences while training. All internal states are reset to 0.
type TemporalPoolerParams ¶
type TemporalPoolerParams struct {
NumberOfCols int
CellsPerColumn int
InitialPerm float64
ConnectedPerm float64
MinThreshold int
NewSynapseCount int
PermanenceInc float64
PermanenceDec float64
PermanenceMax float64
GlobalDecay float64
ActivationThreshold int
DoPooling bool
SegUpdateValidDuration int
BurnIn int
CollectStats bool
//Seed int
Verbosity int
//checkSynapseConsistency=False, # for cpp only -- ignored
TrivialPredictionMethods []PredictorMethod
PamLength int
MaxInfBacktrack int
MaxLrnBacktrack int
MaxAge int
MaxSeqLength int
MaxSegmentsPerCell int
MaxSynapsesPerSegment int
// contains filtered or unexported fields
}
func NewTemporalPoolerParams ¶
func NewTemporalPoolerParams() *TemporalPoolerParams
Initializes tp params with default values
type TpOutputType ¶
type TpOutputType int
const ( Normal TpOutputType = 0 ActiveState TpOutputType = 1 ActiveState1CellPerCol TpOutputType = 2 )
type TpStats ¶
type TpStats struct {
NInfersSinceReset int
NPredictions int
PredictionScoreTotal float64
PredictionScoreTotal2 float64
FalseNegativeScoreTotal float64
FalsePositiveScoreTotal float64
PctExtraTotal float64
PctMissingTotal float64
TotalMissing float64
TotalExtra float64
CurPredictionScore float64
CurPredictionScore2 float64
CurFalseNegativeScore float64
CurFalsePositiveScore float64
CurMissing float64
CurExtra float64
ConfHistogram matrix.DenseMatrix
}
type TrivialPredictor ¶
type TrivialPredictor struct {
NumOfCols int
Methods []PredictorMethod
Verbosity int
InternalStats map[PredictorMethod]*TpStats
State map[PredictorMethod]TrivialPredictorState
ColumnCount []int
AverageDensity float64
}
func MakeTrivialPredictor ¶
func MakeTrivialPredictor(numberOfCols int, methods []PredictorMethod) *TrivialPredictor
type TrivialPredictorState ¶
type UpdateState ¶
type UpdateState struct {
//creationdate refers to iteration idx
CreationDate int
Update *SegmentUpdate
}
