ml_genn package

class ml_genn.Connection(source, target, connectivity, synapse='delta', name=None, max_delay_steps=None, add_to_model=True)

Bases: object

A connection between two populations

Variables:
  • connectivity – Type of connectivity to connect populations

  • synapse – What type of synapse dynamics to apply to input delivered via this connection

  • name – Name of connection (only really used for debugging purposes)

Parameters:
  • source (Population) – Source population to connect

  • target (Population) – Target population to connect

  • connectivity (Connectivity | str) – Connectivity to connect source to target.

  • synapse (Synapse | str) – What type of synapse dynamics to apply to input delivered via this connection

  • name (str | None) – Name of connection (only used for debugging purposes)

  • max_delay_steps (int | None) – Maximum number of delay steps this connection supports. Only required when learning delays or using heterogeneous delay initialiser from which maximum delay cannot be inferred

  • add_to_model (bool)

property source

Source population

property target

Target population

class ml_genn.InputLayer(neuron, shape=None, record_spikes=False, record_spike_events=False, name=None)

Bases: object

An input layer for a SequentialNetwork

Variables:

population – weak reference to underlying Population object.

Parameters:
  • neuron (Neuron | str) – Neuron model to use (typically derived from neuron_models.Input)

  • shape (None | int | Sequence[int]) – Shape of layer

  • record_spikes (bool) – Should spikes from this layer be recorded? This is required to use callbacks.SpikeRecorder with this layer.

  • record_spike_events (bool) – Should spike-like events from this layer be recorded? This is required to use callbacks.SpikeRecorder with this layer.

  • name (str | None) – Name of layer (only really used for debugging purposes)

class ml_genn.Layer(connectivity, neuron, shape=None, synapse='delta', record_spikes=False, record_spike_events=False, max_delay_steps=None, name=None)

Bases: object

An layer for a SequentialNetwork

Variables:

population – weak reference to underlying Population object.

Parameters:
  • connectivity (Connectivity | str) – Connectivity to connect layer to previous

  • neuron (Neuron | str) – Neuron model to use

  • synapse (Synapse | str) – What type of synapse dynamics to apply to input delivered to this layers neurons

  • shape (None | int | Sequence[int]) – Shape of layer

  • record_spikes (bool) – Should spikes from this layer be recorded? This is required to use callbacks.SpikeRecorder with this layer.

  • record_spike_events (bool) – Should spike-like events from this layer be recorded? This is required to use callbacks.SpikeRecorder with this layer.

  • name (str | None) – Name of layer (only really used for debugging purposes)

  • max_delay_steps (int | None) – Maximum number of delay steps this connection supports. Only required when learning delays or using heterogeneous delay initialiser from which maximum delay cannot be inferred

class ml_genn.Network(default_params={})

Bases: object

Unstructured network model

Variables:
  • populations – List of all populations in network

  • connections – List of all connections in network

Parameters:

default_params (dict) – Default parameters to use for neuron and synapse models created within the scope of this network. These are typically provided by the compiler.

static get_default_params(type)
load(keys=(), serialiser='numpy')

Load network state from checkpoints

Parameters:
  • keys (Tuple) – tuple of keys used to select correct checkpoint. Typically might contain epoch number or configuration.

  • serialiser (Serialiser | str) – Serialiser to load checkpoints with (should be the same type of serialiser which was used to create them)

class ml_genn.Population(neuron, shape=None, record_spikes=False, record_spike_events=False, name=None, add_to_model=True)

Bases: object

A population of neurons

Variables:
  • shape – Shape of population

  • name – Name of connection (only really used for debugging purposes)

  • record_spikes – Should spikes from this population be recorded? This is required to subsequently attach SpikeRecorder callbacks to this population

Parameters:
  • neuron (Neuron | str)

  • shape (None | int | Sequence[int])

  • record_spikes (bool)

  • record_spike_events (bool)

  • name (str | None)

  • add_to_model (bool)

property incoming_connections: List[Connection]

Incoming connections to this population

property neuron: Neuron

The neuron model to use for this population

Can be specified as either a Neuron object or, for built in neuron models whose constructors require no arguments, a string e.g. “leaky_integrate_fire”

property outgoing_connections: List[Connection]

Outgoing connections fromt his population

class ml_genn.SequentialNetwork(default_params={})

Bases: Network

Feedforward network model

Variables:

layers – List of all layers in network

Parameters:

default_params (dict) – Default parameters to use for neuron and synapse models created within the scope of this network. These are typically provided by the compiler.

static get_prev_layer()

Subpackages