spark.nn.components.somas

Contents

spark.nn.components.somas#

Submodules#

Classes#

Soma

Abstract soma model.

SomaOutput

Generic soma model output spec.

LeakySoma

Leaky soma model.

LeakySomaConfig

LeakySoma model configuration class.

RefractoryLeakySoma

Leaky soma with refractory time model.

RefractoryLeakySomaConfig

RefractoryLeakySoma model configuration class.

StrictRefractoryLeakySoma

Leaky soma with strict refractory time model.

StrictRefractoryLeakySomaConfig

StrictRefractoryLeakySoma model configuration class.

AdaptiveLeakySoma

Adaptive leaky soma model.

AdaptiveLeakySomaConfig

AdaptiveLeakySoma model configuration class.

ExponentialSoma

Exponential soma model.

ExponentialSomaConfig

ExponentialSoma model configuration class.

RefractoryExponentialSoma

Exponential soma with refractory time model.

RefractoryExponentialSomaConfig

RefractoryExponentialSoma model configuration class.

AdaptiveExponentialSoma

Adaptive Exponential soma model.

AdaptiveExponentialSomaConfig

AdaptiveExponentialSoma model configuration class.

SimplifiedAdaptiveExponentialSoma

Simplified Adaptive Exponential soma model. This model drops the subthreshold adaptation.

SimplifiedAdaptiveExponentialSomaConfig

SimplifiedAdaptiveExponentialSoma model configuration class.

IzhikevichSoma

Izhikevich soma model.

IzhikevichSomaConfig

IzhikevichSoma model configuration class.

Package Contents#

class spark.nn.components.somas.Soma(config=None, **kwargs)[source]#

Bases: spark.nn.components.base.Component, Generic[ConfigT]

Abstract soma model.

Parameters:

config (ConfigT | None)

config: ConfigT[source]#
build(input_specs)[source]#

Build method.

Parameters:

input_specs (dict[str, spark.core.specs.PortSpecs])

reset()[source]#

Resets neuron states to their initial values.

__call__(current)[source]#

Update neuron’s states and compute spikes.

Parameters:

current (spark.core.payloads.CurrentArray)

Return type:

SomaOutput

class spark.nn.components.somas.SomaOutput[source]#

Bases: TypedDict

Generic soma model output spec.

Initialize self. See help(type(self)) for accurate signature.

spikes: spark.core.payloads.SpikeArray[source]#
potential: spark.core.payloads.PotentialArray[source]#
class spark.nn.components.somas.LeakySoma(config=None, **kwargs)[source]#

Bases: spark.nn.components.somas.base.Soma

Leaky soma model.

Init:

units: tuple[int, …] potential_rest: float | jax.Array potential_reset: float | jax.Array potential_tau: float | jax.Array resistance: float | jax.Array threshold: float | jax.Array

Input:

in_spikes: SpikeArray

Output:

out_spikes: SpikeArray

Reference:

Neuronal Dynamics: From Single Neurons to Networks and Models of Cognition. Gerstner W, Kistler WM, Naud R, Paninski L. Chapter 1.3 Integrate-And-Fire Models https://neuronaldynamics.epfl.ch/online/Ch1.S3.html

Parameters:

config (LeakySomaConfig | None)

config: LeakySomaConfig[source]#
build(input_specs)[source]#

Build method.

Parameters:

input_specs (dict[str, spark.core.specs.PortSpecs])

Return type:

None

class spark.nn.components.somas.LeakySomaConfig(__skip_validation__=False, **kwargs)[source]#

Bases: spark.nn.components.somas.base.SomaConfig

LeakySoma model configuration class.

Parameters:

__skip_validation__ (bool)

potential_rest: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
potential_reset: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
potential_tau: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
resistance: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
threshold: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
class spark.nn.components.somas.RefractoryLeakySoma(config=None, **kwargs)[source]#

Bases: LeakySoma

Leaky soma with refractory time model.

Init:

units: tuple[int, …] potential_rest: float | jax.Array potential_reset: float | jax.Array potential_tau: float | jax.Array resistance: float | jax.Array threshold: float | jax.Array cooldown: float | jax.Array

Input:

