ml_genn package
- class ml_genn.Connection(source, target, connectivity, synapse='delta', name=None, add_to_model=True)
Bases:
objectA 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
sourcetotarget.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)
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:
objectAn input layer for a
SequentialNetwork- Variables:
population – weak reference to underlying
Populationobject.connection – weak reference to underlying
Connectionobject.
- 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.SpikeRecorderwith this layer.record_spike_events (bool) – Should spike-like events from this layer be recorded? This is required to use
callbacks.SpikeRecorderwith 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, name=None)
Bases:
objectAn layer for a
SequentialNetwork- Variables:
population – weak reference to underlying
Populationobject.- 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.SpikeRecorderwith this layer.record_spike_events (bool) – Should spike-like events from this layer be recorded? This is required to use
callbacks.SpikeRecorderwith this layer.name (str | None) – Name of layer (only really used for debugging purposes)
- class ml_genn.Network(default_params={})
Bases:
objectUnstructured 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:
objectA 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:
NetworkFeedforward 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
- ml_genn.callbacks package
- ml_genn.communicators package
- ml_genn.compilers package
- ml_genn.connectivity package
- ml_genn.initializers package
- ml_genn.losses package
- ml_genn.metrics package
- ml_genn.neurons package
- ml_genn.optimisers package
- ml_genn.readouts package
- ml_genn.serialisers package
- ml_genn.synapses package
- ml_genn.utils package
- Submodules
- ml_genn.utils.callback_list module
CallbackListCallbackList.get_data()CallbackList.on_batch_begin()CallbackList.on_batch_end()CallbackList.on_epoch_begin()CallbackList.on_epoch_end()CallbackList.on_test_begin()CallbackList.on_test_end()CallbackList.on_timestep_begin()CallbackList.on_timestep_end()CallbackList.on_train_begin()CallbackList.on_train_end()
- ml_genn.utils.connectivity module
- ml_genn.utils.data module
- ml_genn.utils.decorators module
- ml_genn.utils.filter module
- ml_genn.utils.model module
CustomUpdateModelModelNeuronModelNeuronModel.add_additional_input_var()NeuronModel.append_reset_code()NeuronModel.append_sim_code()NeuronModel.from_val_descriptors()NeuronModel.output_varNeuronModel.prepend_reset_code()NeuronModel.prepend_sim_code()NeuronModel.replace_reset_code()NeuronModel.replace_sim_code()NeuronModel.replace_threshold_condition_code()
SynapseModelWeightUpdateModelWeightUpdateModel.add_post_neuron_var_ref()WeightUpdateModel.add_pre_neuron_var_ref()WeightUpdateModel.append_pre_event_syn_code()WeightUpdateModel.append_pre_spike_syn_code()WeightUpdateModel.append_synapse_dynamics()WeightUpdateModel.process()WeightUpdateModel.reset_post_varsWeightUpdateModel.reset_pre_vars
- ml_genn.utils.module module
- ml_genn.utils.network module
- ml_genn.utils.snippet module
- ml_genn.utils.value module