Skip to content

Commit

Permalink
update to latest emergent, core
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Oct 19, 2024
1 parent d85d482 commit 930965b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 28 deletions.
21 changes: 10 additions & 11 deletions examples/hip_bench/hip_bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"github.com/emer/emergent/v2/params"
"github.com/emer/emergent/v2/patgen"
"github.com/emer/emergent/v2/relpos"
"github.com/emer/leabra/v2/hip"
"github.com/emer/leabra/v2/leabra"
)

Expand Down Expand Up @@ -560,11 +559,11 @@ func (ss *Sim) ConfigNet(net *leabra.Network) {
net.ConnectLayers(ecout, ecin, onetoone, BackPath)

// EC <-> CA1 encoder pathways
pj := net.ConnectLayersPath(ecin, ca1, pool1to1, leabra.ForwardPath, &hip.EcCa1Path{})
pj := net.ConnectLayersPath(ecin, ca1, pool1to1, leabra.ForwardPath, &leabra.EcCa1Path{})
pj.SetClass("EcCa1Path")
pj = net.ConnectLayersPath(ca1, ecout, pool1to1, leabra.ForwardPath, &hip.EcCa1Path{})
pj = net.ConnectLayersPath(ca1, ecout, pool1to1, leabra.ForwardPath, &leabra.EcCa1Path{})
pj.SetClass("EcCa1Path")
pj = net.ConnectLayersPath(ecout, ca1, pool1to1, BackPath, &hip.EcCa1Path{})
pj = net.ConnectLayersPath(ecout, ca1, pool1to1, BackPath, &leabra.EcCa1Path{})
pj.SetClass("EcCa1Path")

// Perforant pathway
Expand All @@ -573,25 +572,25 @@ func (ss *Sim) ConfigNet(net *leabra.Network) {
ppathCA3 := paths.NewUnifRnd()
ppathCA3.PCon = hp.CA3PCon

pj = net.ConnectLayersPath(ecin, dg, ppathDG, leabra.ForwardPath, &hip.CHLPath{})
pj = net.ConnectLayersPath(ecin, dg, ppathDG, leabra.ForwardPath, &leabra.CHLPath{})
pj.SetClass("HippoCHL")

if true { // key for bcm vs. ppath, zycyc: must use false for orig_param, true for def_param
pj = net.ConnectLayersPath(ecin, ca3, ppathCA3, leabra.ForwardPath, &hip.EcCa1Path{})
pj = net.ConnectLayersPath(ecin, ca3, ppathCA3, leabra.ForwardPath, &leabra.EcCa1Path{})
pj.SetClass("PPath")
pj = net.ConnectLayersPath(ca3, ca3, full, emer.Lateral, &hip.EcCa1Path{})
pj = net.ConnectLayersPath(ca3, ca3, full, emer.Lateral, &leabra.EcCa1Path{})
pj.SetClass("PPath")
} else {
// so far, this is sig worse, even with error-driven MinusQ1 case (which is better than off)
pj = net.ConnectLayersPath(ecin, ca3, ppathCA3, leabra.ForwardPath, &hip.CHLPath{})
pj = net.ConnectLayersPath(ecin, ca3, ppathCA3, leabra.ForwardPath, &leabra.CHLPath{})
pj.SetClass("HippoCHL")
pj = net.ConnectLayersPath(ca3, ca3, full, emer.Lateral, &hip.CHLPath{})
pj = net.ConnectLayersPath(ca3, ca3, full, emer.Lateral, &leabra.CHLPath{})
pj.SetClass("HippoCHL")
}

// always use this for now:
if true {
pj = net.ConnectLayersPath(ca3, ca1, full, leabra.ForwardPath, &hip.CHLPath{})
pj = net.ConnectLayersPath(ca3, ca1, full, leabra.ForwardPath, &leabra.CHLPath{})
pj.SetClass("HippoCHL")
} else {
// note: this requires lrate = 1.0 or maybe 1.2, doesn't work *nearly* as well
Expand All @@ -602,7 +601,7 @@ func (ss *Sim) ConfigNet(net *leabra.Network) {
// Mossy fibers
mossy := paths.NewUnifRnd()
mossy.PCon = hp.MossyPCon
pj = net.ConnectLayersPath(dg, ca3, mossy, leabra.ForwardPath, &hip.CHLPath{}) // no learning
pj = net.ConnectLayersPath(dg, ca3, mossy, leabra.ForwardPath, &leabra.CHLPath{}) // no learning
pj.SetClass("HippoCHL")

// using 4 threads total (rest on 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/hip_bench/testing_effect/def_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build not

package main

import "github.com/emer/emergent/v2/params"
Expand Down
23 changes: 12 additions & 11 deletions examples/hip_bench/testing_effect/hip_bench_te.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build not

// hip_bench runs a hippocampus model for testing parameters and new learning ideas
package main

Expand Down Expand Up @@ -32,7 +34,6 @@ import (
"github.com/emer/emergent/v2/params"
"github.com/emer/emergent/v2/patgen"
"github.com/emer/emergent/v2/relpos"
"github.com/emer/leabra/v2/hip"
"github.com/emer/leabra/v2/leabra"
)

Expand Down Expand Up @@ -578,11 +579,11 @@ func (ss *Sim) ConfigNet(net *leabra.Network) {
net.ConnectLayers(ecout, ecin, onetoone, BackPath)

// EC <-> CA1 encoder pathways
pj := net.ConnectLayersPath(ecin, ca1, pool1to1, leabra.ForwardPath, &hip.EcCa1Path{})
pj := net.ConnectLayersPath(ecin, ca1, pool1to1, leabra.ForwardPath, &leabra.EcCa1Path{})
pj.SetClass("EcCa1Path")
pj = net.ConnectLayersPath(ca1, ecout, pool1to1, leabra.ForwardPath, &hip.EcCa1Path{})
pj = net.ConnectLayersPath(ca1, ecout, pool1to1, leabra.ForwardPath, &leabra.EcCa1Path{})
pj.SetClass("EcCa1Path")
pj = net.ConnectLayersPath(ecout, ca1, pool1to1, BackPath, &hip.EcCa1Path{})
pj = net.ConnectLayersPath(ecout, ca1, pool1to1, BackPath, &leabra.EcCa1Path{})
pj.SetClass("EcCa1Path")

// Perforant pathway
Expand All @@ -591,25 +592,25 @@ func (ss *Sim) ConfigNet(net *leabra.Network) {
ppathCA3 := paths.NewUnifRnd()
ppathCA3.PCon = hp.CA3PCon

pj = net.ConnectLayersPath(ecin, dg, ppathDG, leabra.ForwardPath, &hip.CHLPath{})
pj = net.ConnectLayersPath(ecin, dg, ppathDG, leabra.ForwardPath, &leabra.CHLPath{})
pj.SetClass("HippoCHL")

if true { // toggle for bcm vs. ppath, zycyc: must use false for orig_param, true for def_param
pj = net.ConnectLayersPath(ecin, ca3, ppathCA3, leabra.ForwardPath, &hip.EcCa1Path{})
pj = net.ConnectLayersPath(ecin, ca3, ppathCA3, leabra.ForwardPath, &leabra.EcCa1Path{})
pj.SetClass("PPath")
pj = net.ConnectLayersPath(ca3, ca3, full, emer.Lateral, &hip.EcCa1Path{})
pj = net.ConnectLayersPath(ca3, ca3, full, emer.Lateral, &leabra.EcCa1Path{})
pj.SetClass("PPath")
} else {
// so far, this is sig worse, even with error-driven MinusQ1 case (which is better than off)
pj = net.ConnectLayersPath(ecin, ca3, ppathCA3, leabra.ForwardPath, &hip.CHLPath{})
pj = net.ConnectLayersPath(ecin, ca3, ppathCA3, leabra.ForwardPath, &leabra.CHLPath{})
pj.SetClass("HippoCHL")
pj = net.ConnectLayersPath(ca3, ca3, full, emer.Lateral, &hip.CHLPath{})
pj = net.ConnectLayersPath(ca3, ca3, full, emer.Lateral, &leabra.CHLPath{})
pj.SetClass("HippoCHL")
}

// always use this for now:
if true {
pj = net.ConnectLayersPath(ca3, ca1, full, leabra.ForwardPath, &hip.CHLPath{})
pj = net.ConnectLayersPath(ca3, ca1, full, leabra.ForwardPath, &leabra.CHLPath{})
pj.SetClass("HippoCHL")
} else {
// note: this requires lrate = 1.0 or maybe 1.2, doesn't work *nearly* as well
Expand All @@ -620,7 +621,7 @@ func (ss *Sim) ConfigNet(net *leabra.Network) {
// Mossy fibers
mossy := paths.NewUnifRnd()
mossy.PCon = hp.MossyPCon
pj = net.ConnectLayersPath(dg, ca3, mossy, leabra.ForwardPath, &hip.CHLPath{}) // no learning
pj = net.ConnectLayersPath(dg, ca3, mossy, leabra.ForwardPath, &leabra.CHLPath{}) // no learning
pj.SetClass("HippoCHL")

// using 4 threads total (rest on 0)
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.4
github.com/emer/emergent/v2 v2.0.0-dev0.1.1
cogentcore.org/core v0.3.5
github.com/emer/emergent/v2 v2.0.0-dev0.1.3
)

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.4 h1:cR+tbFHobLYwAdIW7+0WXnnUdinidrnBse6iqnIBuL0=
cogentcore.org/core v0.3.4/go.mod h1:HiWp9KXOQmYNaW5wdGpMBEHQTVprdsfBzVmTJ8OPk1A=
cogentcore.org/core v0.3.5 h1:qTW/+GSUbeYYCSi29zdAQ/fnjWg2/E/aTbAMbfAFGfI=
cogentcore.org/core v0.3.5/go.mod h1:q3OrXihYG2aTE2oG785ad5b6aJ3wzSCXeeD2SSLKWIE=
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.1 h1:k+S0enWe4MxMP4UAdCZuCCZJKtm8N/hX/t4Hun6sp7Y=
github.com/emer/emergent/v2 v2.0.0-dev0.1.1/go.mod h1:2UEqoMXz800iNNATmJLksc55cD7G+8OyDHvj3+qWeDU=
github.com/emer/emergent/v2 v2.0.0-dev0.1.3 h1:3ixqy2VIubETYEj3GMi7JU0RF6K/Cb9TXC8ITq+Udmk=
github.com/emer/emergent/v2 v2.0.0-dev0.1.3/go.mod h1:9QhWnj/IHq/TrVzcXsC96GlC1Gg/pK0pwMI5sZr+/yU=
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 930965b

Please sign in to comment.