in_spikes: SpikeArray

Output:

out_spikes: SpikeArray

Reference:

Neuronal Dynamics: From Single Neurons to Networks and Models of Cognition. Gerstner W, Kistler WM, Naud R, Paninski L. Chapter 1.3 Integrate-And-Fire Models https://neuronaldynamics.epfl.ch/online/Ch1.S3.html

Parameters:

config (RefractoryLeakySomaConfig | None)

config: RefractoryLeakySomaConfig[source]#
build(input_specs)[source]#

Build method.

Parameters:

input_specs (dict[str, spark.core.specs.PortSpecs])

Return type:

None

reset()[source]#

Resets component state.

Return type:

None

class spark.nn.components.somas.RefractoryLeakySomaConfig(__skip_validation__=False, **kwargs)[source]#

Bases: LeakySomaConfig

RefractoryLeakySoma model configuration class.

Parameters:

__skip_validation__ (bool)

cooldown: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
class spark.nn.components.somas.StrictRefractoryLeakySoma(config=None, **kwargs)[source]#

Bases: RefractoryLeakySoma

Leaky soma with strict refractory time model. Note: This model is here mostly for didactic/historical reasons.

Init:

units: tuple[int, …] potential_rest: float | jax.Array potential_reset: float | jax.Array potential_tau: float | jax.Array resistance: float | jax.Array threshold: float | jax.Array cooldown: float | jax.Array

Input:

in_spikes: SpikeArray

Output:

out_spikes: SpikeArray

Reference:

Neuronal Dynamics: From Single Neurons to Networks and Models of Cognition. Gerstner W, Kistler WM, Naud R, Paninski L. Chapter 1.3 Integrate-And-Fire Models https://neuronaldynamics.epfl.ch/online/Ch1.S3.html

Parameters:

config (RefractoryLeakySomaConfig | None)

config: StrictRefractoryLeakySomaConfig[source]#
class spark.nn.components.somas.StrictRefractoryLeakySomaConfig(__skip_validation__=False, **kwargs)[source]#

Bases: RefractoryLeakySomaConfig

StrictRefractoryLeakySoma model configuration class.

Parameters:

__skip_validation__ (bool)

class spark.nn.components.somas.AdaptiveLeakySoma(config=None, **kwargs)[source]#

Bases: RefractoryLeakySoma

Adaptive leaky soma model.

Init:

units: tuple[int, …] potential_rest: float | jax.Array potential_reset: float | jax.Array potential_tau: float | jax.Array resistance: float | jax.Array threshold: float | jax.Array cooldown: float | jax.Array threshold_tau: float | jax.Array threshold_delta: float | jax.Array

Input:

in_spikes: SpikeArray

Output:

out_spikes: SpikeArray

Reference:

Neuronal Dynamics: From Single Neurons to Networks and Models of Cognition. Gerstner W, Kistler WM, Naud R, Paninski L. Chapter 5.1 Thresholds in a nonlinear integrate-and-fire model https://neuronaldynamics.epfl.ch/online/Ch5.S1.html

Parameters:

config (AdaptiveLeakySomaConfig | None)

config: AdaptiveLeakySomaConfig[source]#
build(input_specs)[source]#

Build method.

Parameters:

input_specs (dict[str, spark.core.specs.PortSpecs])

Return type:

None

reset()[source]#

Resets component state.

Return type:

None

class spark.nn.components.somas.AdaptiveLeakySomaConfig(__skip_validation__=False, **kwargs)[source]#

Bases: RefractoryLeakySomaConfig

AdaptiveLeakySoma model configuration class.

Parameters:

__skip_validation__ (bool)

threshold_tau: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
threshold_delta: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
class spark.nn.components.somas.ExponentialSoma(config=None, **kwargs)[source]#

Bases: spark.nn.components.somas.base.Soma

Exponential soma model.

Init:

units: tuple[int, …] potential_rest: float | jax.Array potential_reset: float | jax.Array potential_tau: float | jax.Array resistance: float | jax.Array threshold: float | jax.Array

Input:

in_spikes: SpikeArray

Output:

out_spikes: SpikeArray

Reference:

