Skip to content

Commit b46ceaa

Browse files
angelajtkkoreilly
andauthored
embed readmefs in all sims (#49)
* fix index out of range error * remove blank line * simplify cpar check * embed readme in all sims * remove extra comments in objrec * update to latest version of emergent * update workflow --------- Co-authored-by: Kai O'Reilly <[email protected]>
1 parent 6babc52 commit b46ceaa

File tree

28 files changed

+129
-29
lines changed

28 files changed

+129
-29
lines changed

ch10/dyslexia/dyslexia.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ import (
4747
//go:embed train_pats.tsv semantics.tsv close_orthos.tsv close_sems.tsv trained.wts
4848
var content embed.FS
4949

50+
//go:embed *.png README.md
51+
var readme embed.FS
52+
5053
// LesionTypes is the type of lesion
5154
type LesionTypes int32 //enums:enum
5255

@@ -855,7 +858,7 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) {
855858
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
856859
func (ss *Sim) ConfigGUI() {
857860
title := "Dyslexia"
858-
ss.GUI.MakeBody(ss, "dyslexia", title, `Simulates normal and disordered (dyslexic) reading performance in terms of a distributed representation of word-level knowledge across Orthography, Semantics, and Phonology. It is based on a model by Plaut and Shallice (1993). Note that this form of dyslexia is *aquired* (via brain lesions such as stroke) and not the more prevalent developmental variety. See <a href="https://github.com/CompCogNeuro/sims/blob/master/ch10/dyslexia/README.md">README.md on GitHub</a>.</p>`)
861+
ss.GUI.MakeBody(ss, "dyslexia", title, `Simulates normal and disordered (dyslexic) reading performance in terms of a distributed representation of word-level knowledge across Orthography, Semantics, and Phonology. It is based on a model by Plaut and Shallice (1993). Note that this form of dyslexia is *aquired* (via brain lesions such as stroke) and not the more prevalent developmental variety. See <a href="https://github.com/CompCogNeuro/sims/blob/master/ch10/dyslexia/README.md">README.md on GitHub</a>.</p>`, readme)
859862
ss.GUI.CycleUpdateInterval = 10
860863

861864
nv := ss.GUI.AddNetView("Network")

ch10/sem/sem.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ import (
4242
//go:embed cecn_lg_f5.text cecn_lg_f5.words quiz.text trained_rec05.wts.gz
4343
var content embed.FS
4444

45+
//go:embed README.md
46+
var readme embed.FS
47+
4548
func main() {
4649
sim := &Sim{}
4750
sim.New()
@@ -657,7 +660,7 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) {
657660
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
658661
func (ss *Sim) ConfigGUI() {
659662
title := "Semantics"
660-
ss.GUI.MakeBody(ss, "sem", title, `sem is trained using Hebbian learning on paragraphs from an early draft of the *Computational Explorations..* textbook, allowing it to learn about the overall statistics of when different words co-occur with other words, and thereby learning a surprisingly capable (though clearly imperfect) level of semantic knowlege about the topics covered in the textbook. This replicates the key results from the Latent Semantic Analysis research by Landauer and Dumais (1997). See <a href="https://github.com/CompCogNeuro/sims/blob/master/ch10/sem/README.md">README.md on GitHub</a>.</p>`)
663+
ss.GUI.MakeBody(ss, "sem", title, `sem is trained using Hebbian learning on paragraphs from an early draft of the *Computational Explorations..* textbook, allowing it to learn about the overall statistics of when different words co-occur with other words, and thereby learning a surprisingly capable (though clearly imperfect) level of semantic knowlege about the topics covered in the textbook. This replicates the key results from the Latent Semantic Analysis research by Landauer and Dumais (1997). See <a href="https://github.com/CompCogNeuro/sims/blob/master/ch10/sem/README.md">README.md on GitHub</a>.</p>`, readme)
661664
ss.GUI.CycleUpdateInterval = 10
662665

663666
nv := ss.GUI.AddNetView("Network")

ch10/sg/sg.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ import (
4545
//go:embed trained.wts.gz sg_rules.txt sg_tests.txt sg_probes.txt
4646
var content embed.FS
4747

48+
//go:embed *.png README.md
49+
var readme embed.FS
50+
4851
func main() {
4952
sim := &Sim{}
5053
sim.New()
@@ -800,7 +803,7 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) {
800803
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
801804
func (ss *Sim) ConfigGUI() {
802805
title := "Sentence Gestalt"
803-
ss.GUI.MakeBody(ss, "sg", title, `This is the sentence gestalt model, which learns to encode both syntax and semantics of sentences in an integrated "gestalt" hidden layer. The sentences have simple agent-verb-patient structure with optional prepositional or adverb modifier phrase at the end, and can be either in the active or passive form (80% active, 20% passive). There are ambiguous terms that need to be resolved via context, showing a key interaction between syntax and semantics. See <a href="https://github.com/CompCogNeuro/sims/blob/master/ch10/sg/README.md">README.md on GitHub</a>.</p>`)
806+
ss.GUI.MakeBody(ss, "sg", title, `This is the sentence gestalt model, which learns to encode both syntax and semantics of sentences in an integrated "gestalt" hidden layer. The sentences have simple agent-verb-patient structure with optional prepositional or adverb modifier phrase at the end, and can be either in the active or passive form (80% active, 20% passive). There are ambiguous terms that need to be resolved via context, showing a key interaction between syntax and semantics. See <a href="https://github.com/CompCogNeuro/sims/blob/master/ch10/sg/README.md">README.md on GitHub</a>.</p>`, readme)
804807
ss.GUI.CycleUpdateInterval = 10
805808

806809
nv := ss.GUI.AddNetView("Network")

ch10/ss/ss.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ import (
4444
//go:embed train_pats.tsv probe.tsv besner.tsv glushko.tsv taraban.tsv phon_cons.tsv phon_vowel.tsv trained.wts.gz
4545
var content embed.FS
4646

47+
//go:embed *.png README.md
48+
var readme embed.FS
49+
4750
// EnvType is the type of test environment
4851
type EnvType int32 //enums:enum
4952

@@ -697,7 +700,7 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) {
697700
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
698701
func (ss *Sim) ConfigGUI() {
699702
title := "Spelling to Sound"
700-
ss.GUI.MakeBody(ss, "ss", title, `explores the way that regularities and exceptions are learned in the mapping between spelling (orthography) and sound (phonology), in the context of a "direct pathway" mapping between these two forms of word representations. See <a href="https://github.com/CompCogNeuro/sims/blob/master/ch10/ss/README.md">README.md on GitHub</a>.</p>`)
703+
ss.GUI.MakeBody(ss, "ss", title, `explores the way that regularities and exceptions are learned in the mapping between spelling (orthography) and sound (phonology), in the context of a "direct pathway" mapping between these two forms of word representations. See <a href="https://github.com/CompCogNeuro/sims/blob/master/ch10/ss/README.md">README.md on GitHub</a>.</p>`, readme)
701704
ss.GUI.CycleUpdateInterval = 10
702705

703706
nv := ss.GUI.AddNetView("Network")

ch2/detector/detector.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ import (
3838
//go:embed *.tsv
3939
var patsfs embed.FS
4040

41+
//go:embed README.md
42+
var readme embed.FS
43+
4144
func main() {
4245
sim := &Sim{}
4346
sim.New()
@@ -397,7 +400,7 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) {
397400
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
398401
func (ss *Sim) ConfigGUI() {
399402
title := "Detector"
400-
ss.GUI.MakeBody(ss, "detector", title, `This simulation shows how an individual neuron can act like a detector, picking out specific patterns from its inputs and responding with varying degrees of selectivity to the match between its synaptic weights and the input activity pattern. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch2/detector/README.md">README.md on GitHub</a>.</p>`)
403+
ss.GUI.MakeBody(ss, "detector", title, `This simulation shows how an individual neuron can act like a detector, picking out specific patterns from its inputs and responding with varying degrees of selectivity to the match between its synaptic weights and the input activity pattern. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch2/detector/README.md">README.md on GitHub</a>.</p>`, readme)
401404
ss.GUI.CycleUpdateInterval = 10
402405

403406
nv := ss.GUI.AddNetView("Network")

ch2/neuron/neuron.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ package main
1010
//go:generate core generate -add-types
1111

1212
import (
13+
"embed"
1314
"fmt"
1415
"log"
1516
"reflect"
@@ -31,6 +32,9 @@ import (
3132
"github.com/emer/leabra/v2/spike"
3233
)
3334

35+
//go:embed README.md
36+
var readme embed.FS
37+
3438
func main() {
3539
sim := &Sim{}
3640
sim.New()
@@ -423,7 +427,7 @@ func (ss *Sim) ConfigNetView(nv *netview.NetView) {
423427
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
424428
func (ss *Sim) ConfigGUI() {
425429
title := "Neuron"
426-
ss.GUI.MakeBody(ss, "neuron", title, `This simulation illustrates the basic properties of neural spiking and rate-code activation, reflecting a balance of excitatory and inhibitory influences (including leak and synaptic inhibition). See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch2/neuron/README.md">README.md on GitHub</a>.</p>`)
430+
ss.GUI.MakeBody(ss, "neuron", title, `This simulation illustrates the basic properties of neural spiking and rate-code activation, reflecting a balance of excitatory and inhibitory influences (including leak and synaptic inhibition). See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch2/neuron/README.md">README.md on GitHub</a>.</p>`, readme)
427431
ss.GUI.CycleUpdateInterval = 10
428432

429433
nv := ss.GUI.AddNetView("Network")

ch3/cats_dogs/cats_dogs.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ import (
3939
//go:embed cats_dogs_pats.tsv cats_dogs.wts
4040
var content embed.FS
4141

42+
//go:embed README.md
43+
var readme embed.FS
44+
4245
func main() {
4346
sim := &Sim{}
4447
sim.New()
@@ -435,7 +438,7 @@ func (ss *Sim) ConfigNetView(nv *netview.NetView) {
435438
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
436439
func (ss *Sim) ConfigGUI() {
437440
title := "CatsAndDogs"
438-
ss.GUI.MakeBody(ss, "cats_dogs", title, `This project explores a simple **semantic network** intended to represent a (very small) set of relationships among different features used to represent a set of entities in the world. In our case, we represent some features of cats and dogs: their color, size, favorite food, and favorite toy. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch3/cats_dogs/README.md">README.md on GitHub</a>.</p>`)
441+
ss.GUI.MakeBody(ss, "cats_dogs", title, `This project explores a simple **semantic network** intended to represent a (very small) set of relationships among different features used to represent a set of entities in the world. In our case, we represent some features of cats and dogs: their color, size, favorite food, and favorite toy. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch3/cats_dogs/README.md">README.md on GitHub</a>.</p>`, readme)
439442
ss.GUI.CycleUpdateInterval = 10
440443

441444
nv := ss.GUI.AddNetView("Network")

ch3/faces/faces.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ import (
4848
//go:embed faces.tsv partial_faces.tsv faces.wts
4949
var content embed.FS
5050

51+
//go:embed *.png README.md
52+
var readme embed.FS
53+
5154
func main() {
5255
sim := &Sim{}
5356
sim.New()
@@ -557,7 +560,7 @@ func (ss *Sim) ConfigNetView(nv *netview.NetView) {
557560
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
558561
func (ss *Sim) ConfigGUI() {
559562
title := "Faces"
560-
ss.GUI.MakeBody(ss, "faces", title, `This project explores how sensory inputs (in this case simple cartoon faces) can be categorized in multiple different ways, to extract the relevant information and collapse across the irrelevant. It allows you to explore both bottom-up processing from face image to categories, and top-down processing from category values to face images (imagery), including the ability to dynamically iterate both bottom-up and top-down to cleanup partial inputs (partially occluded face images). See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch3/faces/README.md">README.md on GitHub</a>.</p>`)
563+
ss.GUI.MakeBody(ss, "faces", title, `This project explores how sensory inputs (in this case simple cartoon faces) can be categorized in multiple different ways, to extract the relevant information and collapse across the irrelevant. It allows you to explore both bottom-up processing from face image to categories, and top-down processing from category values to face images (imagery), including the ability to dynamically iterate both bottom-up and top-down to cleanup partial inputs (partially occluded face images). See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch3/faces/README.md">README.md on GitHub</a>.</p>`, readme)
561564
ss.GUI.CycleUpdateInterval = 10
562565

563566
nv := ss.GUI.AddNetView("Network")

ch3/inhib/inhib.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ package main
1010
//go:generate core generate -add-types
1111

1212
import (
13+
"embed"
14+
1315
"cogentcore.org/core/base/errors"
1416
"cogentcore.org/core/core"
1517
"cogentcore.org/core/enums"
@@ -32,6 +34,9 @@ import (
3234
"github.com/emer/leabra/v2/leabra"
3335
)
3436

37+
//go:embed README.md
38+
var readme embed.FS
39+
3540
func main() {
3641
sim := &Sim{}
3742
sim.New()
@@ -591,7 +596,7 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) {
591596
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
592597
func (ss *Sim) ConfigGUI() {
593598
title := "Inhib"
594-
ss.GUI.MakeBody(ss, "inhib", title, `inhib: This simulation explores how inhibitory interneurons can dynamically control overall activity levels within the network, by providing both feedforward and feedback inhibition to excitatory pyramidal neurons. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch3/inhib/README.md">README.md on GitHub</a>.</p>`)
599+
ss.GUI.MakeBody(ss, "inhib", title, `inhib: This simulation explores how inhibitory interneurons can dynamically control overall activity levels within the network, by providing both feedforward and feedback inhibition to excitatory pyramidal neurons. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch3/inhib/README.md">README.md on GitHub</a>.</p>`, readme)
595600
ss.GUI.CycleUpdateInterval = 10
596601

597602
nv := ss.GUI.AddNetView("FF Net")

ch3/necker_cube/necker_cube.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ import (
3232
//go:embed necker_cube.wts
3333
var content embed.FS
3434

35+
//go:embed *.png README.md
36+
var readme embed.FS
37+
3538
func main() {
3639
sim := &Sim{}
3740
sim.New()
@@ -372,7 +375,7 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) {
372375
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
373376
func (ss *Sim) ConfigGUI() {
374377
title := "NeckerCube"
375-
ss.GUI.MakeBody(ss, "necker_cube", title, `necker_cube: This simulation explores the use of constraint satisfaction in processing ambiguous stimuli, in this case the *Necker cube*, which can be viewed as a cube in one of two orientations, where people flip back and forth. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch3/necker_cube/README.md">README.md on GitHub</a>.</p>`)
378+
ss.GUI.MakeBody(ss, "necker_cube", title, `necker_cube: This simulation explores the use of constraint satisfaction in processing ambiguous stimuli, in this case the *Necker cube*, which can be viewed as a cube in one of two orientations, where people flip back and forth. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch3/necker_cube/README.md">README.md on GitHub</a>.</p>`, readme)
376379
ss.GUI.CycleUpdateInterval = 10
377380

378381
nv := ss.GUI.AddNetView("Network")

ch4/err_driven_hidden/err_driven_hidden.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ import (
3838
//go:embed easy.tsv hard.tsv impossible.tsv
3939
var content embed.FS
4040

41+
//go:embed README.md
42+
var readme embed.FS
43+
4144
// PatsType is the type of training patterns
4245
type PatsType int32 //enums:enum
4346

@@ -570,7 +573,7 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) {
570573
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
571574
func (ss *Sim) ConfigGUI() {
572575
title := "Error Driven Hidden"
573-
ss.GUI.MakeBody(ss, "err_driven_hidden", title, `err_driven_hidden shows how XCal error driven learning can train a hidden layer to solve problems that are otherwise impossible for a simple two layer network (as we saw in the Pattern Associator exploration, which should be completed first before doing this one). See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch4/err_driven_hidden/README.md">README.md on GitHub</a>.</p>`)
576+
ss.GUI.MakeBody(ss, "err_driven_hidden", title, `err_driven_hidden shows how XCal error driven learning can train a hidden layer to solve problems that are otherwise impossible for a simple two layer network (as we saw in the Pattern Associator exploration, which should be completed first before doing this one). See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch4/err_driven_hidden/README.md">README.md on GitHub</a>.</p>`, readme)
574577
ss.GUI.CycleUpdateInterval = 10
575578

576579
nv := ss.GUI.AddNetView("Network")

ch4/family_trees/family_trees.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ import (
4141
//go:embed family_trees.tsv
4242
var content embed.FS
4343

44+
//go:embed *.png README.md
45+
var readme embed.FS
46+
4447
// LearnType is the type of learning to use
4548
type LearnType int32 //enums:enum
4649

@@ -613,7 +616,7 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) {
613616
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
614617
func (ss *Sim) ConfigGUI() {
615618
title := "Family Trees"
616-
ss.GUI.MakeBody(ss, "family_trees", title, `family_trees shows how learning can recode inputs that have no similarity structure into a hidden layer that captures the *functional* similarity structure of the items. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch4/family_trees/README.md">README.md on GitHub</a>.</p>`)
619+
ss.GUI.MakeBody(ss, "family_trees", title, `family_trees shows how learning can recode inputs that have no similarity structure into a hidden layer that captures the *functional* similarity structure of the items. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch4/family_trees/README.md">README.md on GitHub</a>.</p>`, readme)
617620
ss.GUI.CycleUpdateInterval = 10
618621

619622
nv := ss.GUI.AddNetView("Network")

ch4/hebberr_combo/hebberr_combo.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ import (
4343
//go:embed lines2out1.tsv
4444
var content embed.FS
4545

46+
//go:embed README.md
47+
var readme embed.FS
48+
4649
// LearnType is the type of learning to use
4750
type LearnType int32 //enums:enum
4851

@@ -659,7 +662,7 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) {
659662
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
660663
func (ss *Sim) ConfigGUI() {
661664
title := "HebbErr_Combo"
662-
ss.GUI.MakeBody(ss, "hebberr_combo", title, `hebberr_combo shows how XCal hebbian learning in shallower layers of a network can aid an error driven learning network to generalize to unseen combinations of patterns. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch4/hebberr_combo/README.md">README.md on GitHub</a>.</p>`)
665+
ss.GUI.MakeBody(ss, "hebberr_combo", title, `hebberr_combo shows how XCal hebbian learning in shallower layers of a network can aid an error driven learning network to generalize to unseen combinations of patterns. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch4/hebberr_combo/README.md">README.md on GitHub</a>.</p>`, readme)
663666
ss.GUI.CycleUpdateInterval = 10
664667

665668
nv := ss.GUI.AddNetView("Network")

ch4/pat_assoc/pat_assoc.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ import (
3737
//go:embed easy.tsv hard.tsv impossible.tsv
3838
var content embed.FS
3939

40+
//go:embed README.md
41+
var readme embed.FS
42+
4043
// PatsType is the type of training patterns
4144
type PatsType int32 //enums:enum
4245

@@ -559,7 +562,7 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) {
559562
// ConfigGUI configures the Cogent Core GUI interface for this simulation.
560563
func (ss *Sim) ConfigGUI() {
561564
title := "Pat Assoc"
562-
ss.GUI.MakeBody(ss, "pat_assoc", title, `pat_assoc illustrates how error-driven and hebbian learning can operate within a simple task-driven learning context, with no hidden layers. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch4/pat_assoc/README.md">README.md on GitHub</a>.</p>`)
565+
ss.GUI.MakeBody(ss, "pat_assoc", title, `pat_assoc illustrates how error-driven and hebbian learning can operate within a simple task-driven learning context, with no hidden layers. See <a href="https://github.com/CompCogNeuro/sims/blob/main/ch4/pat_assoc/README.md">README.md on GitHub</a>.</p>`, readme)
563566
ss.GUI.CycleUpdateInterval = 10
564567

565568
nv := ss.GUI.AddNetView("Network")

0 commit comments

Comments
 (0)