![]() |
GeNN
4.9.0
GPU enhanced Neuronal Networks (GeNN)
|
GeNNModel class This class helps to define, build and run a GeNN model from python. More...
Public Member Functions | |
| def | __init__ (self, precision="float", model_name="GeNNModel", backend=None, time_precision=None, genn_log_level=genn_wrapper.warning, code_gen_log_level=genn_wrapper.warning, backend_log_level=genn_wrapper.warning, preference_kwargs) |
| Init GeNNModel. More... | |
| def | use_backend (self) |
| def | use_backend (self, backend) |
| def | timing_enabled (self) |
| def | timing_enabled (self, timing) |
| def | batch_size (self) |
| def | batch_size (self, batch_size) |
| def | default_var_location (self) |
| Default variable location - defines where state variables are initialised. More... | |
| def | default_var_location (self, location) |
| def | default_sparse_connectivity_location (location) |
| Default sparse connectivity mode - where connectivity is initialised. More... | |
| def | default_sparse_connectivity_location (self, location) |
| def | model_name (self) |
| Name of the model. More... | |
| def | model_name (self, model_name) |
| def | t (self) |
| Simulation time in ms. More... | |
| def | t (self, t) |
| def | timestep (self) |
| Simulation time step. More... | |
| def | timestep (self, timestep) |
| def | free_device_mem_bytes (self) |
| def | dT (self) |
| Step size. More... | |
| def | dT (self, dt) |
| def | neuron_update_time (self) |
| def | init_time (self) |
| def | presynaptic_update_time (self) |
| def | postsynaptic_update_time (self) |
| def | synapse_dynamics_time (self) |
| def | init_sparse_time (self) |
| def | get_custom_update_time (self, name) |
| def | get_custom_update_transpose_time (self, name) |
| def | add_neuron_population (self, pop_name, num_neurons, neuron, param_space, var_space) |
| Add a neuron population to the GeNN model. More... | |
| def | add_synapse_population (self, pop_name, matrix_type, delay_steps, source, target, w_update_model, wu_param_space, wu_var_space, wu_pre_var_space, wu_post_var_space, postsyn_model, ps_param_space, ps_var_space, connectivity_initialiser=None) |
| Add a synapse population to the GeNN model. More... | |
| def | add_slave_synapse_population (self, pop_name, master_pop, delay_steps, source, target, postsyn_model, ps_param_space, ps_var_space) |
| Add a 'slave' population to the GeNN model which shares weights and connectivity with a 'master' population. More... | |
| def | add_current_source (self, cs_name, current_source_model, pop, param_space, var_space) |
| Add a current source to the GeNN model. More... | |
| def | add_custom_update (self, cu_name, group_name, custom_update_model, param_space, var_space, var_ref_space, egp_ref_space={}) |
| Add a current source to the GeNN model. More... | |
| def | build (self, path_to_model="./", force_rebuild=False) |
| Finalize and build a GeNN model. More... | |
| def | load (self, path_to_model="./", num_recording_timesteps=None) |
| import the model as shared library and initialize it More... | |
| def | unload (self) |
| def | reinitialise (self) |
| reinitialise model to its original state without re-loading More... | |
| def | step_time (self) |
| Make one simulation step. More... | |
| def | custom_update (self, name) |
| Perform custom update. More... | |
| def | pull_state_from_device (self, pop_name) |
| Pull state from the device for a given population. More... | |
| def | pull_spikes_from_device (self, pop_name) |
| Pull spikes from the device for a given population. More... | |
| def | pull_spike_events_from_device (self, pop_name) |
| Pull spike events from the device for a given population. More... | |
| def | pull_current_spikes_from_device (self, pop_name) |
| Pull spikes from the device for a given population. More... | |
| def | pull_current_spike_events_from_device (self, pop_name) |
| Pull spike events from the device for a given population. More... | |
| def | pull_connectivity_from_device (self, pop_name) |
| Pull connectivity from the device for a given population. More... | |
| def | pull_var_from_device (self, pop_name, var_name) |
| Pull variable from the device for a given population. More... | |
| def | pull_extra_global_param_from_device (self, pop_name, egp_name, size=None) |
| Pull extra global parameter from the device for a given population. More... | |
| def | push_state_to_device (self, pop_name) |
| Push state to the device for a given population. More... | |
| def | push_spikes_to_device (self, pop_name) |
| Push spikes to the device for a given population. More... | |
| def | push_spike_events_to_device (self, pop_name) |
| Push spike events to the device for a given population. More... | |
| def | push_current_spikes_to_device (self, pop_name) |
| Push current spikes to the device for a given population. More... | |
| def | push_current_spike_events_to_device (self, pop_name) |
| Push current spike events to the device for a given population. More... | |
| def | push_connectivity_to_device (self, pop_name) |
| Push connectivity to the device for a given population. More... | |
| def | push_var_to_device (self, pop_name, var_name) |
| Push variable to the device for a given population. More... | |
| def | push_extra_global_param_to_device (self, pop_name, egp_name, size=None) |
| Push extra global parameter to the device for a given population. More... | |
| def | pull_recording_buffers_from_device (self) |
| Pull recording buffers from device. More... | |
| def | end (self) |
| Free memory. More... | |
Public Attributes | |
| use_backend | |
| backend_log_level | |
| default_var_location | |
| model_name | |
| neuron_populations | |
| synapse_populations | |
| current_sources | |
| custom_updates | |
| dT | |
| genn_types | |
GeNNModel class This class helps to define, build and run a GeNN model from python.
| def pygenn.genn_model.GeNNModel.__init__ | ( | self, | |
precision = "float", |
|||
model_name = "GeNNModel", |
|||
backend = None, |
|||
time_precision = None, |
|||
genn_log_level = genn_wrapper.warning, |
|||
code_gen_log_level = genn_wrapper.warning, |
|||
backend_log_level = genn_wrapper.warning, |
|||
| preference_kwargs | |||
| ) |
Init GeNNModel.
| precision | string precision as string ("float", "double" or "long double"). defaults to float. |
| model_name | string name of the model. Defaults to "GeNNModel". |
| backend | string specifying name of backend module to use Defaults to None to pick 'best' backend for your system |
| time_precision | string time precision as string ("float", "double" or "long double"). defaults to float. |
| genn_log_level | Log level for GeNN |
| code_gen_log_level | Log level for GeNN code-generator |
| backend_log_level | Log level for backend |
| preference_kwargs | Additional keyword arguments to set in backend preferences structure |
| def pygenn.genn_model.GeNNModel.add_current_source | ( | self, | |
| cs_name, | |||
| current_source_model, | |||
| pop, | |||
| param_space, | |||
| var_space | |||
| ) |
Add a current source to the GeNN model.
| cs_name | name of the new current source |
| current_source_model | type of the CurrentSourceModels class as string or instance of CurrentSourceModels class derived from pygenn.genn_wrapper.CurrentSourceModels.Custom (see also pygenn.genn_model.create_custom_current_source_class) |
| pop | population into which the current source should be injected (either name or NeuronGroup object) |
| param_space | dict with param values for the CurrentSourceModels class |
| var_space | dict with initial variable values for the CurrentSourceModels class |
| def pygenn.genn_model.GeNNModel.add_custom_update | ( | self, | |
| cu_name, | |||
| group_name, | |||
| custom_update_model, | |||
| param_space, | |||
| var_space, | |||
| var_ref_space, | |||
egp_ref_space = {} |
|||
| ) |
Add a current source to the GeNN model.
| cu_name | name of the new current source |
| group_name | name of |
| custom_update_model | type of the CustomUpdateModel class as string or instance of CustomUpdateModel class derived from pygenn.genn_wrapper.CustomUpdateModel.Custom (see also pygenn.genn_model.create_custom_custom_update_class) |
| param_space | dict with param values for the CustomUpdateModel class |
| var_space | dict with initial variable values for the CustomUpdateModel class |
| var_ref_space | dict with variable references for the CustomUpdateModel class |
| egp_ref_space | dict with extra global parameter references for the CustomUpdateModel class |
| def pygenn.genn_model.GeNNModel.add_neuron_population | ( | self, | |
| pop_name, | |||
| num_neurons, | |||
| neuron, | |||
| param_space, | |||
| var_space | |||
| ) |
Add a neuron population to the GeNN model.
| pop_name | name of the new population |
| num_neurons | number of neurons in the new population |
| neuron | type of the NeuronModels class as string or instance of neuron class derived from pygenn.genn_wrapper.NeuronModels.Custom (see also pygenn.genn_model.create_custom_neuron_class) |
| param_space | dict with param values for the NeuronModels class |
| var_space | dict with initial variable values for the NeuronModels class |
| def pygenn.genn_model.GeNNModel.add_slave_synapse_population | ( | self, | |
| pop_name, | |||
| master_pop, | |||
| delay_steps, | |||
| source, | |||
| target, | |||
| postsyn_model, | |||
| ps_param_space, | |||
| ps_var_space | |||
| ) |
Add a 'slave' population to the GeNN model which shares weights and connectivity with a 'master' population.
| pop_name | name of the new population |
| master_pop | master synapse group to share weights with (either name or SynapseGroup object) |
| delay_steps | delay in number of steps |
| source | source neuron group (either name or NeuronGroup object) |
| target | target neuron group (either name or NeuronGroup object) |
| postsyn_model | type of the PostsynapticModels class as string or instance of postsynaptic model class derived from pygenn.genn_wrapper.PostsynapticModels.Custom (see also pygenn.genn_model.create_custom_postsynaptic_class) |
| ps_param_space | dict with param values for the PostsynapticModels class |
| ps_var_space | dict with initial variable values for the PostsynapticModels class |
| def pygenn.genn_model.GeNNModel.add_synapse_population | ( | self, | |
| pop_name, | |||
| matrix_type, | |||
| delay_steps, | |||
| source, | |||
| target, | |||
| w_update_model, | |||
| wu_param_space, | |||
| wu_var_space, | |||
| wu_pre_var_space, | |||
| wu_post_var_space, | |||
| postsyn_model, | |||
| ps_param_space, | |||
| ps_var_space, | |||
connectivity_initialiser = None |
|||
| ) |
Add a synapse population to the GeNN model.
| pop_name | name of the new population |
| matrix_type | type of the matrix as string |
| delay_steps | delay in number of steps |
| source | source neuron group (either name or NeuronGroup object) |
| target | target neuron group (either name or NeuronGroup object) |
| w_update_model | type of the WeightUpdateModels class as string or instance of weight update model class derived from pygenn.genn_wrapper.WeightUpdateModels.Custom (see also pygenn.genn_model.create_custom_weight_update_class) |
| wu_param_space | dict with param values for the WeightUpdateModels class |
| wu_var_space | dict with initial values for WeightUpdateModels state variables |
| wu_pre_var_space | dict with initial values for WeightUpdateModels presynaptic variables |
| wu_post_var_space | dict with initial values for WeightUpdateModels postsynaptic variables |
| postsyn_model | type of the PostsynapticModels class as string or instance of postsynaptic model class derived from pygenn.genn_wrapper.PostsynapticModels.Custom (see also pygenn.genn_model.create_custom_postsynaptic_class) |
| ps_param_space | dict with param values for the PostsynapticModels class |
| ps_var_space | dict with initial variable values for the PostsynapticModels class |
| connectivity_initialiser | InitSparseConnectivitySnippet::Init for connectivity |
| def pygenn.genn_model.GeNNModel.batch_size | ( | self | ) |
| def pygenn.genn_model.GeNNModel.batch_size | ( | self, | |
| batch_size | |||
| ) |
| def pygenn.genn_model.GeNNModel.build | ( | self, | |
path_to_model = "./", |
|||
force_rebuild = False |
|||
| ) |
Finalize and build a GeNN model.
| path_to_model | path where to place the generated model code. Defaults to the local directory. |
| force_rebuild | should model be rebuilt even if it doesn't appear to be required |
| def pygenn.genn_model.GeNNModel.custom_update | ( | self, | |
| name | |||
| ) |
Perform custom update.
| def pygenn.genn_model.GeNNModel.default_sparse_connectivity_location | ( | location | ) |
Default sparse connectivity mode - where connectivity is initialised.
| def pygenn.genn_model.GeNNModel.default_sparse_connectivity_location | ( | self, | |
| location | |||
| ) |
| def pygenn.genn_model.GeNNModel.default_var_location | ( | self | ) |
Default variable location - defines where state variables are initialised.
| def pygenn.genn_model.GeNNModel.default_var_location | ( | self, | |
| location | |||
| ) |
| def pygenn.genn_model.GeNNModel.dT | ( | self | ) |
Step size.
| def pygenn.genn_model.GeNNModel.dT | ( | self, | |
| dt | |||
| ) |
| def pygenn.genn_model.GeNNModel.end | ( | self | ) |
Free memory.
| def pygenn.genn_model.GeNNModel.free_device_mem_bytes | ( | self | ) |
| def pygenn.genn_model.GeNNModel.get_custom_update_time | ( | self, | |
| name | |||
| ) |
| def pygenn.genn_model.GeNNModel.get_custom_update_transpose_time | ( | self, | |
| name | |||
| ) |
| def pygenn.genn_model.GeNNModel.init_sparse_time | ( | self | ) |
| def pygenn.genn_model.GeNNModel.init_time | ( | self | ) |
| def pygenn.genn_model.GeNNModel.load | ( | self, | |
path_to_model = "./", |
|||
num_recording_timesteps = None |
|||
| ) |
import the model as shared library and initialize it
| def pygenn.genn_model.GeNNModel.model_name | ( | self | ) |
Name of the model.
| def pygenn.genn_model.GeNNModel.model_name | ( | self, | |
| model_name | |||
| ) |
| def pygenn.genn_model.GeNNModel.neuron_update_time | ( | self | ) |
| def pygenn.genn_model.GeNNModel.postsynaptic_update_time | ( | self | ) |
| def pygenn.genn_model.GeNNModel.presynaptic_update_time | ( | self | ) |
| def pygenn.genn_model.GeNNModel.pull_connectivity_from_device | ( | self, | |
| pop_name | |||
| ) |
Pull connectivity from the device for a given population.
| def pygenn.genn_model.GeNNModel.pull_current_spike_events_from_device | ( | self, | |
| pop_name | |||
| ) |
Pull spike events from the device for a given population.
| def pygenn.genn_model.GeNNModel.pull_current_spikes_from_device | ( | self, | |
| pop_name | |||
| ) |
Pull spikes from the device for a given population.
| def pygenn.genn_model.GeNNModel.pull_extra_global_param_from_device | ( | self, | |
| pop_name, | |||
| egp_name, | |||
size = None |
|||
| ) |
Pull extra global parameter from the device for a given population.
| def pygenn.genn_model.GeNNModel.pull_recording_buffers_from_device | ( | self | ) |
Pull recording buffers from device.
| def pygenn.genn_model.GeNNModel.pull_spike_events_from_device | ( | self, | |
| pop_name | |||
| ) |
Pull spike events from the device for a given population.
| def pygenn.genn_model.GeNNModel.pull_spikes_from_device | ( | self, | |
| pop_name | |||
| ) |
Pull spikes from the device for a given population.
| def pygenn.genn_model.GeNNModel.pull_state_from_device | ( | self, | |
| pop_name | |||
| ) |
Pull state from the device for a given population.
| def pygenn.genn_model.GeNNModel.pull_var_from_device | ( | self, | |
| pop_name, | |||
| var_name | |||
| ) |
Pull variable from the device for a given population.
| def pygenn.genn_model.GeNNModel.push_connectivity_to_device | ( | self, | |
| pop_name | |||
| ) |
Push connectivity to the device for a given population.
| def pygenn.genn_model.GeNNModel.push_current_spike_events_to_device | ( | self, | |
| pop_name | |||
| ) |
Push current spike events to the device for a given population.
| def pygenn.genn_model.GeNNModel.push_current_spikes_to_device | ( | self, | |
| pop_name | |||
| ) |
Push current spikes to the device for a given population.
| def pygenn.genn_model.GeNNModel.push_extra_global_param_to_device | ( | self, | |
| pop_name, | |||
| egp_name, | |||
size = None |
|||
| ) |
Push extra global parameter to the device for a given population.
| def pygenn.genn_model.GeNNModel.push_spike_events_to_device | ( | self, | |
| pop_name | |||
| ) |
Push spike events to the device for a given population.
| def pygenn.genn_model.GeNNModel.push_spikes_to_device | ( | self, | |
| pop_name | |||
| ) |
Push spikes to the device for a given population.
| def pygenn.genn_model.GeNNModel.push_state_to_device | ( | self, | |
| pop_name | |||
| ) |
Push state to the device for a given population.
| def pygenn.genn_model.GeNNModel.push_var_to_device | ( | self, | |
| pop_name, | |||
| var_name | |||
| ) |
Push variable to the device for a given population.
| def pygenn.genn_model.GeNNModel.reinitialise | ( | self | ) |
reinitialise model to its original state without re-loading
| def pygenn.genn_model.GeNNModel.step_time | ( | self | ) |
Make one simulation step.
| def pygenn.genn_model.GeNNModel.synapse_dynamics_time | ( | self | ) |
| def pygenn.genn_model.GeNNModel.t | ( | self | ) |
Simulation time in ms.
| def pygenn.genn_model.GeNNModel.t | ( | self, | |
| t | |||
| ) |
| def pygenn.genn_model.GeNNModel.timestep | ( | self | ) |
Simulation time step.
| def pygenn.genn_model.GeNNModel.timestep | ( | self, | |
| timestep | |||
| ) |
| def pygenn.genn_model.GeNNModel.timing_enabled | ( | self | ) |
| def pygenn.genn_model.GeNNModel.timing_enabled | ( | self, | |
| timing | |||
| ) |
| def pygenn.genn_model.GeNNModel.unload | ( | self | ) |
| def pygenn.genn_model.GeNNModel.use_backend | ( | self | ) |
| def pygenn.genn_model.GeNNModel.use_backend | ( | self, | |
| backend | |||
| ) |
| pygenn.genn_model.GeNNModel.backend_log_level |
| pygenn.genn_model.GeNNModel.current_sources |
| pygenn.genn_model.GeNNModel.custom_updates |
| pygenn.genn_model.GeNNModel.default_var_location |
| pygenn.genn_model.GeNNModel.dT |
| pygenn.genn_model.GeNNModel.genn_types |
| pygenn.genn_model.GeNNModel.model_name |
| pygenn.genn_model.GeNNModel.neuron_populations |
| pygenn.genn_model.GeNNModel.synapse_populations |
| pygenn.genn_model.GeNNModel.use_backend |