spark.core.payloads#

Classes#

SparkPayload

Abstract payload definition to validate exchanges between SparkModule's.

SpikeArray

Representation of a collection of spike events.

ValueSparkPayload

Abstract payload definition to single value payloads.

CurrentArray

Representation of a collection of currents.

PotentialArray

Representation of a collection of membrane potentials.

BooleanMask

Representation of an inhibitory boolean mask.

IntegerMask

Representation of an integer mask.

FloatArray

Representation of a float array.

IntegerArray

Representation of an integer array.

Module Contents#

class spark.core.payloads.SparkPayload[source]#

Bases: abc.ABC

Abstract payload definition to validate exchanges between SparkModule’s.

tree_flatten()[source]#
Return type:

tuple[tuple[jax.Array], None]

classmethod tree_unflatten(aux_data, children)[source]#
Return type:

Self

property shape: Any[source]#
Return type:

Any

property dtype: Any[source]#
Return type:

Any

class spark.core.payloads.SpikeArray(spikes, inhibition_mask=False, async_spikes=False)[source]#

Bases: SparkPayload

Representation of a collection of spike events.

Init:

spikes: jax.Array[bool], True if neuron spiked, False otherwise inhibition_mask: jax.Array[bool], True if neuron is inhibitory, False otherwise

The async_spikes flag is automatically set True by delay mechanisms that perform neuron-to-neuron specific delays. Note that when async_spikes is True the shape of the spikes changes from (origin_units,) to (origin_units, target_units). This is important when implementing new synaptic models, since fully valid synaptic models should be able to handle both cases.

Parameters:
async_spikes: bool = False[source]#
tree_flatten()[source]#
Return type:

tuple[tuple, tuple]

classmethod tree_unflatten(aux_data, children)[source]#
Return type:

Self

__jax_array__()[source]#
Return type:

jax.numpy.ndarray

__array__(dtype=None)[source]#
Return type:

numpy.ndarray

property spikes: jax.Array[source]#
Return type:

jax.Array

property inhibition_mask: jax.Array[source]#
Return type:

jax.Array

property value: jax.Array[source]#
Return type:

jax.Array

property shape: tuple[int, Ellipsis][source]#
Return type:

tuple[int, Ellipsis]

property dtype: jax.typing.DTypeLike[source]#
Return type:

jax.typing.DTypeLike

class spark.core.payloads.ValueSparkPayload[source]#

Bases: SparkPayload, abc.ABC

Abstract payload definition to single value payloads.

value: jax.numpy.ndarray[source]#
__jax_array__()[source]#
Return type:

jax.numpy.ndarray

__array__(dtype=None)[source]#
Return type:

numpy.ndarray

tree_flatten()[source]#
Return type:

tuple[tuple, tuple]

classmethod tree_unflatten(aux_data, children)[source]#
Return type:

Self

property shape: tuple[int, Ellipsis][source]#
Return type:

tuple[int, Ellipsis]

property dtype: jax.typing.DTypeLike[source]#
Return type:

jax.typing.DTypeLike

class spark.core.payloads.CurrentArray[source]#

Bases: ValueSparkPayload

Representation of a collection of currents.

class spark.core.payloads.PotentialArray[source]#

Bases: ValueSparkPayload

Representation of a collection of membrane potentials.

class spark.core.payloads.BooleanMask[source]#

Bases: ValueSparkPayload

Representation of an inhibitory boolean mask.

class spark.core.payloads.IntegerMask[source]#

Bases: ValueSparkPayload

Representation of an integer mask.

class spark.core.payloads.FloatArray[source]#

Bases: ValueSparkPayload

Representation of a float array.

class spark.core.payloads.IntegerArray[source]#

Bases: ValueSparkPayload

Representation of an integer array.