Skip to content

Commit

Permalink
inhib done
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Dec 17, 2024
1 parent a95c25d commit 5417e46
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions examples/inhib/inhib.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,11 @@ func (ss *Sim) ConfigStats() {
ss.AddStat(func(mode Modes, level Levels, phase StatsPhase) {
trialNameFunc(mode, level, phase == Start)
})
lays := net.LayersByType(axon.InputLayer, axon.SuperLayer)
actGeFunc := axon.StatLayerActGe(ss.Stats, net, Test, Cycle, lays...)
ss.AddStat(func(mode Modes, level Levels, phase StatsPhase) {
actGeFunc(mode, level, phase == Start)
})

// up to a point, it is good to use loops over stats in one function,
// to reduce repetition of boilerplate.
layers := ss.Net.LayersByType(axon.SuperLayer) // axon.InputLayer,
statNames := []string{"Spikes", "Gi", "TotalGi", "FFs", "FBs", "FSi", "SSi", "SSf", "FSGi", "SSGi"}
statNames := []string{"Spikes", "Ge", "Act", "Gi", "TotalGi", "FFs", "FBs", "FSi", "SSi", "SSf", "FSGi", "SSGi"}
ss.AddStat(func(mode Modes, level Levels, phase StatsPhase) {
for _, lnm := range layers {
ly := ss.Net.LayerByName(lnm)
Expand Down Expand Up @@ -490,6 +485,10 @@ func (ss *Sim) ConfigStats() {
switch stnm {
case "Spikes":
stat = ly.AvgMaxVarByPool("Spike", 0, di).Avg
case "Ge":
stat = axon.PoolAvgMax(axon.AMGeInt, axon.AMCycle, axon.Avg, uint32(pi), uint32(di))
case "Act":
stat = axon.PoolAvgMax(axon.AMAct, axon.AMCycle, axon.Avg, uint32(pi), uint32(di))
case "Gi":
stat = axon.Neurons.Value(int(ly.NeurStIndex), di, int(axon.Gi))
default:
Expand Down

0 comments on commit 5417e46

Please sign in to comment.