superneuromat.SNN.delete_neurons#
- SNN.delete_neurons(neuron_ids: list[int] | list[Neuron], reindex: bool = True)[source]#
Deletes neurons from the network.
Because neurons and synapses are stored in the SNN as lists of parameters, deleting neurons may cause shifts in the indices of other neurons and synapses. If you are manually modifying the lists of neuron or synapse parameters, you may find it hard to keep track of what’s what.
However, if you use
Neuron
s andSynapse
s, orNeuronListView
s andSynapseListView
s, then the shift in indices will be automatically handled, and those objects will reflect the new indices while still referring to the same neurons and synapses that you’d expect.- Parameters:
neuron_ids (list[int] | list[Neuron]) – The IDs of the neurons to delete.
- Returns:
Returns
(neuron_mapping, synapse_mapping)
, whereneuron_mapping
is a mapping of neuron IDs from{before: after}
the neurons were deleted, andsynapse_mapping
is a mapping of synaptic IDs from{before: after}
the neurons were deleted.- Return type: