forked from emer/leabra
-
Notifications
You must be signed in to change notification settings - Fork 1
/
neuron.go
44 lines (38 loc) · 1.07 KB
/
neuron.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) 2019, The Emergent Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package pbwm
import "github.com/ccnlab/leabrax/leabra"
// NeurVars are indexes into extra PBWM neuron-level variables
type NeurVars int
const (
DA NeurVars = iota
DALrn
ACh
SE
GateAct
GateNow
GateCnt
ActG
NrnMaint
MaintGe
NeurVarsN
)
var (
// NeuronVars are the pbwm neurons plus some custom variables that sub-types use for their
// algo-specific cases -- need a consistent set of overall network-level vars for display / generic
// interface.
NeuronVars = []string{"DA", "DALrn", "ACh", "SE", "GateAct", "GateNow", "GateCnt", "ActG", "Maint", "MaintGe"}
NeuronVarsMap map[string]int
NeuronVarsAll []string
)
func init() {
NeuronVarsMap = make(map[string]int, len(NeuronVars))
for i, v := range NeuronVars {
NeuronVarsMap[v] = i
}
ln := len(leabra.NeuronVars)
NeuronVarsAll = make([]string, len(NeuronVars)+ln)
copy(NeuronVarsAll, leabra.NeuronVars)
copy(NeuronVarsAll[ln:], NeuronVars)
}