Inputs
SpikingNN provides several synthetic inputs:
- constant rate
- step current
- inhomogenous Poisson process
Inputs can also form a InputPopulation
that behaves similar to a Population
.
Constant Rate
A constant rate input fires at a fixed frequency.
SpikingNN.ConstantRate
— TypeConstantRate(rate::Real)
ConstantRate{T}(rate::Real)
ConstantRate(freq::Real, dt::Real)
Create a constant rate input where the probability a spike occurs is Bernoulli(rate
). rate-coded neuron firing at a fixed rate. Alternatively, specify freq
in Hz at a simulation time step of dt
.
SpikingNN.evaluate!
— Methodevaluate!(input::ConstantRate, t::Integer; dt::Real = 1.0)
(::ConstantRate)(t::Integer; dt::Real = 1.0)
evaluate!(inputs::AbstractArray{<:ConstantRate}, t::Integer; dt::Real = 1.0)
Evaluate a constant rate-code input at time t
.
Step Current
A step current input is low until a fixed time step, then it is high.
SpikingNN.StepCurrent
— TypeStepCurrent(τ::Real)
Create a step current input that turns on at time τ
seconds.
SpikingNN.evaluate!
— Methodevaluate!(input::StepCurrent, t::Integer; dt::Real = 1.0)
(::StepCurrent)(t::Integer; dt::Real = 1.0)
evaluate!(inputs::AbstractArray{<:StepCurrent}, t::Integer; dt::Real = 1.0)
Evaluate a step current input at time t
.
Inhomogenous Poisson Input Process
An input that behaves like an inhomogenous Poisson process given by a provided instantaneous rate function.
SpikingNN.PoissonInput
— TypePoissonInput(ρ₀::Real, λ::Function)
Create a inhomogenous Poisson input function according to
$X < \mathrm{d}t \rho_0 \lambda(t)$
where $X \sim \mathrm{Unif}([0, 1])$. Note that dt
must be appropriately specified to ensure correct behavior.
Fields:
ρ₀::Real
: baseline firing rateλ::(Integer; dt::Integer) -> Real
: a function that returns the instantaneous firing rate at timet
SpikingNN.evaluate!
— Methodevaluate!(input::PoissonInput, t::Integer; dt::Real = 1.0)
(::PoissonInput)(t::Integer; dt::Real = 1.0)
evaluate!(inputs::AbstractArray{<:PoissonInput}, t::Integer; dt::Real = 1.0)
Evaluate a inhomogenous Poisson input at time t
.
Input Population
SpikingNN.InputPopulation
— TypeInputPopulation{IT<:StructArray{<:AbstractInput}}
An InputPopulation
is a population of AbstractInput
s.
SpikingNN.evaluate!
— Methodevaluate!(pop::InputPopulation, t::Integer; dt::Real = 1.0)
(::InputPopulation)(t::Integer; dt::Real = 1.0)
Evaluate a population of inputs at time t
.