Skip to content

Commit

Permalink
init weights was not initializing SynapseTraces variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Dec 18, 2024
1 parent d57dbd2 commit 7472087
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
9 changes: 9 additions & 0 deletions axon/init-path.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions axon/init-path.goal
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ func (pt *Path) InitWeightsSyn(ctx *Context, syni uint32, rnd randx.Rand, mean,
pt.Params.SWts.InitWeightsSyn(ctx, syni, rnd, mean, spct)
}

// InitWeightsSynTrace initializes SynapseTraces values
// for an individual synapse.
func (pt *Path) InitWeightsSynTrace(ctx *Context, syni, di uint32) {
pt.Params.SWts.InitWeightsSynTrace(ctx, syni, di)
}

// InitWeights initializes weight values according to SWt params,
// enforcing current constraints.
func (pt *Path) InitWeights(ctx *Context, nt *Network) {
Expand All @@ -130,6 +136,9 @@ func (pt *Path) InitWeights(ctx *Context, nt *Network) {
for _, syi := range syIndexes {
syni := pt.SynStIndex + syi
pt.InitWeightsSyn(ctx, syni, &nt.Rand, smn, spct)
for di := uint32(0); di < ctx.NData; di++ {
pt.InitWeightsSynTrace(ctx, syni, di)
}
}
}
if pt.Params.SWts.Adapt.On.IsTrue() && !rlay.Params.IsTarget() {
Expand Down
8 changes: 8 additions & 0 deletions axon/learn.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions axon/learn.goal
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,14 @@ func (sp *SWtParams) InitWeightsSyn(ctx *Context, syni uint32, rnd randx.Rand, m
Synapses[syni, DSWt] = 0
}

// InitWeightsSynTrace initializes SynapseTrace values
// for an individual synapse.
func (sp *SWtParams) InitWeightsSynTrace(ctx *Context, syni, di uint32) {
SynapseTraces[syni, di, Tr] = 0
SynapseTraces[syni, di, DTr] = 0
SynapseTraces[syni, di, DiDWt] = 0
}

//gosl:start

// LRateParams manages learning rate parameters
Expand Down
2 changes: 2 additions & 0 deletions axon/typegen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7472087

Please sign in to comment.