예제 #1
0
func TestLearn64PatternA_5(t *testing.T) {
	if testing.Short() {
		t.SkipNow()
	}
	rand.Seed(1979)
	ds := segment.NewDendriteSegment(64)
	ds.Reset(1, 3, 5, 8, 13, 21)
	patternA := data.NewBitset(64)
	patternA.Set(2, 4, 22, 24, 42, 44, 62)
	TryToLearn(t, 80, ds, 5, *patternA)
	t.Log(ds)
}
예제 #2
0
func TestLearn64PatternAB_5(t *testing.T) {
	if testing.Short() {
		t.SkipNow()
	}
	rand.Seed(1979)
	ds := segment.NewDendriteSegment(64)
	ds.Reset(1, 3, 5, 8, 13, 21)
	patternA := data.NewBitset(64)
	patternA.Set(2, 4, 22, 24, 42, 44, 62)
	patternB := data.NewBitset(64)
	patternB.Set(22, 23, 24, 25, 26)
	TryToLearn(t, 90, ds, 5, *patternA, *patternB)
	t.Log(ds.Connected())
}
예제 #3
0
파일: column.go 프로젝트: postfix/htm-1
func NewColumn(inputSize, height int) *Column {
	result := &Column{
		active:         data.NewBitset(height),
		predictive:     data.NewBitset(height),
		proximal:       segment.NewDendriteSegment(inputSize),
		learning:       -1,
		learningTarget: 0,
		distal:         make([]*segment.DistalSegmentGroup, height),
	}
	for i := 0; i < height; i++ {
		result.distal[i] = segment.NewDistalSegmentGroup()
	}
	return result
}