Documentation
¶
Index ¶
- Constants
- func GetNextId() int
- type Data
- type DataPool
- type ICell
- type ICompartment
- type IConnection
- type IDendrite
- type ISynapse
- type ProtoCompartment
- func (bc *ProtoCompartment) AddSynapse(syn ISynapse)
- func (c *ProtoCompartment) Dendrite() IDendrite
- func (c *ProtoCompartment) Integrate(t float64, cell ICell) float64
- func (c *ProtoCompartment) Load(json interface{})
- func (c *ProtoCompartment) PostProcess()
- func (c *ProtoCompartment) Process()
- func (bc *ProtoCompartment) Reset()
- func (c *ProtoCompartment) ToJSON() interface{}
- type ProtoDendrite
- func (d *ProtoDendrite) APEfficacy(distance float64) float64
- func (bc *ProtoDendrite) AddCompartment(comp ICompartment)
- func (d *ProtoDendrite) Integrate(t float64, cell ICell) float64
- func (d *ProtoDendrite) Load(json interface{})
- func (d *ProtoDendrite) PostProcess()
- func (d *ProtoDendrite) Process()
- func (bc *ProtoDendrite) Reset()
- func (d *ProtoDendrite) SetField(field, value string)
- func (d *ProtoDendrite) ToJSON() interface{}
- type ProtoNeuron
- func (n *ProtoNeuron) APFast() float64
- func (n *ProtoNeuron) APSlow() float64
- func (n *ProtoNeuron) APSlowPrior() float64
- func (n *ProtoNeuron) AddInConnection(con IConnection)
- func (n *ProtoNeuron) AddOutConnection(con IConnection)
- func (bc *ProtoNeuron) AttachDendrite(den IDendrite)
- func (bc *ProtoNeuron) Diagnostics(msg string)
- func (n *ProtoNeuron) Efficacy() float64
- func (bc *ProtoNeuron) ID() int
- func (n *ProtoNeuron) Integrate(t float64) float64
- func (n *ProtoNeuron) Load(json interface{})
- func (n *ProtoNeuron) Output() float64
- func (n *ProtoNeuron) PostProcess()
- func (n *ProtoNeuron) Process()
- func (n *ProtoNeuron) Reset()
- func (n *ProtoNeuron) SetField(field, value string)
- func (bc *ProtoNeuron) SetID(id int)
- func (n *ProtoNeuron) SetThreshold(theta float64)
- func (bc *ProtoNeuron) Store(file string)
- func (n *ProtoNeuron) ToJSON() interface{}
- type ProtoSynapse
- func (bs *ProtoSynapse) Connect(con IConnection)
- func (bs *ProtoSynapse) GetConnection() IConnection
- func (bs *ProtoSynapse) Id() int
- func (bs *ProtoSynapse) Input() int
- func (n *ProtoSynapse) Integrate(t float64, cell ICell) float64
- func (bs *ProtoSynapse) IsExcititory() bool
- func (n *ProtoSynapse) Load(json interface{})
- func (n *ProtoSynapse) PostProcess()
- func (n *ProtoSynapse) Process()
- func (n *ProtoSynapse) Reset()
- func (n *ProtoSynapse) SetAma(v float64)
- func (n *ProtoSynapse) SetAmb(v float64)
- func (n *ProtoSynapse) SetField(field, value string)
- func (bs *ProtoSynapse) SetId(id int)
- func (n *ProtoSynapse) SetTaoN(v float64)
- func (n *ProtoSynapse) SetTaoP(v float64)
- func (n *ProtoSynapse) SetTsw(v float64)
- func (bs *ProtoSynapse) SetWMax(v float64)
- func (bs *ProtoSynapse) SetWMin(v float64)
- func (bs *ProtoSynapse) SetWeight(weight float64)
- func (n *ProtoSynapse) ToJSON() interface{}
- type ProximalSynapse
- func (bs *ProximalSynapse) Connect(con IConnection)
- func (bs *ProximalSynapse) GetConnection() IConnection
- func (bs *ProximalSynapse) Id() int
- func (bs *ProximalSynapse) Input() int
- func (n *ProximalSynapse) Integrate(dt float64) float64
- func (bs *ProximalSynapse) IsExcititory() bool
- func (n *ProximalSynapse) Process()
- func (bs *ProximalSynapse) SetId(id int)
- func (bs *ProximalSynapse) SetWMax(v float64)
- func (bs *ProximalSynapse) SetWMin(v float64)
- func (bs *ProximalSynapse) SetWeight(weight float64)
- type SourceType
- type StimulusNeuron
- type StraightConnection
- type SynapseType
Constants ¶
const (
InitialPreT = 0.0 //-10000000000.0
)
This synapse is for prototyping only.
const (
RefractoryEpsilon = 0.1
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Data ¶
type Data struct {
// The time mark at which the data began flowing.
Time float64
// Value can be 1 or 0
Value byte
// Source indicates where the spike came from.
Source SourceType
}
Data represents information flowing through the network.
type DataPool ¶
type DataPool struct {
// contains filtered or unexported fields
}
var PoolData *DataPool = NewDataPool()
func NewDataPool ¶
func NewDataPool() *DataPool
type ICell ¶
type ICell interface {
ID() int
SetID(int)
SetThreshold(float64)
// Output is either a 1 or 0
Output() float64
// Input comes from a IConnection
AddInConnection(IConnection)
AddOutConnection(IConnection)
AttachDendrite(IDendrite)
Integrate(dt float64) float64
Process()
Reset()
SetField(field string, value string)
// Called at the end of a simulation run (not a pass)
PostProcess()
Diagnostics(string)
Load(json interface{})
Store(file string)
// Properties
APFast() float64
APSlow() float64
APSlowPrior() float64
Efficacy() float64
ToJSON() interface{}
}
ICell represents a network wide cell of which there can be many implementations. Cells make connections with other cells via [IConnection]s
func NewProtoNeuron ¶
func NewProtoNeuron() ICell
type ICompartment ¶
type ICompartment interface {
// Compartment properties
AddSynapse(ISynapse)
// Evaluates the total effective weight for the compartment.
Integrate(t float64, cell ICell) float64
Process()
PostProcess()
Dendrite() IDendrite
Reset()
Load(json interface{})
ToJSON() interface{}
}
ICompartment collects synapses. It represents the functionality of a group of synapses located along the Dendrite. Compartments are either close to or farther away from the neuron's soma: Proximal, Apical, Distal. TODO compartments can overlap causing effects to diffuse into neighboring compartments, for example, Ca++ dynamics (CaDP).
func NewProtoCompartment ¶
func NewProtoCompartment(den IDendrite) ICompartment
type IConnection ¶
type IConnection interface {
// If a connection has a delay then this will
// step the delay
Update()
// Inject a Data (aka spike) into the connection.
Input(int)
// Get connection's output
Output() int
// Post pass after Process and Integrate
Post()
}
IConnection represents a connection between inputs and/or cells. Connections transport Data objects.
A connection has a collection of inputs streams and output targets. A connection merges streams that target multiple cells.
Multiple cells can connect their output to the connection's input and the connection's ouput can feed into multiple cell inputs.
Some connections can delay their output behind their input. Some connections and have no delay (aka strait).
func NewStraightConnection ¶
func NewStraightConnection() IConnection
type IDendrite ¶
type IDendrite interface {
AddCompartment(ICompartment)
Integrate(t float64, cell ICell) float64
Process()
PostProcess()
APEfficacy(distance float64) float64
SetField(field string, value string)
Reset()
Load(json interface{})
ToJSON() interface{}
}
IDendrite collects and manages ICompartments.
func NewProtoDendrite ¶
type ISynapse ¶
type ISynapse interface {
Id() int
Connect(IConnection)
GetConnection() IConnection
// Evaluates the total effective weight for the synapse.
Integrate(t float64, cell ICell) float64
// Called before Integrate()
Process()
// Called at the end of a simulation run (not a pass)
PostProcess()
Reset()
// The current input on the synapse. The input is feed from an IConnection's
// output.
Input() int
IsExcititory() bool
Load(json interface{})
ToJSON() interface{}
SetWeight(float64)
SetWMax(float64)
SetWMin(float64)
SetField(field string, value string)
SetTaoP(float64)
SetTaoN(float64)
SetAma(float64)
SetAmb(float64)
SetTsw(float64)
}
ISynapse is a common interface. A synapse is associated with a connection and one or more behaviors. One such behavior is STDP for evaluating the Long-term effect. Each synapse is part of a group called a Compartment.
func NewProtoSynapse ¶
func NewProtoSynapse(comp ICompartment, synType SynapseType, id int, weightSeed int64) ISynapse
type ProtoCompartment ¶
type ProtoCompartment struct {
// contains filtered or unexported fields
}
func (*ProtoCompartment) AddSynapse ¶
func (bc *ProtoCompartment) AddSynapse(syn ISynapse)
func (*ProtoCompartment) Dendrite ¶
func (c *ProtoCompartment) Dendrite() IDendrite
func (*ProtoCompartment) Integrate ¶
func (c *ProtoCompartment) Integrate(t float64, cell ICell) float64
func (*ProtoCompartment) Load ¶
func (c *ProtoCompartment) Load(json interface{})
func (*ProtoCompartment) PostProcess ¶
func (c *ProtoCompartment) PostProcess()
func (*ProtoCompartment) Process ¶
func (c *ProtoCompartment) Process()
func (*ProtoCompartment) ToJSON ¶
func (c *ProtoCompartment) ToJSON() interface{}
type ProtoDendrite ¶
type ProtoDendrite struct {
// contains filtered or unexported fields
}
func (*ProtoDendrite) APEfficacy ¶
func (d *ProtoDendrite) APEfficacy(distance float64) float64
func (*ProtoDendrite) AddCompartment ¶
func (bc *ProtoDendrite) AddCompartment(comp ICompartment)
func (*ProtoDendrite) Integrate ¶
func (d *ProtoDendrite) Integrate(t float64, cell ICell) float64
2nd pass Integrate is the 2nd pass performing integration.
func (*ProtoDendrite) Load ¶
func (d *ProtoDendrite) Load(json interface{})
func (*ProtoDendrite) PostProcess ¶
func (d *ProtoDendrite) PostProcess()
func (*ProtoDendrite) Process ¶
func (d *ProtoDendrite) Process()
Process handles post processing before Integration is performed.
func (*ProtoDendrite) SetField ¶
func (d *ProtoDendrite) SetField(field, value string)
func (*ProtoDendrite) ToJSON ¶
func (d *ProtoDendrite) ToJSON() interface{}
type ProtoNeuron ¶
type ProtoNeuron struct {
// The time-mark of the current AP.
APt float64
APMax float64
// contains filtered or unexported fields
}
func (*ProtoNeuron) APFast ¶
func (n *ProtoNeuron) APFast() float64
func (*ProtoNeuron) APSlow ¶
func (n *ProtoNeuron) APSlow() float64
func (*ProtoNeuron) APSlowPrior ¶
func (n *ProtoNeuron) APSlowPrior() float64
func (*ProtoNeuron) AddInConnection ¶
func (n *ProtoNeuron) AddInConnection(con IConnection)
func (*ProtoNeuron) AddOutConnection ¶
func (n *ProtoNeuron) AddOutConnection(con IConnection)
func (*ProtoNeuron) AttachDendrite ¶
func (bc *ProtoNeuron) AttachDendrite(den IDendrite)
func (*ProtoNeuron) Diagnostics ¶
func (bc *ProtoNeuron) Diagnostics(msg string)
func (*ProtoNeuron) Efficacy ¶
func (n *ProtoNeuron) Efficacy() float64
func (*ProtoNeuron) Integrate ¶
func (n *ProtoNeuron) Integrate(t float64) float64
func (*ProtoNeuron) Load ¶
func (n *ProtoNeuron) Load(json interface{})
func (*ProtoNeuron) Output ¶
func (n *ProtoNeuron) Output() float64
func (*ProtoNeuron) PostProcess ¶
func (n *ProtoNeuron) PostProcess()
func (*ProtoNeuron) Process ¶
func (n *ProtoNeuron) Process()
func (*ProtoNeuron) Reset ¶
func (n *ProtoNeuron) Reset()
func (*ProtoNeuron) SetField ¶
func (n *ProtoNeuron) SetField(field, value string)
func (*ProtoNeuron) SetThreshold ¶
func (n *ProtoNeuron) SetThreshold(theta float64)
func (*ProtoNeuron) ToJSON ¶
func (n *ProtoNeuron) ToJSON() interface{}
type ProtoSynapse ¶
type ProtoSynapse struct {
// contains filtered or unexported fields
}
func (*ProtoSynapse) Connect ¶
func (bs *ProtoSynapse) Connect(con IConnection)
func (*ProtoSynapse) GetConnection ¶
func (bs *ProtoSynapse) GetConnection() IConnection
func (*ProtoSynapse) Input ¶
func (bs *ProtoSynapse) Input() int
Input returns the input feeding into this synapse. The synapse has an IConnection for input. This method returns that connection's output. i.e. the data entering the synapse from the connection.
func (*ProtoSynapse) Integrate ¶
func (n *ProtoSynapse) Integrate(t float64, cell ICell) float64
Integrate is the 2nd pass and handles integration. The effects pre/post synaptic spikes are felt here.
func (*ProtoSynapse) IsExcititory ¶
func (bs *ProtoSynapse) IsExcititory() bool
func (*ProtoSynapse) Load ¶
func (n *ProtoSynapse) Load(json interface{})
func (*ProtoSynapse) PostProcess ¶
func (n *ProtoSynapse) PostProcess()
Called at the end of a simulation run (not a pass)
func (*ProtoSynapse) Process ¶
func (n *ProtoSynapse) Process()
It is considered the 1st pass of the simulation per time step. 1) Internal values are 'moved' to the outputs. 2) Learning rules are applied.
func (*ProtoSynapse) Reset ¶
func (n *ProtoSynapse) Reset()
func (*ProtoSynapse) SetAma ¶
func (n *ProtoSynapse) SetAma(v float64)
func (*ProtoSynapse) SetAmb ¶
func (n *ProtoSynapse) SetAmb(v float64)
func (*ProtoSynapse) SetField ¶
func (n *ProtoSynapse) SetField(field, value string)
func (*ProtoSynapse) SetTaoN ¶
func (n *ProtoSynapse) SetTaoN(v float64)
func (*ProtoSynapse) SetTaoP ¶
func (n *ProtoSynapse) SetTaoP(v float64)
func (*ProtoSynapse) SetTsw ¶
func (n *ProtoSynapse) SetTsw(v float64)
func (*ProtoSynapse) ToJSON ¶
func (n *ProtoSynapse) ToJSON() interface{}
type ProximalSynapse ¶
type ProximalSynapse struct {
// contains filtered or unexported fields
}
func (*ProximalSynapse) Connect ¶
func (bs *ProximalSynapse) Connect(con IConnection)
func (*ProximalSynapse) GetConnection ¶
func (bs *ProximalSynapse) GetConnection() IConnection
func (*ProximalSynapse) Input ¶
func (bs *ProximalSynapse) Input() int
Input returns the input feeding into this synapse. The synapse has an IConnection for input. This method returns that connection's output. i.e. the data entering the synapse from the connection.
func (*ProximalSynapse) Integrate ¶
func (n *ProximalSynapse) Integrate(dt float64) float64
func (*ProximalSynapse) IsExcititory ¶
func (bs *ProximalSynapse) IsExcititory() bool
func (*ProximalSynapse) Process ¶
func (n *ProximalSynapse) Process()
type SourceType ¶
type SourceType int
const ( StimulusSource SourceType = iota PoissonSource NeuronSource // Typically indicates multiple sources spiked at the same time. MultiSource )
type StimulusNeuron ¶
type StimulusNeuron struct {
// contains filtered or unexported fields
}
This type of neuron handles stimulus type inputs, however, it can also handle interior/hidden type neurons.
func (*StimulusNeuron) AttachDendrite ¶
func (bc *StimulusNeuron) AttachDendrite(den IDendrite)
func (*StimulusNeuron) Diagnostics ¶
func (bc *StimulusNeuron) Diagnostics(msg string)
type StraightConnection ¶
type StraightConnection struct {
// contains filtered or unexported fields
}
StraightConnection has no delay. On each time mark data immediately appears on the output.
func (*StraightConnection) Input ¶
func (sc *StraightConnection) Input(b int)
Input ORs the data value to the connection
func (*StraightConnection) Output ¶
func (sc *StraightConnection) Output() int
func (*StraightConnection) Post ¶
func (sc *StraightConnection) Post()