Skip to content

Commit

Permalink
fix armaze
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Jun 23, 2024
1 parent b73c19e commit 13e73bd
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 18 deletions.
5 changes: 3 additions & 2 deletions examples/choose/armaze/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,14 @@ func (vw *GUI) ConfigWorldGUI(ev *Env) *core.Body {
split := core.NewSplits(b)

svfr := core.NewFrame(split)
svfr.Name = "svfr"
svfr.SetName("svfr")
svfr.Styler(func(s *styles.Style) {
s.Direction = styles.Column
})

vw.StructView = core.NewForm(svfr).SetStruct(vw)
imfr := core.NewFrame(svfr).Styler(func(s *styles.Style) {
imfr := core.NewFrame(svfr)
imfr.Styler(func(s *styles.Style) {
s.Display = styles.Grid
s.Columns = 2
s.Grow.Set(0, 0)
Expand Down
2 changes: 1 addition & 1 deletion examples/deep_fsa/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var ParamSets = netparams.Sets{
"Layer.Inhib.Layer.Gi": "2.2", // 2.2 > others
"Layer.Inhib.Layer.FB": "1",
"Layer.Acts.Dend.SSGi": "0", // 0 > higher -- kills nmda maint!
"Layer.CT.GeGain": "2.0", // 2.0 > 1.5 for sure
"Layer.CT.GeGain": "2.0", // 2.0 > 1.5 for sure (v0.2.1+)
// "Layer.CT.DecayTau": "80", // now auto-set
"Layer.Acts.Decay.Act": "0.0",
"Layer.Acts.Decay.Glong": "0.0",
Expand Down
5 changes: 3 additions & 2 deletions examples/dls/armaze/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,14 @@ func (vw *GUI) ConfigWorldGUI(ev *Env) *core.Body {
split := core.NewSplits(b)

svfr := core.NewFrame(split)
svfr.Name = "svfr"
svfr.SetName("svfr")
svfr.Styler(func(s *styles.Style) {
s.Direction = styles.Column
})

vw.StructView = core.NewForm(svfr).SetStruct(vw)
imfr := core.NewFrame(svfr).Styler(func(s *styles.Style) {
imfr := core.NewFrame(svfr)
imfr.Styler(func(s *styles.Style) {
s.Display = styles.Grid
s.Columns = 2
s.Grow.Set(0, 0)
Expand Down
6 changes: 6 additions & 0 deletions examples/pfcmaint/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ type RunConfig struct {

// total number of trials per epoch. Should be an even multiple of NData.
NTrials int `default:"64"`

// total number of cycles per trial. at least 200
NCycles int `default:"200"`

// total number of plus-phase cycles per trial. for NCycles=300, use 100
NPlusCycles int `default:"50"`
}

// LogConfig has config parameters related to logging data
Expand Down
2 changes: 0 additions & 2 deletions examples/pfcmaint/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ var ParamSets = netparams.Sets{
Params: params.Params{
"Layer.Inhib.Layer.Gi": "0.8", // 0.8 def
"Layer.CT.GeGain": "0.05", // 0.05 def
"Layer.CT.DecayTau": "50", // 50 def
}},
{Sel: ".CTLayer", Desc: "",
Params: params.Params{
"Layer.Inhib.Layer.Gi": "1.4", // 0.8 def
"Layer.CT.GeGain": "2", // 2 def
"Layer.CT.DecayTau": "50", // 50 def
}},
{Sel: ".BGThalLayer", Desc: "",
Params: params.Params{
Expand Down
9 changes: 6 additions & 3 deletions examples/pfcmaint/pfcmaint.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func (ss *Sim) New() {
ss.RandSeeds.Init(100) // max 100 runs
ss.InitRandSeed(0)
ss.Context.Defaults()
ss.Context.ThetaCycles = int32(ss.Config.Run.NCycles)
}

////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -247,22 +248,24 @@ func (ss *Sim) ConfigLoops() {

ev := ss.Envs.ByModeDi(etime.Train, 0).(*PFCMaintEnv)

ncyc := ss.Config.Run.NCycles
nplus := ss.Config.Run.NPlusCycles
trls := int(math32.IntMultipleGE(float32(ss.Config.Run.NTrials), float32(ss.Config.Run.NData)))

man.AddStack(etime.Train).
AddTime(etime.Run, ss.Config.Run.NRuns).
AddTime(etime.Epoch, ss.Config.Run.NEpochs).
AddTimeIncr(etime.Sequence, trls, ss.Config.Run.NData).
AddTime(etime.Trial, ev.NTrials).
AddTime(etime.Cycle, 200)
AddTime(etime.Cycle, ncyc)

man.AddStack(etime.Test).
AddTime(etime.Epoch, 1).
AddTimeIncr(etime.Sequence, trls, ss.Config.Run.NData).
AddTime(etime.Trial, ev.NTrials).
AddTime(etime.Cycle, 200)
AddTime(etime.Cycle, ncyc)

axon.LooperStdPhases(man, &ss.Context, ss.Net, 150, 199) // plus phase timing
axon.LooperStdPhases(man, &ss.Context, ss.Net, ncyc-nplus, ncyc-1)
axon.LooperSimCycleAndLearn(man, ss.Net, &ss.Context, &ss.ViewUpdate) // std algo code

for m, _ := range man.Stacks {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module github.com/emer/axon/v2
go 1.22

require (
cogentcore.org/core v0.2.1-0.20240620060053-eb9e2dcebe90
cogentcore.org/core v0.2.1-0.20240623220339-104a39292a3c
github.com/anthonynsimon/bild v0.13.0
github.com/emer/emergent/v2 v2.0.0-dev0.0.14.0.20240620093715-0871494ed282
github.com/emer/emergent/v2 v2.0.0-dev0.0.14.0.20240623230606-7f11561602aa
github.com/emer/vision/v2 v2.0.0-dev0.0.10.0.20240618090911-239078f1e9a7
github.com/goki/vulkan v1.0.7
github.com/stretchr/testify v1.9.0
Expand Down
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cogentcore.org/core v0.2.1-0.20240620060053-eb9e2dcebe90 h1:lJJjURtrCznzxTThZr8YRKeR+jr1knJvLhsoHPSCySo=
cogentcore.org/core v0.2.1-0.20240620060053-eb9e2dcebe90/go.mod h1:oZ69LVMXeTb6Tq39AphvDlZkkltfuI/kgk9euC5I6z0=
cogentcore.org/core v0.2.1-0.20240623220339-104a39292a3c h1:4jEJRCWx1x746VTL+1YZH61FUDtq618/iinm3dSF2w8=
cogentcore.org/core v0.2.1-0.20240623220339-104a39292a3c/go.mod h1:oZ69LVMXeTb6Tq39AphvDlZkkltfuI/kgk9euC5I6z0=
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,10 +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.0.14.0.20240620090420-00f4ab5ae3d7 h1:mOZLRyVqQ19Wr1uNsMA3kHQmufTCBbnt4nKeFUaiiT4=
github.com/emer/emergent/v2 v2.0.0-dev0.0.14.0.20240620090420-00f4ab5ae3d7/go.mod h1:3PxvXm6gija07kGcBBbrTQvkRK8Yij2cRDKxtge7LNU=
github.com/emer/emergent/v2 v2.0.0-dev0.0.14.0.20240620093715-0871494ed282 h1:DP5lXXBnhgIWafidsY+J9T/dhQDiM5+d6Fl+IPVMwMs=
github.com/emer/emergent/v2 v2.0.0-dev0.0.14.0.20240620093715-0871494ed282/go.mod h1:3PxvXm6gija07kGcBBbrTQvkRK8Yij2cRDKxtge7LNU=
github.com/emer/emergent/v2 v2.0.0-dev0.0.14.0.20240623230606-7f11561602aa h1:r2+pdyZtMaM7vKsY5j9qqxvEtOcBfoX1Fc5QK36/+vY=
github.com/emer/emergent/v2 v2.0.0-dev0.0.14.0.20240623230606-7f11561602aa/go.mod h1:3Gd/q1gDH74VXzZYramdNjIkEg3eW1t7BOrNw28mvS4=
github.com/emer/vision/v2 v2.0.0-dev0.0.10.0.20240618090911-239078f1e9a7 h1:pd45FWGufAHQ3G5CEzWH9qIAiG9MEvleIz8JdI+K78E=
github.com/emer/vision/v2 v2.0.0-dev0.0.10.0.20240618090911-239078f1e9a7/go.mod h1:+PQE+bMfpzyemHq/8brdyEbDq+qDaAeBO0CjWuBX/nU=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
Expand Down

0 comments on commit 13e73bd

Please sign in to comment.