diff --git a/examples/ra25/ra25.go b/examples/ra25/ra25.go index fc38ebb..312a3cc 100644 --- a/examples/ra25/ra25.go +++ b/examples/ra25/ra25.go @@ -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 @@ -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() { diff --git a/go.mod b/go.mod index a4a9c94..1bc4288 100644 --- a/go.mod +++ b/go.mod @@ -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 ( diff --git a/go.sum b/go.sum index 2cb3694..e0ff119 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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=