Skip to content

Commit 338f53e

Browse files
committed
found the bug: learn now for SynCa was not the right value.
1 parent f9e4bc7 commit 338f53e

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

axon/learn-path.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

axon/learn-path.goal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ func (pt *PathParams) DWtSynSoftBound(ctx *Context, syni, di uint32, dwt float32
138138
// based on the receiving neuron's [LearnCaP] - [LearnCaD], multiplied by a separate
139139
// synaptic activation credit assignment factor computed from synaptic co-product CaD values.
140140
func (pt *PathParams) DWtSynCortex(ctx *Context, rlay *LayerParams, syni, si, ri, lpi, pi, di uint32) {
141-
learnNow := int32(Neurons[ri, di, LearnNow]) - (ctx.CyclesTotal - ctx.ThetaCycles)
142-
if learnNow < 0 { // not in this time window
141+
learnNow := int32(Neurons[ri, di, LearnNow])
142+
if learnNow - (ctx.CyclesTotal - ctx.ThetaCycles) < 0 { // not in this time window
143143
SynapseTraces[syni, di, DiDWt] = 0.0
144144
return
145145
}
146-
syCa := pt.SynCaTotal(ctx, si, ri, di, int32(learnNow), rlay.Learn.Timing.SynCaCycles)
146+
syCa := pt.SynCaTotal(ctx, si, ri, di, learnNow, rlay.Learn.Timing.SynCaCycles)
147147

148148
// integrate synaptic trace over time: this is actually beneficial in certain cases,
149149
// in addition to the ETraceLearn factor.

axon/shaders/DWtSyn.wgsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,11 +1006,11 @@ fn PathParams_DWtSynSoftBound(pt: PathParams, ctx: Context, syni: u32,di: u32, d
10061006
}
10071007
}
10081008
fn PathParams_DWtSynCortex(pt: PathParams, ctx: Context, rlay: LayerParams, syni: u32,si: u32,ri: u32,lpi: u32,pi: u32,di: u32) {
1009-
var learnNow = i32(Neurons[Index3D(TensorStrides[70], TensorStrides[71], TensorStrides[72], u32(ri), u32(di), u32(LearnNow))]) - (ctx.CyclesTotal - ctx.ThetaCycles);
1010-
if (learnNow < 0) { // not in this time window
1009+
var learnNow = i32(Neurons[Index3D(TensorStrides[70], TensorStrides[71], TensorStrides[72], u32(ri), u32(di), u32(LearnNow))]);
1010+
if (learnNow-(ctx.CyclesTotal-ctx.ThetaCycles) < 0) { // not in this time window
10111011
SynapseTracesSet(0.0, Index3D(TensorStrides[180], TensorStrides[181], TensorStrides[182], u32(syni), u32(di), u32(DiDWt)));return;
10121012
}
1013-
var syCa = PathParams_SynCaTotal(pt, ctx, si, ri, di, i32(learnNow), rlay.Learn.Timing.SynCaCycles);
1013+
var syCa = PathParams_SynCaTotal(pt, ctx, si, ri, di, learnNow, rlay.Learn.Timing.SynCaCycles);
10141014
SynapseTracesSet(syCa, Index3D(TensorStrides[180], TensorStrides[181], TensorStrides[182], u32(syni), u32(di), u32(DTr)));
10151015
var tr = DWtParams_SynTrace(pt.Learn.DWt, SynapseTracesGet(Index3D(TensorStrides[180], TensorStrides[181], TensorStrides[182], u32(syni), u32(di), u32(Tr))), syCa);
10161016
SynapseTracesSet(tr, Index3D(TensorStrides[180], TensorStrides[181], TensorStrides[182], u32(syni), u32(di), u32(Tr)));

sims/objrec/params.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ var LayerParams = axon.LayerSheets{
3333
ly.Learn.CaSpike.Dt.MTau = 5 // 5 > 10 even with more ncycles
3434

3535
ly.Learn.Timing.On.SetBool(false)
36-
ly.Learn.Timing.Refractory.SetBool(true)
37-
ly.Learn.Timing.LearnThr = 0.05
36+
ly.Learn.Timing.Refractory.SetBool(false)
37+
ly.Learn.Timing.LearnThr = 0
3838
ly.Learn.Timing.SynCaCycles = 160
3939
ly.Learn.Timing.MinusThr = 0
4040
ly.Learn.Timing.MinusCycles = 110
@@ -95,7 +95,7 @@ var PathParams = axon.PathSheets{
9595
Set: func(pt *axon.PathParams) {
9696
// pt.Com.MaxDelay = 10 // not much effect
9797
// pt.Com.Delay = 10
98-
pt.Learn.LRate.Base = 0.1 // 0.1 > 0.05
98+
pt.Learn.LRate.Base = 0.2 // 0.1 > 0.05
9999
pt.Learn.DWt.SubMean = 1 // 1 -- faster if 0 until 20 epc -- prevents sig amount of late deterioration
100100
pt.SWts.Adapt.LRate = 0.0001 // 0.005 == .1 == .01
101101
pt.SWts.Adapt.HiMeanDecay = 0 // 0 > 0.0008 (best in lvis)
@@ -105,6 +105,10 @@ var PathParams = axon.PathSheets{
105105
pt.Learn.DWt.LearnThr = 0.1
106106
pt.Learn.DWt.SynCa20.SetBool(false)
107107
}},
108+
{Sel: "#ITToOutput", Doc: "",
109+
Set: func(pt *axon.PathParams) {
110+
pt.Learn.LRate.Base = 0.1 // 0.1 > 0.05
111+
}},
108112
{Sel: ".BackPath", Doc: "top-down back-pathways MUST have lower relative weight scale, otherwise network hallucinates -- smaller as network gets bigger",
109113
Set: func(pt *axon.PathParams) {
110114
pt.PathScale.Rel = 0.2 // .2 >= .3 > .15 > .1 > .05 @176
@@ -115,7 +119,7 @@ var PathParams = axon.PathSheets{
115119
}},
116120
{Sel: ".V1SC", Doc: "v1 shortcut",
117121
Set: func(pt *axon.PathParams) {
118-
pt.Learn.LRate.Base = 0.02 // 0.02 >= 0.01 > 0.001, 0.05
122+
pt.Learn.LRate.Base = 0.04 // 0.02 >= 0.01 > 0.001, 0.05
119123
pt.PathScale.Rel = 0.05 // 0.2 >> 0.3, 0.5 (blows up)
120124
pt.SWts.Adapt.On.SetBool(false) // seems better
121125
}},

0 commit comments

Comments
 (0)