Skip to content

Commit

Permalink
generate synapse var data from enum docs, other updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Aug 26, 2024
1 parent 57eca95 commit 4c962e3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
7 changes: 5 additions & 2 deletions axon/neuron.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package axon

import (
"fmt"
"strings"

"github.com/emer/emergent/v2/emer"
)
Expand Down Expand Up @@ -334,6 +335,8 @@ const (
// These need to be in Vars because they can be differential per data (for ext inputs)
// and are writable (indexes are read only).
NrnFlags

// IMPORTANT: if NrnFlags is not the last, need to update gosl defn below
)

// NeuronAvgVars are mostly neuron variables involved in longer-term average activity
Expand Down Expand Up @@ -707,14 +710,14 @@ func init() {
NeuronVarNames = append(NeuronVarNames, vnm)
NeuronVarsMap[vnm] = int(i)
tag := NeuronVarProps[vnm]
NeuronVarProps[vnm] = tag + ` doc:"` + i.Desc() + `"`
NeuronVarProps[vnm] = tag + ` doc:"` + strings.ReplaceAll(i.Desc(), "\n", " ") + `"`
}
for i := ActAvg; i < NeuronAvgVarsN; i++ {
vnm := i.String()
NeuronVarNames = append(NeuronVarNames, vnm)
NeuronVarsMap[vnm] = int(NeuronVarsN) + int(i)
tag := NeuronVarProps[vnm]
NeuronVarProps[vnm] = tag + ` doc:"` + i.Desc() + `"`
NeuronVarProps[vnm] = tag + ` doc:"` + strings.ReplaceAll(i.Desc(), "\n", " ") + `"`
}
for i, vnm := range NeuronLayerVars {
NeuronVarNames = append(NeuronVarNames, vnm)
Expand Down
27 changes: 16 additions & 11 deletions axon/synapse.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package axon

import (
"fmt"
"strings"
)

//gosl:start synapse
Expand Down Expand Up @@ -196,17 +197,17 @@ func (ns *SynapseIndexStrides) SetIndexOuter(nsyn int) {

// SynapseVarProps has all of the display properties for synapse variables, including desc tooltips
var SynapseVarProps = map[string]string{
"Wt": `cat:"Wts" desc:"effective synaptic weight value, determining how much conductance one spike drives on the receiving neuron, representing the actual number of effective AMPA receptors in the synapse. Wt = SWt * WtSig(LWt), where WtSig produces values between 0-2 based on LWt, centered on 1."`,
"LWt": `cat:"Wts" desc:"rapidly learning, linear weight value -- learns according to the lrate specified in the connection spec. Biologically, this represents the internal biochemical processes that drive the trafficking of AMPA receptors in the synaptic density. Initially all LWt are .5, which gives 1 from WtSig function."`,
"SWt": `cat:"Wts" desc:"slowly adapting structural weight value, which acts as a multiplicative scaling factor on synaptic efficacy: biologically represents the physical size and efficacy of the dendritic spine. SWt values adapt in an outer loop along with synaptic scaling, with constraints to prevent runaway positive feedback loops and maintain variance and further capacity to learn. Initial variance is all in SWt, with LWt set to .5, and scaling absorbs some of LWt into SWt."`,
"DWt": `cat:"Wts" auto-scale:"+" desc:"delta (change in) synaptic weight, from learning -- updates LWt which then updates Wt."`,
"DSWt": `cat:"Wts" auto-scale:"+" desc:"change in SWt slow synaptic weight -- accumulates DWt"`,
"CaM": `cat:"Wts" auto-scale:"+" desc:"first stage running average (mean) Ca calcium level (like CaM = calmodulin), feeds into CaP"`,
"CaP": `cat:"Wts" auto-scale:"+"desc:"shorter timescale integrated CaM value, representing the plus, LTP direction of weight change and capturing the function of CaMKII in the Kinase learning rule"`,
"CaD": `cat:"Wts" auto-scale:"+" desc:"longer timescale integrated CaP value, representing the minus, LTD direction of weight change and capturing the function of DAPK1 in the Kinase learning rule"`,
"Tr": `cat:"Wts" auto-scale:"+" desc:"trace of synaptic activity over time -- used for credit assignment in learning. In MatrixPath this is a tag that is then updated later when US occurs."`,
"DTr": `cat:"Wts" auto-scale:"+" desc:"delta (change in) Tr trace of synaptic activity over time"`,
"DiDWt": `cat:"Wts" auto-scale:"+" desc:"delta weight for each data parallel index (Di) -- this is directly computed from the Ca values (in cortical version) and then aggregated into the overall DWt (which may be further integrated across MPI nodes), which then drives changes in Wt values"`,
"Wt": `cat:"Wts"`,
"LWt": `cat:"Wts"`,
"SWt": `cat:"Wts"`,
"DWt": `cat:"Wts" auto-scale:"+"`,
"DSWt": `cat:"Wts" auto-scale:"+"`,
"CaM": `cat:"Wts" auto-scale:"+"`,
"CaP": `cat:"Wts" auto-scale:"+"`,
"CaD": `cat:"Wts" auto-scale:"+"`,
"Tr": `cat:"Wts" auto-scale:"+"`,
"DTr": `cat:"Wts" auto-scale:"+"`,
"DiDWt": `cat:"Wts" auto-scale:"+"`,
}

var (
Expand All @@ -220,11 +221,15 @@ func init() {
vnm := i.String()
SynapseVarNames = append(SynapseVarNames, vnm)
SynapseVarsMap[vnm] = int(i)
tag := SynapseVarProps[vnm]
SynapseVarProps[vnm] = tag + ` doc:"` + strings.ReplaceAll(i.Desc(), "\n", " ") + `"`
}
for i := Tr; i < SynapseCaVarsN; i++ {
vnm := i.String()
SynapseVarNames = append(SynapseVarNames, vnm)
SynapseVarsMap[vnm] = int(SynapseVarsN) + int(i)
tag := SynapseVarProps[vnm]
SynapseVarProps[vnm] = tag + ` doc:"` + strings.ReplaceAll(i.Desc(), "\n", " ") + `"`
}
}

Expand Down

0 comments on commit 4c962e3

Please sign in to comment.