Skip to content

Commit

Permalink
update to latest cogent and emer
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Sep 2, 2024
1 parent 4590509 commit 3f76fca
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 48 deletions.
85 changes: 43 additions & 42 deletions examples/ra25/ra25.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ func (ss *Sim) Init() {
ss.GUI.StopNow = false
ss.ApplyParams()
ss.NewRun()
ss.ViewUpdate.Update()
ss.ViewUpdate.RecordSyns()
ss.ViewUpdate.Update()
}

// InitRandSeed initializes the random seed based on current training run number
Expand Down Expand Up @@ -708,49 +708,50 @@ func (ss *Sim) ConfigGUI() {

ss.GUI.AddPlots(title, &ss.Logs)

ss.GUI.Body.AddAppBar(func(p *tree.Plan) {
ss.GUI.AddToolbarItem(p, egui.ToolbarItem{Label: "Init", Icon: icons.Update,
Tooltip: "Initialize everything including network weights, and start over. Also applies current params.",
Active: egui.ActiveStopped,
Func: func() {
ss.Init()
ss.GUI.UpdateWindow()
},
})
ss.GUI.FinalizeGUI(false)
}

ss.GUI.AddLooperCtrl(p, ss.Loops, []etime.Modes{etime.Train, etime.Test})

////////////////////////////////////////////////
tree.Add(p, func(w *core.Separator) {})
ss.GUI.AddToolbarItem(p, egui.ToolbarItem{Label: "Reset RunLog",
Icon: icons.Reset,
Tooltip: "Reset the accumulated log of all Runs, which are tagged with the ParamSet used",
Active: egui.ActiveAlways,
Func: func() {
ss.Logs.ResetLog(etime.Train, etime.Run)
ss.GUI.UpdatePlot(etime.Train, etime.Run)
},
})
////////////////////////////////////////////////
tree.Add(p, func(w *core.Separator) {})
ss.GUI.AddToolbarItem(p, egui.ToolbarItem{Label: "New Seed",
Icon: icons.Add,
Tooltip: "Generate a new initial random seed to get different results. By default, Init re-establishes the same initial seed every time.",
Active: egui.ActiveAlways,
Func: func() {
ss.RandSeeds.NewSeeds()
},
})
ss.GUI.AddToolbarItem(p, egui.ToolbarItem{Label: "README",
Icon: icons.FileMarkdown,
Tooltip: "Opens your browser on the README file that contains instructions for how to run this model.",
Active: egui.ActiveAlways,
Func: func() {
core.TheApp.OpenURL("https://github.com/emer/leabra/blob/main/examples/ra25/README.md")
},
})
func (ss *Sim) MakeToolbar(p *tree.Plan) {
ss.GUI.AddToolbarItem(p, egui.ToolbarItem{Label: "Init", Icon: icons.Update,
Tooltip: "Initialize everything including network weights, and start over. Also applies current params.",
Active: egui.ActiveStopped,
Func: func() {
ss.Init()
ss.GUI.UpdateWindow()
},
})

ss.GUI.AddLooperCtrl(p, ss.Loops, []etime.Modes{etime.Train, etime.Test})

////////////////////////////////////////////////
tree.Add(p, func(w *core.Separator) {})
ss.GUI.AddToolbarItem(p, egui.ToolbarItem{Label: "Reset RunLog",
Icon: icons.Reset,
Tooltip: "Reset the accumulated log of all Runs, which are tagged with the ParamSet used",
Active: egui.ActiveAlways,
Func: func() {
ss.Logs.ResetLog(etime.Train, etime.Run)
ss.GUI.UpdatePlot(etime.Train, etime.Run)
},
})
////////////////////////////////////////////////
tree.Add(p, func(w *core.Separator) {})
ss.GUI.AddToolbarItem(p, egui.ToolbarItem{Label: "New Seed",
Icon: icons.Add,
Tooltip: "Generate a new initial random seed to get different results. By default, Init re-establishes the same initial seed every time.",
Active: egui.ActiveAlways,
Func: func() {
ss.RandSeeds.NewSeeds()
},
})
ss.GUI.AddToolbarItem(p, egui.ToolbarItem{Label: "README",
Icon: icons.FileMarkdown,
Tooltip: "Opens your browser on the README file that contains instructions for how to run this model.",
Active: egui.ActiveAlways,
Func: func() {
core.TheApp.OpenURL("https://github.com/emer/leabra/blob/main/examples/ra25/README.md")
},
})
ss.GUI.FinalizeGUI(false)
}

func (ss *Sim) RunGUI() {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/emer/leabra/v2
go 1.22

require (
cogentcore.org/core v0.3.3-0.20240830144154-45639bc9cb04
github.com/emer/emergent/v2 v2.0.0-dev0.1.0.0.20240830215230-288c7a6e7665
cogentcore.org/core v0.3.3-0.20240902213628-48df10901467
github.com/emer/emergent/v2 v2.0.0-dev0.1.0.0.20240902221812-7068c809e099
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cogentcore.org/core v0.3.3-0.20240830144154-45639bc9cb04 h1:V/Uufu2XjYF4LptkpExAtbecycZcBxnY4U7iLbX4T+w=
cogentcore.org/core v0.3.3-0.20240830144154-45639bc9cb04/go.mod h1:dg3uRsPcd8S1ZYvRD2TztCtjopRkrB5V/lbl54xsQd4=
cogentcore.org/core v0.3.3-0.20240902213628-48df10901467 h1:AL9pi5H1ttL76EpnqBCCaflNnfwRxuezZOApoSOL564=
cogentcore.org/core v0.3.3-0.20240902213628-48df10901467/go.mod h1:dg3uRsPcd8S1ZYvRD2TztCtjopRkrB5V/lbl54xsQd4=
github.com/Bios-Marcel/wastebasket v0.0.4-0.20240213135800-f26f1ae0a7c4 h1:6lx9xzJAhdjq0LvVfbITeC3IH9Fzvo1aBahyPu2FuG8=
github.com/Bios-Marcel/wastebasket v0.0.4-0.20240213135800-f26f1ae0a7c4/go.mod h1:FChzXi1izqzdPb6BiNZmcZLGyTYiT61iGx9Rxx9GNeI=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
Expand Down Expand Up @@ -32,8 +32,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/emer/emergent/v2 v2.0.0-dev0.1.0.0.20240830215230-288c7a6e7665 h1:WIySJ4Dm/m6XjuwsFhKaW6AQJaHwKAKygsGWOWdQt1c=
github.com/emer/emergent/v2 v2.0.0-dev0.1.0.0.20240830215230-288c7a6e7665/go.mod h1:G+DrEOvUaqvE/DioBuMLfUz16TAHuVgZ45gI83Zc29E=
github.com/emer/emergent/v2 v2.0.0-dev0.1.0.0.20240902221812-7068c809e099 h1:HuAKSSaV5io1i+zgkm5HC/qRdMk78kyz286Fph7Eob0=
github.com/emer/emergent/v2 v2.0.0-dev0.1.0.0.20240902221812-7068c809e099/go.mod h1:gWVk1t12rrI7BlNL8sc/FXgeg61dOsSquN19GeI7Uzc=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
Expand Down

0 comments on commit 3f76fca

Please sign in to comment.