Ejemplo n.º 1
0
func PermanenceMapFromBits(bits data.Bitset) (pm *PermanenceMap) {
	pm = NewPermanenceMap(bits.Len())
	bits.Foreach(func(k int) {
		pm.permanence[k] = pm.config.Initial
	})
	if pm.config.Initial > pm.config.Threshold {
		pm.synapses.Or(bits)
	}
	return pm
}
Ejemplo n.º 2
0
func (l *Region) FeedBack(output data.Bitset) *data.Bitset {
	dest := data.NewBitset(l.InputLength)
	output.Foreach(func(cellId int) {
		col := l.columns[cellId/l.Height()]
		cell := cellId % l.Height()
		if !col.Distal(cell).HasActiveSegment(output, l.MinimumInputOverlap) {
			// Not a predicted cell, must be active from fast-forward.
			dest.Or(col.Connected())
		}
	})
	return dest
}