superneuroabm package

Subpackages

Submodules

superneuroabm.model module

Model class for building an SNN

class superneuroabm.model.NeuromorphicModel(neuron_breed_info: ~typing.Dict[str, ~typing.List[~typing.Callable]] = {'Neuron': [<function neuron_step_func>, <function synapse_step_func>]})

Bases: Model

add_spike(neuron_id: int, tick: int, value: float) None

Schedules an external input spike to this Neuron.

Parameters:
  • tick – tick at which spike should be triggered

  • value – spike value

create_neuron(breed: str = 'Neuron', threshold: float = 1, reset_state: float = 0, leak: float = 0, refractory_period: int = 0, axonal_delay: int = 1) int

Creates and Neuron agent.

Returns:

SAGESim agent id of neuron

create_synapse(pre_neuron_id: int, post_neuron_id: int, weight: int = 1, synaptic_delay: int = 1, synapse_learning_params: List[float] | None = None) None

Creates and adds Synapse agent.

Parameters:
  • pre_neuron_id – int presynaptic neuron id

  • post_neuron_id – int postsynaptic neuron id

  • weight – weight of synapse

  • delay (synaptic) – number of timesteps to delay synapse by

  • synapse_learning_params – Optional. Any parameters used in a learning enabled step function. Must be specified in order of use in step function.

get_spike_times(neuron_id: int) array
load(fpath: str)

Loads model from pickle file.

Parameters:

fpath – file path to pickle file.

save(fpath: str)

Saves model. Must be overridden if additional data pertaining to application must be saved.

Parameters:
  • fpath – file path to save pickle file at

  • app_data – additional application data to be saved.

setup(use_cuda: bool = False, output_buffer_len: int = 1000, retain_weights=False) None

Resets the simulation and initializes agents.

Parameters:

retain_weights – False by default. If True, updated weights are not reset upon setup.

simulate(ticks: int, update_data_ticks: int = 1, num_cpu_proc: int = 4) None

Override of superneuroabm.core.model mainly to register an AgentDataCollector to monitor marked output Neurons.

summary() str

Verbose summary of the network structure.

Returns:

str information of netowkr struture

update_synapse(pre_neuron_id: int, post_neuron_id: int, weight: int | None = None, synapse_learning_params: List[float] | None = None)

superneuroabm.neuron module

Neuron and synapse step functions for spiking neural networks

superneuroabm.neuron.neuron_step_func(global_data_vector, breeds, thresholds, reset_states, leaks, refractory_periods, output_synapsess, t_elapses, internal_state, neuron_delay_regs, input_spikess, output_synapses_learning_paramss, output_spikess, my_idx)
superneuroabm.neuron.synapse_step_func(global_data_vector, breeds, thresholds, reset_states, leaks, refractory_periods, output_synapsess, t_elapses, internal_state, neuron_delay_regs, input_spikess, output_synapses_learning_paramss, output_spikess, my_idx)
superneuroabm.neuron.synapse_with_stdp_step_func(global_data_vector, breeds, thresholds, reset_states, leaks, refractory_periods, output_synapsess, t_elapses, internal_state, neuron_delay_regs, input_spikess, output_synapses_learning_paramss, output_spikess, my_idx)

Module contents