Skip to content

Commit

Permalink
update to EventByName change
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Aug 28, 2024
1 parent 4ccc111 commit 603fed7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions axon/hip_net.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (net *Network) ConfigLoopsHip(ctx *Context, man *looper.Manager, hip *HipCo
mode := etime.Train
stack := man.Stacks[mode]
cyc, _ := stack.Loops[etime.Cycle]
minusStart, _ := cyc.EventByName("MinusPhase")
minusStart := cyc.EventByName("MinusPhase")
minusStart.OnEvent.Add("HipMinusPhase:Start", func() {
if *pretrain {
dgFromEc2.Params.Learn.Learn = 0
Expand All @@ -235,7 +235,7 @@ func (net *Network) ConfigLoopsHip(ctx *Context, man *looper.Manager, hip *HipCo
net.InitGScale(ctx) // update computed scaling factors
net.GPU.SyncParamsToGPU()
})
beta1, _ := cyc.EventByName("Beta1")
beta1 := cyc.EventByName("Beta1")
beta1.OnEvent.Add("Hip:Beta1", func() {
ca1FromEc3.Params.PathScale.Rel = hip.ThetaLow
ca1FromCa3.Params.PathScale.Rel = hip.ThetaHigh
Expand All @@ -245,7 +245,7 @@ func (net *Network) ConfigLoopsHip(ctx *Context, man *looper.Manager, hip *HipCo
net.InitGScale(ctx) // update computed scaling factors
net.GPU.SyncParamsToGPU()
})
plus, _ := cyc.EventByName("PlusPhase")
plus := cyc.EventByName("PlusPhase")

// note: critical for this to come before std start
plus.OnEvent.InsertBefore("PlusPhase:Start", "HipPlusPhase:Start", func() {
Expand Down
2 changes: 1 addition & 1 deletion examples/choose/choose.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ func (ss *Sim) ConfigLoops() {
}

// note: phase is shared between all stacks!
plusPhase, _ := man.Stacks[etime.Train].Loops[etime.Cycle].EventByName("PlusPhase")
plusPhase := man.Stacks[etime.Train].Loops[etime.Cycle].EventByName("PlusPhase")
plusPhase.OnEvent.InsertBefore("PlusPhase:Start", "TakeAction", func() {
// note: critical to have this happen *after* MinusPhase:End and *before* PlusPhase:Start
// because minus phase end has gated info, and plus phase start applies action input
Expand Down
2 changes: 1 addition & 1 deletion examples/pcore_ds/pcore_ds.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ func (ss *Sim) ConfigLoops() {
})
}
// note: auto applies to all
plusPhase, _ := man.Stacks[etime.Train].Loops[etime.Cycle].EventByName("PlusPhase")
plusPhase := man.Stacks[etime.Train].Loops[etime.Cycle].EventByName("PlusPhase")
plusPhase.OnEvent.InsertBefore("PlusPhase:Start", "TakeAction", func() {
// note: critical to have this happen *after* MinusPhase:End and *before* PlusPhase:Start
// because minus phase end has gated info, and plus phase start applies action input
Expand Down

0 comments on commit 603fed7

Please sign in to comment.