BinomialSynapses.jl

Models

BinomialSynapses.AbstractBinomialModelType
AbstractBinomialModel

An abstract type for binomial synaptic models. A binomial model always has the following parameters:

  • N: number of release sites
  • p: probability of release
  • q: quantum of release
  • σ: observation noise
  • τ: refilling time constant
BinomialSynapses.BinomialGridModelType
BinomialGridModel(
    Nind, pind, qind, σind, τind,
    Nrng, prng, qrng, σrng, τrng,
    N,    p,    q,    σ,    τ
   )

A binomial model ensemble whose parameters are constrained to live on a grid defined by Nrng, prng, etc.

BinomialSynapses.BinomialGridModelMethod
BinomialGridModel(
    Nind, pind, qind, σind, τind,
    Nrng, prng, qrng, σrng, τrng
)

Construct a binomial model ensemble with parameters on a grid, e.g. Nrng, based on choosing indices, e.g. Nind.

BinomialSynapses.BinomialGridModelMethod
BinomialGridModel(m_out, my_Nrng, my_prng, my_qrng, my_σrng, my_τrng, device = :gpu)

Randomly initialize a binomial model ensemble with parameters uniformly sampled from the specified grid (on the GPU).

Missing docstring.

Missing docstring for BinomialModel(Nmax::Integer, m_out::Integer, device::Symbol = :gpu). Check Documenter's build log for details.

BinomialSynapses.BinomialModelMethod
BinomialModel(m_out, my_Nrng, my_prng, my_qrng, my_σrng, my_τrng)

Randomly initialize a binomial model ensemble on a grid, but throw away the grid info and just keep the parameters.

BinomialSynapses.ScalarBinomialModelFunction
ScalarBinomialModel(Nmax, device = :cpu)

Randomly initialize a model ensemble of size 1, which corresponds to a scalar model (used for the hidden state).

ScalarBinomialModel(N, p, q, σ, τ, device = :cpu)

Initialize a scalar binomial model with the given parameters.

Missing docstring.

Missing docstring for BinomialState(Nmax::Integer, m_out::Integer, m_in::Integer, device::Symbol = :gpu). Check Documenter's build log for details.

BinomialSynapses.ScalarBinomialStateFunction
ScalarBinomialState(Nmax, device = :cpu)

Randomly initialize a state ensemble of size 1, which corresponds to a scalar model (used for the hidden state).

ScalarBinomialState(n, k, device = :cpu)

Initialize a scalar state with the specified values of the variables.

BinomialSynapses.propagate!Method
propagate!(state, model, dt)

Propagate state forward according to the model, given a time step dt.

BinomialSynapses.emitFunction
emit(state, model, timestep)

Return a BinomialObservation based on the current state and model, after a speficied time step timestep.

emit(sim, dt)

Emit an EPSP after time step dt.

Time steps

BinomialSynapses.TimestepType
Timestep

An abstract type specifying the way a time step is chosen. The following basic types are supported:

  • FixedTimestep: a constant, fixed number is used
  • RandomTimestep: the time step is random from a fixed distribution
  • OEDPolicy: an optimal time step is chosen based on some objective function
BinomialSynapses.RandomTimestepType
RandomTimestep(dist)

Choose a random time step from distribution dist. There must be an implementation of rand for typeof(dist).

Particle Filter

BinomialSynapses.NestedParticleStateType
NestedParticleState(state, model)

Construct a particle system (ensemble) consisting of a state ensemble (inner and outer particles) and a model ensemble (outer particles).

BinomialSynapses.NestedParticleStateMethod
NestedParticleState(
    m_out, m_in, 
    my_Nrng, my_prng, my_qrng, my_σrng, my_τrng, 
    device = :gpu
)

Construct a randomly initialized particle system with a given number of outer (m_out) and inner (m_in) particles and specified grids for the parameters.

BinomialSynapses.update!Method
update!(filterstate, obs, filter)

Update the particle filter state based on a given observation and filter.

BinomialSynapses.jitter!Function
jitter!(model::BinomialGridModel, width)

Apply jitter with parameter width to the indices of a binomial model on a grid.

BinomialSynapses.likelihoodFunction
likelihood(state, model::AbstractBinomialModel, obs)

Return the likelihood of an observation conditioned on the current state and model. This broadcasts properly over state and model ensemble, if they have compatible sizes.

BinomialSynapses.likelihood_resample!Function
likelihood_resample!(state, model::AbstractBinomialModel, obs)

Return the likelihood of an observation conditioned on the current state and model ensemble and at the same time resample the state ensemble (inner particles).

BinomialSynapses.outer_resample!Function
outer_resample!(state, model, u)

Resample the outer particles of the state and model ensemble based on their likelihoods u.

BinomialSynapses.indices!Function
indices!(v)

Return index table and total likelihoods from likelihood table v. This function modifies v; after execution, v will be the cumulative sum of the original v along the last dimension.

BinomialSynapses.resample!Function
resample!(state, idx)
resample!(model, idx)

Resample the outer particles of state or model ensembles based on index table idx.

OED

BinomialSynapses.OEDPolicyType
OEDPolicy <: Timestep

An abstract type for choosing time steps based on optimizing a given cost function. This is provided in order to do active inference.

BinomialSynapses.UniformType
Uniform(dts)

Randomly sample from a discrete set of time steps dts. This is equivalent to, but more convenient to use than RandomTimestep(dist) with dist a uniform distribution on dts.

BinomialSynapses.MyopicPolicyType
MyopicPolicy <: OEDPolicy

A myopic OEDPolicy, i.e. one in which only the effect of the next time step on the parameter estimation, e.g. the entropy of a parameter, is taken into account.

BinomialSynapses.MyopicType
Myopic(dts, target)

A parallel implementation of a myopic policy with candidate time steps dts and optimization target target, in which multiple copies of the particles are propagated in parallel.

Implemented settings of target: choose time step such that it

  • _entropy: minimizes the joint entropy of the posterior distribution over parameters
  • _tauentropy: minimizes the marginal entropy of τ
BinomialSynapses.MyopicFastType
MyopicFast(dts, target)

MyopicFastis the same asMyopic, except that instead of expanding states and parameters along another dimension, and propagating each parameter with each dt,dts` are randomly assigned to members of the parameter ensemble.

Implemented settings of target: choose time step such that it

  • _entropy: minimizes the joint entropy of the posterior distribution over parameters
  • _tauentropy: minimizes the marginal entropy of τ

Simulation

BinomialSynapses.NestedFilterSimulationType
NestedFilterSimulation(hmodel, filter, hstate, fstate, tsteps, times, epsps)

This object stores static (hmodel, filter, tsteps) and dynamic (hstate, fstate, tsteps, times, epsps) information about the simulation.

BinomialSynapses.propagate!Method
propagate!(sim)

Propagate the simulation, i.e. choose a time step and then propagate the simulation by it.

BinomialSynapses.run!Function
run!(
    sim; 
    T, 
    plot_each_timestep = false, 
    recording = NoRecording
)

Run a simulation for T time steps. Set plot_each_timestep = true to get a live update of the simulation (this will reduce performance) and set recording to collect data while running the simulation (see Recording).

BinomialSynapses.RecordingType
Recording(f1, f2, data)

A recording, which is stored in data. The function f1 is something that is computed at each time step, whereas f2 is an operation that is applied after the simulation is finished.