How Spike Generation Mechanisms Determine the Neuronal Response to Fluctuating Inputs Nicolas Fourcaud-Trocmé, David Hansel, Carl van Vreeswijk, and Nicolas Brunel The Journal of Neuroscience, December 17, 2003 https://www.jneurosci.org/content/23/37/11628 Neuronal Dynamics: From Single Neurons to Networks and Models of Cognition. Gerstner W, Kistler WM, Naud R, Paninski L. Chapter 5.2 Exponential Integrate-and-Fire Model https://neuronaldynamics.epfl.ch/online/Ch5.S2.html

Parameters:

config (ExponentialSomaConfig | None)

config: ExponentialSomaConfig[source]#
build(input_specs)[source]#

Build method.

Parameters:

input_specs (dict[str, spark.core.specs.PortSpecs])

Return type:

None

class spark.nn.components.somas.ExponentialSomaConfig(__skip_validation__=False, **kwargs)[source]#

Bases: spark.nn.components.somas.base.SomaConfig

ExponentialSoma model configuration class.

Parameters:

__skip_validation__ (bool)

potential_rest: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
potential_reset: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
potential_tau: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
resistance: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
threshold: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
rheobase_threshold: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
spike_slope: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
class spark.nn.components.somas.RefractoryExponentialSoma(config=None, **kwargs)[source]#

Bases: ExponentialSoma

Exponential soma with refractory time model.

Init:

units: tuple[int, …] potential_rest: float | jax.Array potential_reset: float | jax.Array potential_tau: float | jax.Array resistance: float | jax.Array threshold: float | jax.Array cooldown: float | jax.Array

Input:

in_spikes: SpikeArray

Output:

out_spikes: SpikeArray

Reference:

How Spike Generation Mechanisms Determine the Neuronal Response to Fluctuating Inputs Nicolas Fourcaud-Trocmé, David Hansel, Carl van Vreeswijk, and Nicolas Brunel The Journal of Neuroscience, December 17, 2003 https://www.jneurosci.org/content/23/37/11628 Neuronal Dynamics: From Single Neurons to Networks and Models of Cognition. Gerstner W, Kistler WM, Naud R, Paninski L. Chapter 5.2 Exponential Integrate-and-Fire Model https://neuronaldynamics.epfl.ch/online/Ch5.S2.html

Parameters:

config (RefractoryExponentialSomaConfig | None)

config: RefractoryExponentialSomaConfig[source]#
build(input_specs)[source]#

Build method.

Parameters:

input_specs (dict[str, spark.core.specs.PortSpecs])

Return type:

None

reset()[source]#

Resets component state.

Return type:

None

class spark.nn.components.somas.RefractoryExponentialSomaConfig(__skip_validation__=False, **kwargs)[source]#

Bases: ExponentialSomaConfig

RefractoryExponentialSoma model configuration class.

Parameters:

__skip_validation__ (bool)

cooldown: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
class spark.nn.components.somas.AdaptiveExponentialSoma(config=None, **kwargs)[source]#

Bases: ExponentialSoma

Adaptive Exponential soma model.

Init:

units: tuple[int, …] potential_rest: float | jax.Array potential_reset: float | jax.Array potential_tau: float | jax.Array resistance: float | jax.Array threshold: float | jax.Array cooldown: float | jax.Array threshold_tau: float | jax.Array threshold_delta: float | jax.Array

Input:

in_spikes: SpikeArray

Output:

out_spikes: SpikeArray

Reference:

Adaptive Exponential Integrate-and-Fire Model as an Effective Description of Neuronal Activity. Romain Brette and Gerstner Wulfram Gerstner W, Kistler WM, Naud R, Paninski L. Journal of Neurophysiology vol. 94, no. 5, pp. 3637-3642, 2005 https://doi.org/10.1152/jn.00686.2005 Neuronal Dynamics: From Single Neurons to Networks and Models of Cognition. Gerstner W, Kistler WM, Naud R, Paninski L. Chapter 5.2 Exponential Integrate-and-Fire Model https://neuronaldynamics.epfl.ch/online/Ch5.S2.html

Parameters:

config (AdaptiveExponentialSomaConfig | None)

