Skip to content

Commit

Permalink
major update to all enums and type info using gti; plots updated; pyt…
Browse files Browse the repository at this point in the history
…hon moved to emerpy
  • Loading branch information
rcoreilly committed Dec 15, 2023
1 parent c153e5a commit 283d532
Show file tree
Hide file tree
Showing 101 changed files with 5,721 additions and 4,037 deletions.
75 changes: 75 additions & 0 deletions .goki/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Name = "axon"
Desc = ""
Version = "v2.0.0-dev0.0.1"
Type = "Library"

[Build]
Package = "."
Output = ""
ID = "com.org.todo.axon"
Debug = false
Rebuild = false
Install = false
PrintOnly = false
Print = false
Trimpath = false
Work = false
IOSVersion = "13.0"
AndroidMinSDK = 23
AndroidTargetSDK = 29

[Web]
Port = "8080"
RandomVersion = false
Gzip = false
BackgroundColor = "#2d2c2c"
ThemeColor = "#2d2c2c"
LoadingLabel = ""
Lang = "en"
Title = ""
Description = ""
Author = ""
Image = ""
AutoUpdateInterval = "10s"
WasmContentLengthHeader = ""
ServiceWorkerTemplate = ""

[Setup]
[Setup.Platform]
OS = ""
Arch = ""

[Log]
Target = "android"
Keep = false
All = "F"

[Release]
VersionFile = "axon/version.go"
Package = "axon"

[Generate]
Dir = "."
Output = "gokigen.go"
[Generate.Enumgen]
Dir = "."
Output = "enumgen.go"
Transform = ""
TrimPrefix = ""
AddPrefix = ""
LineComment = true
AcceptLower = true
Text = true
JSON = false
YAML = false
SQL = false
GQL = false
[Generate.Gtigen]
Dir = "."
Output = "gtigen.go"
AddTypes = false
AddMethods = false
AddFuncs = false
Instance = false
TypeVar = false
Setters = false
2 changes: 1 addition & 1 deletion axon/act.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package axon
import (
"github.com/emer/axon/chans"
"github.com/emer/emergent/v2/erand"
"github.com/goki/gosl/slbool"
"goki.dev/etable/v2/minmax"
"goki.dev/gosl/v2/slbool"
"goki.dev/mat32/v2"
)

Expand Down
21 changes: 5 additions & 16 deletions axon/act_prjn.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,15 @@ import (
"log"

"github.com/emer/emergent/v2/erand"
"github.com/goki/gosl/slbool"
"github.com/goki/ki/ints"
"github.com/goki/ki/kit"
"goki.dev/gosl/v2/slbool"
"goki.dev/mat32/v2"
)

//go:generate stringer -type=PrjnGTypes

var KiT_PrjnGTypes = kit.Enums.AddEnum(PrjnGTypesN, kit.NotBitFlag, nil)

func (ev PrjnGTypes) MarshalJSON() ([]byte, error) { return kit.EnumMarshalJSON(ev) }
func (ev *PrjnGTypes) UnmarshalJSON(b []byte) error { return kit.EnumUnmarshalJSON(ev, b) }

//gosl: start act_prjn

// PrjnGTypes represents the conductance (G) effects of a given projection,
// including excitatory, inhibitory, and modulatory.
type PrjnGTypes int32
type PrjnGTypes int32 //enums:enum

// The projection conductance types
const (
Expand All @@ -49,8 +40,6 @@ const (
// Context projections are for inputs to CT layers, which update
// only at the end of the plus phase, and send to CtxtGe.
ContextG

PrjnGTypesN
)

//////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -251,16 +240,16 @@ func (ws *PrjnScaleParams) SLayActScale(savg, snu, ncon float32) float32 {
}
semExtra := 2
slayActN := int(mat32.Round(savg * snu)) // sending layer actual # active
slayActN = ints.MaxInt(slayActN, 1)
slayActN = max(slayActN, 1)
var sc float32
if ncon == snu {
sc = 1 / float32(slayActN)
} else {
maxActN := int(mat32.Min(ncon, float32(slayActN))) // max number we could get
avgActN := int(mat32.Round(savg * ncon)) // recv average actual # active if uniform
avgActN = ints.MaxInt(avgActN, 1)
avgActN = max(avgActN, 1)
expActN := avgActN + semExtra // expected
expActN = ints.MinInt(expActN, maxActN)
expActN = min(expActN, maxActN)
sc = 1 / float32(expActN)
}
return sc
Expand Down
2 changes: 2 additions & 0 deletions axon/axon.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package axon

//go:generate goki generate -add-types

import (
"github.com/emer/emergent/v2/emer"
)
Expand Down
6 changes: 3 additions & 3 deletions axon/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"github.com/emer/emergent/v2/etime"
"github.com/emer/emergent/v2/params"
"github.com/emer/emergent/v2/prjn"
"github.com/goki/ki/kit"
"goki.dev/etable/v2/etensor"
"goki.dev/laser"
"goki.dev/mat32/v2"
"golang.org/x/exp/maps"
)
Expand Down Expand Up @@ -260,7 +260,7 @@ func TestSpikeProp(t *testing.T) {

// StructVals adds field vals to given vals map
func StructVals(obj any, vals map[string]float32, key string) {
v := kit.NonPtrValue(reflect.ValueOf(obj))
v := laser.NonPtrValue(reflect.ValueOf(obj))
typ := v.Type()
for i := 0; i < v.NumField(); i++ {
ft := typ.Field(i)
Expand All @@ -269,7 +269,7 @@ func StructVals(obj any, vals map[string]float32, key string) {
}
fv := v.Field(i)
kk := key + fmt.Sprintf("\t%s", ft.Name)
vals[kk], _ = kit.ToFloat32(fv.Interface())
vals[kk], _ = laser.ToFloat32(fv.Interface())
}
}

Expand Down
4 changes: 2 additions & 2 deletions axon/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"math"

"github.com/emer/emergent/v2/etime"
"github.com/goki/gosl/slbool"
"github.com/goki/gosl/slrand"
"goki.dev/glop/num"
"goki.dev/gosl/v2/slbool"
"goki.dev/gosl/v2/slrand"
)

var (
Expand Down
57 changes: 0 additions & 57 deletions axon/damodtypes_string.go

This file was deleted.

Loading

0 comments on commit 283d532

Please sign in to comment.