Use of typegen.go

6 views
Skip to first unread message

Stephen Read

unread,
Oct 22, 2024, 10:54:38 PM10/22/24
to emergen...@googlegroups.com

Is there a description somewhere of why the single large struc variable was broken up into four sub struc variables, plus an overall sim struc? And why core generate -add-types is needed to generate the typegen.go file.

Also, if one wants to add a struc variable, when modifying an existing file, say if you want to have variables for multiple separate data files, do you need to run core generate within the folder to generate a new typegen.go file?

Thanks, Steve

 

 

Stephen J. Read

Mendel B. Silberberg Professor of Social Psychology

Department of Psychology

University of Southern California

Los Angeles, CA 90089-1061

Website: www.stephenjread.com

 

 

 

Randall O'Reilly

unread,
Oct 23, 2024, 5:35:18 PM10/23/24
to Stephen Read, emergen...@googlegroups.com
* the Config struct pulls out variables that can be specified using a config.toml config file, or via command line, automatically, via the emergent econfig package (which will be updated to the cogent core cli package at some point). The config files make it easier to manage different configurations for more complex sims. If you run an executable using -h you can see the args, and here is an example config.toml file to get a sense of the syntax (for the axon/examples/choose project):

GUI = true
Debug = false
# OpenWts = "tmp.wts.gz"

[Env]
PctCortexStEpc = 50
# Config = "01_us_magnitude.toml"
Config = "02_us_probability.toml" # best overall stats
# Config = "03_distance.toml"
# Config = "04_effort.toml"

[Params]
# SaveAll = true
# Good = true

[Run]
# GPU = false
# NData = 1
GPU = true
NData = 8 # 8 smoother than 16
NEpochs = 50
NRuns = 5


* I'm not sure which other sub struct types you're referring to, but most of the rest of the Sim struct now uses the v2 emergent types to manage stats, logs, etc. It reduces boilerplate and makes the Sim "control panel" much simpler.

* all the sims have: //go:generate core generate -add-types
this means that when you type "go generate" it runs "core generate" with the -add-types option, which is key for getting the relevant tooltip etc info. this only needs to be run when you change fields on a type, and it is also key for processing enums. so, yes you should run "go generate" anytime you update that info.

Also, I finished the complete update of leabra to v2, so that package now actually fully builds and passes its tests, and supports the deep, pbwm, rl, and hip algorithms that are used in the textbook sims. The new go.mod for this is:

github.com/emer/leabra/v2 v2.0.0-dev0.5.0

There are a few more key updates to v2 coming down the road in a few weeks / months, so the final v2 release will happen after all that is done (and not until cogent core itself has a v1 release, which should be in a couple of months too).

- Randy
> --
> You received this message because you are subscribed to the Google Groups "emergent-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to emergent-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/emergent-users/BYAPR07MB4679C3EE2FC81CB6D13760AAD74D2%40BYAPR07MB4679.namprd07.prod.outlook.com.


Reply all
Reply to author
Forward
0 new messages