GeNN  3.3.0
GPU enhanced Neuronal Networks (GeNN)
pygenn.model_preprocessor Namespace Reference

Classes

class  Variable
 Class holding information about GeNN variables. More...
 

Functions

def prepare_model (model, param_space, var_space, pre_var_space=None, post_var_space=None, model_family=None)
 Prepare a model by checking its validity and extracting information about variables and parameters. More...
 
def prepare_snippet (snippet, param_space, snippet_family)
 Prepare a snippet by checking its validity and extracting information about parameters. More...
 
def is_model_valid (model, model_family)
 Check whether the model is valid, i.e is native or derived from model_family.Custom. More...
 
def param_space_to_vals (model, param_space)
 Convert a param_space dict to ParamValues. More...
 
def param_space_to_val_vec (model, param_space)
 Convert a param_space dict to a std::vector<double> More...
 
def var_space_to_vals (model, var_space)
 Convert a var_space dict to VarValues. More...
 
def pre_var_space_to_vals (model, var_space)
 Convert a var_space dict to PreVarValues. More...
 
def post_var_space_to_vals (model, var_space)
 Convert a var_space dict to PostVarValues. More...
 

Function Documentation

◆ is_model_valid()

def pygenn.model_preprocessor.is_model_valid (   model,
  model_family 
)

Check whether the model is valid, i.e is native or derived from model_family.Custom.

Parameters
modelstring or instance of model_family.Custom
model_familymodel family (NeuronModels, WeightUpdateModels or PostsynapticModels) to which model should belong to
Return
instance of the model and its type as string

Raises ValueError if model is not valid (i.e. is not custom and is not natively available)

◆ param_space_to_val_vec()

def pygenn.model_preprocessor.param_space_to_val_vec (   model,
  param_space 
)

Convert a param_space dict to a std::vector<double>

Parameters
modelinstance of the model
param_spacedict with parameters
Return
native vector of parameters

◆ param_space_to_vals()

def pygenn.model_preprocessor.param_space_to_vals (   model,
  param_space 
)

Convert a param_space dict to ParamValues.

Parameters
modelinstance of the model
param_spacedict with parameters
Return
native model's ParamValues

◆ post_var_space_to_vals()

def pygenn.model_preprocessor.post_var_space_to_vals (   model,
  var_space 
)

Convert a var_space dict to PostVarValues.

Parameters
modelinstance of the weight update model
var_spacedict with Variables
Return
native model's VarValues

◆ pre_var_space_to_vals()

def pygenn.model_preprocessor.pre_var_space_to_vals (   model,
  var_space 
)

Convert a var_space dict to PreVarValues.

Parameters
modelinstance of the weight update model
var_spacedict with Variables
Return
native model's VarValues

◆ prepare_model()

def pygenn.model_preprocessor.prepare_model (   model,
  param_space,
  var_space,
  pre_var_space = None,
  post_var_space = None,
  model_family = None 
)

Prepare a model by checking its validity and extracting information about variables and parameters.

Parameters
modelstring or instance of a class derived from
model_family.Custom
param_spacedict with model parameters
var_spacedict with model variables
pre_var_spaceoptional dict with (weight update) model presynaptic variables
post_var_spaceoptional dict with (weight update) model postsynaptic variables
model_familygenn_wrapper.NeuronModels or genn_wrapper.WeightUpdateModels or
genn_wrapper.CurrentSourceModels
Returntuple consisting of 0. model instance,
  1. model type,
  2. model parameter names,
  3. model parameters,
  4. list of variable names
  1. dict mapping names of variables to instances of class Variable.

◆ prepare_snippet()

def pygenn.model_preprocessor.prepare_snippet (   snippet,
  param_space,
  snippet_family 
)

Prepare a snippet by checking its validity and extracting information about parameters.

Parameters
snippetstring or instance of a class derived from
snippet_family.Custom
param_spacedict with model parameters
snippet_familygenn_wrapper.InitVarSnippet or
genn_wrapper.InitSparseConnectivitySnippet
Returntuple consisting of 0. snippet instance,
  1. snippet type,
  2. snippet parameter names,
  3. snippet parameters

◆ var_space_to_vals()

def pygenn.model_preprocessor.var_space_to_vals (   model,
  var_space 
)

Convert a var_space dict to VarValues.

Parameters
modelinstance of the model
var_spacedict with Variables
Return
native model's VarValues