class pygenn::genn_model::GeNNModel¶
Overview¶
GeNNModel class This class helps to define, build and run a GeNN model from python. More…
class GeNNModel: public object { public: // fields use_backend; default_var_location; model_name; neuron_populations; synapse_populations; current_sources; dT; T; // methods def __init__(); def use_backend(); def default_var_location(); def default_sparse_connectivity_location(); def model_name(); def t(); def timestep(); def dT(); def add_neuron_population(); def add_synapse_population(); def add_current_source(); def build(); def load(); def reinitialise(); def step_time(); def pull_state_from_device(); def pull_spikes_from_device(); def pull_current_spikes_from_device(); def pull_connectivity_from_device(); def pull_var_from_device(); def push_state_to_device(); def push_spikes_to_device(); def push_current_spikes_to_device(); def push_connectivity_to_device(); def push_var_to_device(); def end(); };
Detailed Documentation¶
GeNNModel class This class helps to define, build and run a GeNN model from python.
Methods¶
def __init__()
Init GeNNModel.
Parameters:
precision | string precision as string (“float”, “double” or “long double”). defaults to float. |
model_name | string name of the model. Defaults to “GeNNModel”. |
enable_debug | boolean enable debug mode. Disabled by default. |
backend | string specifying name of backend module to use Defaults to None to pick ‘best’ backend for your system |
def default_var_location()
Default variable location - defines where state variables are initialised.
def default_sparse_connectivity_location()
Default sparse connectivity mode - where connectivity is initialised.
def model_name()
Name of the model.
def t()
Simulation time in ms.
def timestep()
Simulation time step.
def dT()
Step size.
def add_neuron_population()
Add a neuron population to the GeNN model.
Parameters:
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 add_synapse_population()
Add a synapse population to the GeNN model.
Parameters:
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 |
target | target neuron group |
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 add_current_source()
Add a current source to the GeNN model.
Parameters:
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_name | name of the population into which the current source should be injected |
param_space | dict with param values for the CurrentSourceModels class |
var_space | dict with initial variable values for the CurrentSourceModels class |
def build()
Finalize and build a GeNN model.
Parameters:
path_to_model | path where to place the generated model code. Defaults to the local directory. |
def load()
import the model as shared library and initialize it
def reinitialise()
reinitialise model to its original state without re-loading
def pull_state_from_device()
Pull state from the device for a given population.
def pull_spikes_from_device()
Pull spikes from the device for a given population.
def pull_current_spikes_from_device()
Pull spikes from the device for a given population.
def pull_connectivity_from_device()
Pull connectivity from the device for a given population.
def pull_var_from_device()
Pull variable from the device for a given population.
def push_state_to_device()
Push state to the device for a given population.
def push_spikes_to_device()
Push spikes to the device for a given population.
def push_current_spikes_to_device()
Push current spikes to the device for a given population.
def push_connectivity_to_device()
Push connectivity to the device for a given population.
def push_var_to_device()
Push variable to the device for a given population.
def end()
Free memory.