config: AdaptiveExponentialSomaConfig[source]#
build(input_specs)[source]#

Build method.

Parameters:

input_specs (dict[str, spark.core.specs.PortSpecs])

Return type:

None

reset()[source]#

Resets neuron states to their initial values.

class spark.nn.components.somas.AdaptiveExponentialSomaConfig(__skip_validation__=False, **kwargs)[source]#

Bases: ExponentialSomaConfig

AdaptiveExponentialSoma model configuration class.

Parameters:

__skip_validation__ (bool)

adaptation_tau: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
adaptation_delta: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
adaptation_subthreshold: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
class spark.nn.components.somas.SimplifiedAdaptiveExponentialSoma(config=None, **kwargs)[source]#

Bases: RefractoryExponentialSoma

Simplified Adaptive Exponential soma model. This model drops the subthreshold adaptation.

Init:

units: tuple[int, …] potential_rest: float | jax.Array potential_reset: float | jax.Array potential_tau: float | jax.Array resistance: float | jax.Array threshold: float | jax.Array cooldown: float | jax.Array threshold_tau: float | jax.Array threshold_delta: float | jax.Array

Input:

in_spikes: SpikeArray

Output:

out_spikes: SpikeArray

Reference:

Adaptive Exponential Integrate-and-Fire Model as an Effective Description of Neuronal Activity. Romain Brette and Gerstner Wulfram Gerstner W, Kistler WM, Naud R, Paninski L. Journal of Neurophysiology vol. 94, no. 5, pp. 3637-3642, 2005 https://doi.org/10.1152/jn.00686.2005 Neuronal Dynamics: From Single Neurons to Networks and Models of Cognition. Gerstner W, Kistler WM, Naud R, Paninski L. Chapter 5.2 Exponential Integrate-and-Fire Model https://neuronaldynamics.epfl.ch/online/Ch5.S2.html

Parameters:

config (SimplifiedAdaptiveExponentialSomaConfig | None)

config: SimplifiedAdaptiveExponentialSomaConfig[source]#
build(input_specs)[source]#

Build method.

Parameters:

input_specs (dict[str, spark.core.specs.PortSpecs])

Return type:

None

reset()[source]#

Resets component state.

Return type:

None

class spark.nn.components.somas.SimplifiedAdaptiveExponentialSomaConfig(__skip_validation__=False, **kwargs)[source]#

Bases: RefractoryExponentialSomaConfig

SimplifiedAdaptiveExponentialSoma model configuration class.

Parameters:

__skip_validation__ (bool)

threshold_tau: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
threshold_delta: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
class spark.nn.components.somas.IzhikevichSoma(config=None, **kwargs)[source]#

Bases: spark.nn.components.somas.base.Soma

Izhikevich soma model.

Init:

units: tuple[int, …] potential_rest: float | jax.Array potential_reset: float | jax.Array resistance: float | jax.Array threshold: float | jax.Array recovery_timescale: float | jax.Array recovery_sensitivity: float | jax.Array recovery_update: float | jax.Array

Input:

in_spikes: SpikeArray

Output:

out_spikes: SpikeArray

Reference:

Simple Model of Spiking Neurons Eugene M. Izhikevich IEEE Transactions on Neural Networks, vol. 14, no. 6, pp. 1569-1572, Nov. 2003 https://doi.org/10.1109/TNN.2003.820440

Parameters:

config (IzhikevichSomaConfig | None)

config: IzhikevichSomaConfig[source]#
build(input_specs)[source]#

Build method.

Parameters:

input_specs (dict[str, spark.core.specs.PortSpecs])

Return type:

None

reset()[source]#

Resets component state.

Return type:

None

class spark.nn.components.somas.IzhikevichSomaConfig(__skip_validation__=False, **kwargs)[source]#

Bases: spark.nn.components.somas.base.SomaConfig

IzhikevichSoma model configuration class.

Parameters:

__skip_validation__ (bool)

potential_rest: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
potential_reset: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
resistance: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
threshold: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
recovery_timescale: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
recovery_sensitivity: float | jax.Array | spark.nn.initializers.base.Initializer[source]#
recovery_update: float | jax.Array | spark.nn.initializers.base.Initializer[source]#