NeuralEnsemble / PyNN

A Python package for simulator-independent specification of neuronal network models.
Other
276 stars 126 forks source link

Error using STDP with Brian2 backend #711

Closed ferqui closed 2 years ago

ferqui commented 3 years ago

I want to use STDP with Brian2 backend so I tried the simple_STDP.py, but it gives me the following error:

ERROR      Brian 2 encountered an unexpected error. If you think this is a bug in Brian 2, please report this issue either to the discourse forum at <http://brian.discourse.group/>, or to the issue tracker at <https://github.com/brian-team/brian2/issues>. Please include this file with debug information in your report: /var/folders/7d/cxc47xwj4r998d_194k_0v640000gn/T/brian_debug_99d786jl.log  Additionally, you can also include a copy of the script that was run, available at: /var/folders/7d/cxc47xwj4r998d_194k_0v640000gn/T/brian_script_jnra3ufo.py Thanks! [brian2]
Traceback (most recent call last):
  File "/Users/ferqui/dev/PyNN/pyNN/standardmodels/__init__.py", line 92, in translate
    pval = eval(D['forward_transform'], globals(), _parameters)
  File "<string>", line 1, in <module>
NameError: name 'weight_units' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "simple_STDP.py", line 102, in <module>
    connections = sim.Projection(p1, p2, sim.AllToAllConnector(), stdp_model)
  File "/Users/ferqui/dev/PyNN/pyNN/brian2/projections.py", line 140, in __init__
    connector.connect(self)
  File "/Users/ferqui/dev/PyNN/pyNN/connectors.py", line 310, in connect
    self._connect_with_map(projection, connection_map)
  File "/Users/ferqui/dev/PyNN/pyNN/connectors.py", line 252, in _connect_with_map
    self._standard_connect(projection, connection_map.by_column, distance_map)
  File "/Users/ferqui/dev/PyNN/pyNN/connectors.py", line 159, in _standard_connect
    if (projection.synapse_type.native_parameters.parallel_safe
  File "/Users/ferqui/dev/PyNN/pyNN/standardmodels/synapses.py", line 243, in native_parameters
    weight_parameters = self.weight_dependence.native_parameters
  File "/Users/ferqui/dev/PyNN/pyNN/standardmodels/__init__.py", line 73, in native_parameters
    return self.translate(self.parameter_space)
  File "/Users/ferqui/dev/PyNN/pyNN/standardmodels/__init__.py", line 94, in translate
    raise NameError("Problem translating '%s' in %s. Transform: '%s'. Parameters: %s. %s"
NameError: Problem translating 'w_min' in AdditiveWeightDependence. Transform: 'w_min*weight_units'. Parameters: <ParameterSpace w_min, w_max, shape=None>. name 'weight_units' is not defined

I guess the weight_units variable should be defined somewhere but I don't know where, any idea? I am using the master branch of PyNN

apdavison commented 2 years ago

fixed in #723