This module provides functions for model validation, parameter type conversions and defines class Variable.
More...
|
def | prepare_model (model, group, param_space, var_space, model_family) |
| 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 | var_ref_space_to_var_refs (model, var_ref_space) |
| Convert a var_ref_space dict to VarReferences. More...
|
|
def | var_ref_space_to_wu_var_refs (model, var_ref_space) |
| Convert a var_ref_space dict to WUVarReferences. More...
|
|
def | egp_ref_space_to_egp_refs (model, egp_ref_space) |
| Convert a egp_ref_space dict to EGPReferences. 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...
|
|
This module provides functions for model validation, parameter type conversions and defines class Variable.
◆ egp_ref_space_to_egp_refs()
def pygenn.model_preprocessor.egp_ref_space_to_egp_refs |
( |
|
model, |
|
|
|
egp_ref_space |
|
) |
| |
Convert a egp_ref_space dict to EGPReferences.
- Parameters
-
model | instance of the model |
egp_ref_space | dict with extra global parameter references |
- Returns
- native model's EGPReferences
◆ 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
-
- Returns
- 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
-
model | instance of the model |
param_space | dict with parameters |
- Returns
- 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
-
model | instance of the model |
param_space | dict with parameters |
- Returns
- 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
-
model | instance of the weight update model |
var_space | dict with Variables |
- Returns
- 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
-
model | instance of the weight update model |
var_space | dict with Variables |
- Returns
- native model's VarValues
◆ prepare_model()
def pygenn.model_preprocessor.prepare_model |
( |
|
model, |
|
|
|
group, |
|
|
|
param_space, |
|
|
|
var_space, |
|
|
|
model_family |
|
) |
| |
Prepare a model by checking its validity and extracting information about variables and parameters.
- Parameters
-
model | string or instance of a class derived from pygenn.genn_wrapper.NeuronModels.Custom or pygenn.genn_wrapper.WeightUpdateModels.Custom or pygenn.genn_wrapper.CurrentSourceModels.Custom |
group | group model will belong to |
param_space | dict with model parameters |
var_space | dict with model variables |
var_ref_space | optional dict with (custom update) model variable references |
model_family | pygenn.genn_wrapper.NeuronModels or pygenn.genn_wrapper.WeightUpdateModels or pygenn.genn_wrapper.CurrentSourceModels |
- Returns
- tuple consisting of (model instance, model type, model parameter names, model parameters, list of variable names, 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
-
snippet | string or instance of a class derived from pygenn.genn_wrapper.InitVarSnippet.Custom, pygenn.genn_wrapper.InitSparseConnectivitySnippet.Custom or pygenn.genn_wrapper.InitToeplitzConnectivitySnippet.Custom @param param_space dict with model parameters @param snippet_family pygenn.genn_wrapper.InitVarSnippet, pygenn.genn_wrapper.InitSparseConnectivitySnippet or pygenn.genn_wrapper.InitToeplitzConnectivitySnippet |
- Returns
- tuple consisting of (snippet instance, snippet type, snippet parameter names, snippet parameters)
◆ var_ref_space_to_var_refs()
def pygenn.model_preprocessor.var_ref_space_to_var_refs |
( |
|
model, |
|
|
|
var_ref_space |
|
) |
| |
Convert a var_ref_space dict to VarReferences.
- Parameters
-
model | instance of the model |
var_ref_space | dict with variable references |
- Returns
- native model's VarValues
◆ var_ref_space_to_wu_var_refs()
def pygenn.model_preprocessor.var_ref_space_to_wu_var_refs |
( |
|
model, |
|
|
|
var_ref_space |
|
) |
| |
Convert a var_ref_space dict to WUVarReferences.
- Parameters
-
model | instance of the model |
var_space | dict with Variables |
- Returns
- native model's VarReferences
◆ var_space_to_vals()
def pygenn.model_preprocessor.var_space_to_vals |
( |
|
model, |
|
|
|
var_space |
|
) |
| |
Convert a var_space dict to VarValues.
- Parameters
-
model | instance of the model |
var_space | dict with Variables |
- Returns
- native model's VarValues