Neurons
A neuron in SpikingNN is compromised of a soma (cell body) and vector of synapses (dendrites), much like a biological neuron. The soma itself is broken into the cell and threshold function. Beyond making SpikingNN flexible and extensible, this breakdown of a neuron into parts allows for efficient evaluation.
A Neuron
can be simulated with simulate!
.
SpikingNN.simulate!
— Methodsimulate!(neuron::Neuron, T::Integer; dt::Real = 1.0, cb = () -> (), dense = false)
Fields:
neuron::Neuron
: the neuron to simulateT::Integer
: number of time steps to simulatedt::Real
: the length of simulation time stepcb::Function
: a callback function that is called at the start of each time stepdense::Bool
: set totrue
to evaluate every time step even in the absence of events
Soma
A Soma
is made up of a cell body (found in Neuron Models) and theshold function (found in Threshold Models).
SpikingNN.Soma
— TypeSoma{BT<:AbstractCell, TT<:AbstractThreshold}
A Soma
is a cell body + a threshold.
SpikingNN.excite!
— Methodexcite!(soma, current)
Inject current
into soma.body
.
SpikingNN.evaluate!
— Methodevaluate!(soma::Soma, t::Integer; dt::Real = 1.0)
(::Soma)(t::Integer; dt::Real = 1.0)
evaluate!(somas::AbstractArray{<:Soma}, t::Integer; dt::Real = 1.0)
Evaluate the soma's cell body, decide whether to spike according to the threshold, then register the spike event with the cell body. Return the spike event (0 for no spike or t
for a spike).
SpikingNN.reset!
— Methodreset!(soma::T) where T<:Union{Soma, AbstractArray{<:Soma}}
Reset soma.body
.
Neuron
Neurons are the smallest simulated block in SpikingNN.
SpikingNN.Neuron
— TypeNeuron{ST<:AbstractArray{<:AbstractSynapse}, CT<:Soma}
A Neuron
is a vector of synapses feeding into a soma.
SpikingNN.connect!
— Methodconnect!(neuron::Neuron, synapse::AbstractSynapse)
Connect synapse
into neuron
.
SpikingNN.getvoltage
— Methodgetvoltage(neuron::Neuron)
Get the current membrane potential of neuron.soma
.
SpikingNN.excite!
— Methodexcite!(neuron::Neuron, spike::Integer)
excite!(neuron::Neuron, spikes::Array{<:Integer})
excite!(neuron::Neuron, input, T::Integer; dt::Real = 1.0)
Excite a neuron
's synapses with spikes. Or excite a neuron
's synapses with an arbitrary input
function evaluated from 1:T
. input
must satisfy the following signature: input(t; dt)
.
SpikingNN.evaluate!
— Methodevaluate!(neuron::Neuron, t::Integer; dt::Real = 1.0)
(::Neuron)(t::Integer; dt::Real = 1.0)
Evaluate a neuron at time t
by evaluating all its synapses, exciting the soma with current, then registering post-synaptic spikes with the synapses. Return the spike event (0 for no spike or t
for spike).
SpikingNN.reset!
— Methodreset!(neuron::T) where T<:Union{Neuron, AbstractArray{<:Neuron}}
Reset neuron.synapses
and neuron.soma
.