Changeset 713
- Timestamp:
- 02/17/10 22:45:18 (2 years ago)
- Location:
- trunk/src
- Files:
-
- 2 added
- 21 modified
-
brian/__init__.py (modified) (3 diffs)
-
brian/cells.py (modified) (10 diffs)
-
brian/simulator.py (modified) (6 diffs)
-
brian/synapses.py (modified) (3 diffs)
-
cells.py (modified) (1 diff)
-
common.py (modified) (17 diffs)
-
connectors.py (modified) (2 diffs)
-
connectors2.py (modified) (4 diffs)
-
core.py (added)
-
nest/__init__.py (modified) (3 diffs)
-
nest/cells.py (modified) (12 diffs)
-
nest/simulator.py (modified) (6 diffs)
-
nest/synapses.py (modified) (8 diffs)
-
neuron/__init__.py (modified) (3 diffs)
-
neuron/cells.py (modified) (10 diffs)
-
neuron/simulator.py (modified) (5 diffs)
-
neuron/synapses.py (modified) (5 diffs)
-
pcsim/__init__.py (modified) (7 diffs)
-
pcsim/cells.py (modified) (12 diffs)
-
pcsim/simulator.py (modified) (5 diffs)
-
pcsim/synapses.py (modified) (9 diffs)
-
standardmodels.py (added)
-
synapses.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/brian/__init__.py
r712 r713 9 9 #import brian_no_units_no_warnings 10 10 from pyNN.brian import simulator 11 from pyNN import common, recording, space, __doc__11 from pyNN import common, recording, space, standardmodels, __doc__ 12 12 common.simulator = simulator 13 13 recording.simulator = simulator … … 23 23 def list_standard_models(): 24 24 """Return a list of all the StandardCellType classes available for this simulator.""" 25 standard_cell_types = [obj for obj in globals().values() if isinstance(obj, type) and issubclass(obj, common.StandardCellType)]25 standard_cell_types = [obj for obj in globals().values() if isinstance(obj, type) and issubclass(obj, standardmodels.StandardCellType)] 26 26 for cell_class in standard_cell_types: 27 27 try: … … 102 102 e.g., (10,10) will create a two-dimensional population of size 10x10. 103 103 cellclass should either be a standardized cell class (a class inheriting 104 from common.StandardCellType) or a string giving the name of the104 from standardmodels.StandardCellType) or a string giving the name of the 105 105 simulator-specific model that makes up the population. 106 106 cellparams should be a dict which is passed to the neuron model -
trunk/src/brian/cells.py
r711 r713 5 5 """ 6 6 7 from pyNN import common, cells, errors7 from pyNN import standardmodels, cells, errors 8 8 #import brian_no_units_no_warnings 9 9 from brian.library.synapses import * … … 16 16 """Leaky integrate and fire model with fixed threshold and alpha-function- 17 17 shaped post-synaptic current.""" 18 translations = common.build_translations(18 translations = standardmodels.build_translations( 19 19 ('v_rest', 'v_rest', mV), 20 20 ('v_reset', 'v_reset'), … … 51 51 excitatory and inhibitory synapses.""" 52 52 53 translations = common.build_translations(53 translations = standardmodels.build_translations( 54 54 ('v_rest', 'v_rest', mV), 55 55 ('v_reset', 'v_reset'), … … 81 81 82 82 class IF_cond_alpha(cells.IF_cond_alpha): 83 translations = common.build_translations(83 translations = standardmodels.build_translations( 84 84 ('v_rest', 'v_rest', mV), 85 85 ('v_reset', 'v_reset'), … … 117 117 """Leaky integrate and fire model with fixed threshold and 118 118 exponentially-decaying post-synaptic conductance.""" 119 translations = common.build_translations(119 translations = standardmodels.build_translations( 120 120 ('v_rest', 'v_rest', mV), 121 121 ('v_reset', 'v_reset'), … … 149 149 150 150 151 class IF_facets_hardware1( common.ModelNotAvailable):151 class IF_facets_hardware1(standardmodels.ModelNotAvailable): 152 152 """Leaky integrate and fire model with conductance-based synapses and fixed 153 153 threshold as it is resembled by the FACETS Hardware Stage 1. For further … … 160 160 class SpikeSourcePoisson(cells.SpikeSourcePoisson): 161 161 """Spike source, generating spikes according to a Poisson process.""" 162 translations = common.build_translations(162 translations = standardmodels.build_translations( 163 163 ('rate', 'rate'), 164 164 ('start', 'start'), … … 189 189 class SpikeSourceArray(cells.SpikeSourceArray): 190 190 """Spike source generating spikes at the times given in the spike_times array.""" 191 translations = common.build_translations(191 translations = standardmodels.build_translations( 192 192 ('spike_times', 'spiketimes', ms), 193 193 ) … … 202 202 return super(SpikeSourceArray, cls).translate(parameters) 203 203 204 class EIF_cond_alpha_isfa_ista( common.ModelNotAvailable):205 pass 206 207 208 class HH_cond_exp( common.ModelNotAvailable):204 class EIF_cond_alpha_isfa_ista(standardmodels.ModelNotAvailable): 205 pass 206 207 208 class HH_cond_exp(standardmodels.ModelNotAvailable): 209 209 pass 210 210 211 211 #class HH_cond_exp(cells.HH_cond_exp): 212 212 # 213 # translations = common.build_translations(213 # translations = standardmodels.build_translations( 214 214 # ('gbar_Na', 'gbar_Na'), 215 215 # ('gbar_K', 'gbar_K'), … … 259 259 260 260 261 class SpikeSourceInhGamma( common.ModelNotAvailable):262 pass 263 264 265 class IF_cond_exp_gsfa_grr( common.ModelNotAvailable):266 pass 261 class SpikeSourceInhGamma(standardmodels.ModelNotAvailable): 262 pass 263 264 265 class IF_cond_exp_gsfa_grr(standardmodels.ModelNotAvailable): 266 pass -
trunk/src/brian/simulator.py
r711 r713 32 32 from itertools import izip 33 33 import scipy.sparse 34 from pyNN import common, cells, errors 34 from pyNN import common, cells, errors, standardmodels, core 35 35 36 36 mV = brian.mV … … 143 143 return self._threshold.spiketimes 144 144 def _set_spiketimes(self, spiketimes): 145 assert co mmon.is_listlike(spiketimes)146 if len(spiketimes) == 0 or common.is_number(spiketimes[0]):145 assert core.is_listlike(spiketimes) 146 if len(spiketimes) == 0 or numpy.isscalar(spiketimes[0]): 147 147 spiketimes = [spiketimes for i in xrange(len(self))] 148 148 assert len(spiketimes) == len(self), "spiketimes (length %d) must contain as many iterables as there are cells in the group (%d)." % (len(spiketimes), len(self)) … … 279 279 max_delay=state.max_delay) 280 280 cell_parameters = cellparams or {} 281 elif isinstance(cellclass, type) and issubclass(cellclass, common.StandardCellType):281 elif isinstance(cellclass, type) and issubclass(cellclass, standardmodels.StandardCellType): 282 282 celltype = cellclass(cellparams) 283 283 cell_parameters = celltype.parameters … … 469 469 """ 470 470 #print "connecting", source, "to", targets, "with weights", weights, "and delays", delays 471 if not co mmon.is_listlike(targets):471 if not core.is_listlike(targets): 472 472 targets = [targets] 473 473 if isinstance(weights, float): … … 585 585 else: 586 586 raise Exception("Setting parameters other than weight and delay not yet supported.") 587 if common.is_number(value):587 if numpy.isscalar(value): 588 588 for row in M.data: 589 589 for i in range(len(row)): … … 593 593 for (i,j) in address_gen: 594 594 M[i,j] = value[i,j]*units 595 elif co mmon.is_listlike(value):595 elif core.is_listlike(value): 596 596 assert len(value) == M.getnnz() 597 597 address_gen = ((i,j) for i,row in enumerate(bc.W.rows) for j in row) -
trunk/src/brian/synapses.py
r626 r713 5 5 """ 6 6 7 from pyNN import common7 from pyNN import standardmodels 8 8 9 9 10 class SynapseDynamics( common.SynapseDynamics):10 class SynapseDynamics(standardmodels.SynapseDynamics): 11 11 def __init__(self, fast=None, slow=None): 12 12 synapses.SynapseDynamics.__init__(self, fast, slow) 13 13 14 class STDPMechanism( common.STDPMechanism):14 class STDPMechanism(standardmodels.STDPMechanism): 15 15 def __init__(self, timing_dependence=None, weight_dependence=None, 16 16 voltage_dependence=None, dendritic_delay_fraction=1.0): … … 21 21 voltage_dependence, dendritic_delay_fraction) 22 22 23 class TsodkysMarkramMechanism( common.ModelNotAvailable):23 class TsodkysMarkramMechanism(standardmodels.ModelNotAvailable): 24 24 25 25 def __init__(self, U=0.5, tau_rec=100.0, tau_facil=0.0, u0=0.0, x0=1.0, y0=0.0): … … 35 35 population.v_[spikes]= v_reset 36 36 37 class AdditiveWeightDependence( common.ModelNotAvailable):37 class AdditiveWeightDependence(standardmodels.ModelNotAvailable): 38 38 pass 39 39 40 class MultiplicativeWeightDependence( common.ModelNotAvailable):40 class MultiplicativeWeightDependence(standardmodels.ModelNotAvailable): 41 41 pass 42 42 43 class SpikePairRule( common.ModelNotAvailable):43 class SpikePairRule(standardmodels.ModelNotAvailable): 44 44 pass -
trunk/src/cells.py
r672 r713 28 28 29 29 import numpy 30 from commonimport StandardCellType30 from standardmodels import StandardCellType 31 31 32 32 class IF_curr_alpha(StandardCellType): -
trunk/src/common.py
r712 r713 9 9 10 10 Utility functions and classes: 11 is_listlike()12 is_number()13 11 is_conductance() 14 12 check_weight() 15 13 check_delay() 16 distance()17 14 18 15 Accessing individual neurons: 19 16 IDMixin 20 21 Standard cells/parameter translation:22 build_translations()23 StandardModelType24 StandardCellType25 ModelNotAvailable26 17 27 18 Common API implementation/base classes: … … 46 37 Population 47 38 Projection 48 49 4. Specification of synaptic plasticity:50 SynapseDynamics51 ShortTermPlasticityMechanism52 STDPMechanism53 STDPWeightDependence54 STDPTimingDependence55 39 56 40 $Id$ 57 41 """ 58 42 59 import types, copy, sys60 43 import numpy 61 44 import logging 62 45 from math import * 63 46 import operator 64 from pyNN import random, utility, recording, errors 47 from pyNN import random, utility, recording, errors, standardmodels, core 65 48 from string import Template 66 49 … … 79 62 # ============================================================================== 80 63 81 def is_listlike(obj):82 return hasattr(obj, "__len__") and not isinstance(obj, basestring)83 84 def is_number(obj):85 return isinstance(obj, float) or isinstance(obj, int) or isinstance(obj, long) or isinstance(obj, numpy.float64)86 64 87 65 def is_conductance(target_cell): … … 103 81 if weight is None: 104 82 weight = DEFAULT_WEIGHT 105 if is_listlike(weight):83 if core.is_listlike(weight): 106 84 weight = numpy.array(weight) 107 85 nan_filter = (1-numpy.isnan(weight)).astype(bool) # weight arrays may contain NaN, which should be ignored … … 111 89 if not (all_negative or all_positive): 112 90 raise errors.InvalidWeightError("Weights must be either all positive or all negative") 113 elif is_number(weight):91 elif numpy.isscalar(weight): 114 92 all_positive = weight >= 0 115 93 all_negative = weight < 0 … … 224 202 225 203 def is_standard_cell(self): 226 return (type(self.cellclass) == type and issubclass(self.cellclass, StandardCellType))204 return (type(self.cellclass) == type and issubclass(self.cellclass, standardmodels.StandardCellType)) 227 205 228 206 def _set_position(self, pos): … … 267 245 """Inject current from a current source object into the cell.""" 268 246 current_source.inject_into([self]) 269 270 271 # ============================================================================== 272 # Standard cells 273 # ============================================================================== 274 275 def build_translations(*translation_list): 276 """ 277 Build a translation dictionary from a list of translations/transformations. 278 """ 279 translations = {} 280 for item in translation_list: 281 assert 2 <= len(item) <= 4, "Translation tuples must have between 2 and 4 items. Actual content: %s" % str(item) 282 pynn_name = item[0] 283 sim_name = item[1] 284 if len(item) == 2: # no transformation 285 f = pynn_name 286 g = sim_name 287 elif len(item) == 3: # simple multiplicative factor 288 scale_factor = item[2] 289 f = "float(%g)*%s" % (scale_factor, pynn_name) 290 g = "%s/float(%g)" % (sim_name, scale_factor) 291 elif len(item) == 4: # more complex transformation 292 f = item[2] 293 g = item[3] 294 translations[pynn_name] = {'translated_name': sim_name, 295 'forward_transform': f, 296 'reverse_transform': g} 297 return translations 298 299 class StandardModelType(object): 300 """Base class for standardized cell model and synapse model classes.""" 301 302 translations = {} 303 default_parameters = {} 304 305 def __init__(self, parameters): 306 self.parameters = self.__class__.checkParameters(parameters, with_defaults=True) 307 self.parameters = self.__class__.translate(self.parameters) 308 309 @classmethod 310 def checkParameters(cls, supplied_parameters, with_defaults=False): 311 """ 312 Returns a parameter dictionary, checking that each 313 supplied_parameter is in the default_parameters and 314 converts to the type of the latter. 315 316 If with_defaults==True, parameters not in 317 supplied_parameters are in the returned dictionary 318 as in default_parameters. 319 320 """ 321 default_parameters = cls.default_parameters 322 if with_defaults: 323 parameters = copy.copy(default_parameters) 324 else: 325 parameters = {} 326 if supplied_parameters: 327 for k in supplied_parameters.keys(): 328 if default_parameters.has_key(k): 329 err_msg = "For %s in %s, expected %s, got %s (%s)" % \ 330 (k, cls.__name__, type(default_parameters[k]), 331 type(supplied_parameters[k]), supplied_parameters[k]) 332 # same type 333 if type(supplied_parameters[k]) == type(default_parameters[k]): 334 parameters[k] = supplied_parameters[k] 335 # float and something that can be converted to a float 336 elif type(default_parameters[k]) == types.FloatType: 337 try: 338 parameters[k] = float(supplied_parameters[k]) 339 except (ValueError, TypeError): 340 raise errors.InvalidParameterValueError(err_msg) 341 # list and something that can be transformed to a list 342 elif type(default_parameters[k]) == types.ListType: 343 try: 344 parameters[k] = list(supplied_parameters[k]) 345 except TypeError: 346 raise errors.InvalidParameterValueError(err_msg) 347 else: 348 raise errors.InvalidParameterValueError(err_msg) 349 else: 350 raise errors.NonExistentParameterError(k, cls) 351 return parameters 352 353 @classmethod 354 def translate(cls, parameters): 355 """Translate standardized model parameters to simulator-specific parameters.""" 356 parameters = cls.checkParameters(parameters, with_defaults=False) 357 native_parameters = {} 358 for name in parameters: 359 D = cls.translations[name] 360 pname = D['translated_name'] 361 if is_listlike(cls.default_parameters[name]): 362 parameters[name] = numpy.array(parameters[name]) 363 try: 364 pval = eval(D['forward_transform'], globals(), parameters) 365 except NameError, errmsg: 366 raise NameError("Problem translating '%s' in %s. Transform: '%s'. Parameters: %s. %s" \ 367 % (pname, cls.__name__, D['forward_transform'], parameters, errmsg)) 368 except ZeroDivisionError: 369 pval = 1e30 # this is about the highest value hoc can deal with 370 native_parameters[pname] = pval 371 return native_parameters 372 373 @classmethod 374 def reverse_translate(cls, native_parameters): 375 """Translate simulator-specific model parameters to standardized parameters.""" 376 standard_parameters = {} 377 for name,D in cls.translations.items(): 378 if is_listlike(cls.default_parameters[name]): 379 tname = D['translated_name'] 380 native_parameters[tname] = numpy.array(native_parameters[tname]) 381 try: 382 standard_parameters[name] = eval(D['reverse_transform'], {}, native_parameters) 383 except NameError, errmsg: 384 raise NameError("Problem translating '%s' in %s. Transform: '%s'. Parameters: %s. %s" \ 385 % (name, cls.__name__, D['reverse_transform'], native_parameters, errmsg)) 386 return standard_parameters 387 388 @classmethod 389 def simple_parameters(cls): 390 """Return a list of parameters for which there is a one-to-one 391 correspondance between standard and native parameter values.""" 392 return [name for name in cls.translations if cls.translations[name]['forward_transform'] == name] 393 394 @classmethod 395 def scaled_parameters(cls): 396 """Return a list of parameters for which there is a unit change between 397 standard and native parameter values.""" 398 return [name for name in cls.translations if "float" in cls.translations[name]['forward_transform']] 399 400 @classmethod 401 def computed_parameters(cls): 402 """Return a list of parameters whose values must be computed from 403 more than one other parameter.""" 404 return [name for name in cls.translations if name not in cls.simple_parameters()+cls.scaled_parameters()] 405 406 def update_parameters(self, parameters): 407 """ 408 update self.parameters with those in parameters 409 """ 410 self.parameters.update(self.translate(parameters)) 411 412 def describe(self, template='standard'): 413 return str(self) 414 415 416 class StandardCellType(StandardModelType): 417 """Base class for standardized cell model classes.""" 418 419 recordable = ['spikes', 'v', 'gsyn'] 420 synapse_types = ('excitatory', 'inhibitory') 421 conductance_based = True # over-ride for cells with current-based synapses 422 always_local = False # over-ride for NEST spike sources 423 424 425 class ModelNotAvailable(object): 426 """Not available for this simulator.""" 427 428 def __init__(self, *args, **kwargs): 429 raise NotImplementedError("The %s model is not available for this simulator." % self.__class__.__name__) 247 430 248 431 249 # ============================================================================== … … 519 337 # should refactor to eliminate this repetition 520 338 logger.debug("connecting %s to %s on host %d" % (source, target, rank())) 521 if not is_listlike(source):339 if not core.is_listlike(source): 522 340 source = [source] 523 if not is_listlike(target):341 if not core.is_listlike(target): 524 342 target = [target] 525 343 delay = check_delay(delay) … … 599 417 e.g., (10,10) will create a two-dimensional population of size 10x10. 600 418 cellclass should either be a standardized cell class (a class inheriting 601 from common. StandardCellType) or a string giving the name of the419 from common.standardmodels.StandardCellType) or a string giving the name of the 602 420 simulator-specific model that makes up the population. 603 421 cellparams should be a dict which is passed to the neuron model … … 612 430 assert isinstance(dims, tuple), "`dims` must be an integer or a tuple. You have supplied a %s" % type(dims) 613 431 self.label = label or 'population%d' % Population.nPop 614 if isinstance(cellclass, type) and issubclass(cellclass, StandardCellType):432 if isinstance(cellclass, type) and issubclass(cellclass, standardmodels.StandardCellType): 615 433 self.celltype = cellclass(cellparams) 616 434 else: … … 853 671 def can_record(self, variable): 854 672 """Determine whether `variable` can be recorded from this population.""" 855 if isinstance(self.celltype, StandardCellType):673 if isinstance(self.celltype, standardmodels.StandardCellType): 856 674 return (variable in self.celltype.recordable) 857 675 else: … … 1110 928 connecting the neurons. 1111 929 1112 synapse_dynamics - a ` SynapseDynamics` object specifying which930 synapse_dynamics - a `standardmodels.SynapseDynamics` object specifying which 1113 931 synaptic plasticity mechanisms to use. 1114 932 … … 1139 957 self.long_term_plasticity_mechanism = None 1140 958 if self.synapse_dynamics: 1141 assert isinstance(self.synapse_dynamics, SynapseDynamics), \1142 "The synapse_dynamics argument, if specified, must be a SynapseDynamics object, not a %s" % type(synapse_dynamics)959 assert isinstance(self.synapse_dynamics, standardmodels.SynapseDynamics), \ 960 "The synapse_dynamics argument, if specified, must be a standardmodels.SynapseDynamics object, not a %s" % type(synapse_dynamics) 1143 961 if self.synapse_dynamics.fast: 1144 assert isinstance(self.synapse_dynamics.fast, ShortTermPlasticityMechanism)962 assert isinstance(self.synapse_dynamics.fast, standardmodels.ShortTermPlasticityMechanism) 1145 963 if hasattr(self.synapse_dynamics.fast, 'native_name'): 1146 964 self.short_term_plasticity_mechanism = self.synapse_dynamics.fast.native_name … … 1149 967 self._short_term_plasticity_parameters = self.synapse_dynamics.fast.parameters.copy() 1150 968 if self.synapse_dynamics.slow: 1151 assert isinstance(self.synapse_dynamics.slow, STDPMechanism)969 assert isinstance(self.synapse_dynamics.slow, standardmodels.STDPMechanism) 1152 970 assert 0 <= self.synapse_dynamics.slow.dendritic_delay_fraction <= 1.0 1153 971 td = self.synapse_dynamics.slow.timing_dependence … … 1234 1052 Set parameters of the synapse dynamics to values taken from rand_distr 1235 1053 """ 1236 self.set SynapseDynamics(param, rand_distr.next(len(self)))1054 self.setstandardmodels.SynapseDynamics(param, rand_distr.next(len(self))) 1237 1055 1238 1056 # --- Methods for writing/reading information to/from file. ---------------- … … 1269 1087 """ 1270 1088 if gather: 1271 logger.error("get SynapseDynamics() with gather=True not yet implemented")1089 logger.error("getstandardmodels.SynapseDynamics() with gather=True not yet implemented") 1272 1090 return self.connection_manager.get(parameter_name, format, offset=(self.pre.first_id, self.post.first_id)) 1273 1091 … … 1374 1192 return Template(template).substitute(context) 1375 1193 1376 1377 1194 # ============================================================================== 1378 # Synapse Dynamics classes1379 # ==============================================================================1380 1381 class SynapseDynamics(object):1382 """1383 For specifying synapse short-term (faciliation, depression) and long-term1384 (STDP) plasticity. To be passed as the `synapse_dynamics` argument to1385 `Projection.__init__()` or `connect()`.1386 """1387 1388 def __init__(self, fast=None, slow=None):1389 """1390 Create a new specification for a dynamic synapse, combining a `fast`1391 component (short-term facilitation/depression) and a `slow` component1392 (long-term potentiation/depression).1393 """1394 self.fast = fast1395 self.slow = slow1396 1397 def describe(self, template='standard'):1398 """1399 Return a human-readable description of the synaptic properties.1400 """1401 if template == 'standard':1402 lines = ["Short-term plasticity mechanism: $fast",1403 "Long-term plasticity mechanism: $slow"]1404 template = "\n".join(lines)1405 context = {'fast': self.fast and self.fast.describe() or 'None',1406 'slow': self.slow and self.slow.describe() or 'None'}1407 if template == None:1408 return context1409 else:1410 return Template(template).substitute(context)1411 1412 1413 class ShortTermPlasticityMechanism(StandardModelType):1414 """Abstract base class for models of short-term synaptic dynamics."""1415 1416 def __init__(self):1417 raise NotImplementedError1418 1419 1420 class STDPMechanism(object):1421 """Specification of STDP models."""1422 1423 def __init__(self, timing_dependence=None, weight_dependence=None,1424 voltage_dependence=None, dendritic_delay_fraction=1.0):1425 """1426 Create a new specification for an STDP mechanism, by combining a1427 weight-dependence, a timing-dependence, and, optionally, a voltage-1428 dependence.1429 1430 For point neurons, the synaptic delay `d` can be interpreted either as1431 occurring purely in the pre-synaptic axon + synaptic cleft, in which1432 case the synaptic plasticity mechanism 'sees' the post-synaptic spike1433 immediately and the pre-synaptic spike after a delay `d`1434 (`dendritic_delay_fraction = 0`) or as occurring purely in the post-1435 synaptic dendrite, in which case the pre-synaptic spike is seen1436 immediately, and the post-synaptic spike after a delay `d`1437 (`dendritic_delay_fraction = 1`), or as having both pre- and post-1438 synaptic components (`dendritic_delay_fraction` between 0 and 1).1439 1440 In a future version of the API, we will allow the different1441 components of the synaptic delay to be specified separately in1442 milliseconds.1443 """1444 self.timing_dependence = timing_dependence1445 self.weight_dependence = weight_dependence1446 self.voltage_dependence = voltage_dependence1447 self.dendritic_delay_fraction = dendritic_delay_fraction1448 1449 def describe(self):1450 """1451 Return a human-readable description of the STDP mechanism.1452 """1453 return "STDP mechanism (this description needs to be filled out)."1454 1455 1456 class STDPWeightDependence(StandardModelType):1457 """Abstract base class for models of STDP weight dependence."""1458 1459 def __init__(self):1460 raise NotImplementedError1461 1462 1463 class STDPTimingDependence(StandardModelType):1464 """Abstract base class for models of STDP timing dependence (triplets, etc)"""1465 1466 def __init__(self):1467 raise NotImplementedError1468 1469 1470 # ============================================================================== -
trunk/src/connectors.py
r712 r713 20 20 fabs, floor, fmod, hypot, ldexp, log, log10, modf, pi, power, \ 21 21 sin, sinh, sqrt, tan, tanh 22 from pyNN import random, common, errors 22 from pyNN import random, common, errors, core 23 23 from pyNN.space import Space 24 24 … … 116 116 # returned. 117 117 rarr = rng.next(N, 'uniform', (0, 1), mask_local=local) 118 if not co mmon.is_listlike(rarr) and common.is_number(rarr): # if N=1, rarr will be a single number118 if not core.is_listlike(rarr) and numpy.isscalar(rarr): # if N=1, rarr will be a single number 119 119 rarr = numpy.array([rarr]) 120 if common.is_number(p):120 if numpy.isscalar(p): 121 121 create = rarr < p 122 122 else: -
trunk/src/connectors2.py
r712 r713 1 1 import numpy 2 from pyNN import common 2 from pyNN import common, core 3 3 from pyNN.space import Space 4 4 from pyNN.random import RandomDistribution … … 15 15 def get(self, connectivity_matrix, distance_matrix): 16 16 local_value_mask = self.local_mask[connectivity_matrix] 17 if common.is_number(self.source):17 if numpy.isscalar(self.source): 18 18 return numpy.ones((local_value_mask.sum(),))*self.source 19 19 elif isinstance(self.source, RandomDistribution): … … 69 69 self.delays = min_delay 70 70 else: 71 if co mmon.is_listlike(delays):71 if core.is_listlike(delays): 72 72 assert min(delays) >= min_delay 73 73 else: … … 169 169 N = projection.post.size 170 170 rarr = projection.rng.next(N, 'uniform', (0,1), mask_local=False) 171 if not co mmon.is_listlike(rarr) and common.is_number(rarr): # if N=1, rarr will be a single number171 if not core.is_listlike(rarr) and numpy.isscalar(rarr): # if N=1, rarr will be a single number 172 172 rarr = numpy.array([rarr]) 173 173 global_target_mask = rarr < p -
trunk/src/nest/__init__.py
r712 r713 7 7 import nest 8 8 from pyNN.nest import simulator 9 from pyNN import common, recording, errors, space, __doc__9 from pyNN import common, recording, errors, space, standardmodels, __doc__ 10 10 common.simulator = simulator 11 11 recording.simulator = simulator … … 39 39 def list_standard_models(): 40 40 """Return a list of all the StandardCellType classes available for this simulator.""" 41 standard_cell_types = [obj for obj in globals().values() if isinstance(obj, type) and issubclass(obj, common.StandardCellType)]41 standard_cell_types = [obj for obj in globals().values() if isinstance(obj, type) and issubclass(obj, standardmodels.StandardCellType)] 42 42 for cell_class in standard_cell_types: 43 43 try: … … 182 182 e.g., (10,10) will create a two-dimensional population of size 10x10. 183 183 cellclass should either be a standardized cell class (a class inheriting 184 from common.StandardCellType) or a string giving the name of the184 from standardmodels.StandardCellType) or a string giving the name of the 185 185 simulator-specific model that makes up the population. 186 186 cellparams should be a dict which is passed to the neuron model -
trunk/src/nest/cells.py
r687 r713 5 5 """ 6 6 7 from pyNN import common, cells7 from pyNN import standardmodels, cells 8 8 9 9 class IF_curr_alpha(cells.IF_curr_alpha): … … 13 13 """ 14 14 15 translations = common.build_translations(15 translations = standardmodels.build_translations( 16 16 ('v_rest', 'E_L'), 17 17 ('v_reset', 'V_reset'), … … 35 35 """ 36 36 37 translations = common.build_translations(37 translations = standardmodels.build_translations( 38 38 ('v_rest', 'E_L'), 39 39 ('v_reset', 'V_reset'), … … 56 56 """ 57 57 58 translations = common.build_translations(58 translations = standardmodels.build_translations( 59 59 ('v_rest', 'E_L') , 60 60 ('v_reset', 'V_reset'), … … 79 79 """ 80 80 81 translations = common.build_translations(81 translations = standardmodels.build_translations( 82 82 ('v_rest', 'E_L') , 83 83 ('v_reset', 'V_reset'), … … 107 107 See also: EIF_cond_alpha_isfa_ista 108 108 """ 109 translations = common.build_translations(109 translations = standardmodels.build_translations( 110 110 ('v_rest', 'E_L'), 111 111 ('v_reset', 'V_reset'), … … 139 139 # in 'iaf_cond_exp_sfa_rr', the dimension of C_m is pF, 140 140 # while in the pyNN context, cm is given in nF 141 translations = common.build_translations(141 translations = standardmodels.build_translations( 142 142 ('v_reset', 'V_reset'), 143 143 ('v_rest', 'E_L'), … … 162 162 """Single-compartment Hodgkin-Huxley model.""" 163 163 164 translations = common.build_translations(164 translations = standardmodels.build_translations( 165 165 ('gbar_Na', 'g_Na'), 166 166 ('gbar_K', 'g_K'), … … 192 192 """ 193 193 194 translations = common.build_translations(194 translations = standardmodels.build_translations( 195 195 ('v_init' , 'v_init'), 196 196 ('w_init' , 'w', 1000.0), # nA -> pA … … 218 218 """Spike source, generating spikes according to a Poisson process.""" 219 219 220 translations = common.build_translations(220 translations = standardmodels.build_translations( 221 221 ('rate', 'rate'), 222 222 ('start', 'start'), … … 240 240 """ 241 241 242 translations = common.build_translations(242 translations = standardmodels.build_translations( 243 243 ('a', 'a'), 244 244 ('b', 'b'), … … 259 259 """Spike source generating spikes at the times given in the spike_times array.""" 260 260 261 translations = common.build_translations(261 translations = standardmodels.build_translations( 262 262 ('spike_times', 'spike_times'), 263 263 ) -
trunk/src/nest/simulator.py
r711 r713 27 27 28 28 import nest 29 from pyNN import common, random, errors 29 from pyNN import common, random, errors, standardmodels, core 30 30 import logging 31 31 import numpy … … 150 150 nest_model = cellclass 151 151 cell_parameters = cellparams or {} 152 elif isinstance(cellclass, type) and issubclass(cellclass, common.StandardCellType):152 elif isinstance(cellclass, type) and issubclass(cellclass, standardmodels.StandardCellType): 153 153 celltype = cellclass(cellparams) 154 154 nest_model = celltype.nest_name … … 310 310 """ 311 311 # are we sure the targets are all on the current node? 312 if co mmon.is_listlike(source):312 if core.is_listlike(source): 313 313 assert len(source) == 1 314 314 source = source[0] 315 if not co mmon.is_listlike(targets):315 if not core.is_listlike(targets): 316 316 targets = [targets] 317 317 assert len(targets) > 0 … … 351 351 """ 352 352 # are we sure the targets are all on the current node? 353 if co mmon.is_listlike(target):353 if core.is_listlike(target): 354 354 assert len(target) == 1 355 355 target = target[0] 356 if not co mmon.is_listlike(sources):356 if not core.is_listlike(sources): 357 357 sources = [sources] 358 358 assert len(sources) > 0, sources … … 452 452 matrix (as returned by `get(format='array')`). 453 453 """ 454 if not ( common.is_number(value) or common.is_listlike(value)):454 if not (numpy.isscalar(value) or core.is_listlike(value)): 455 455 raise TypeError("Argument should be a numeric type (int, float...), a list, or a numpy array.") 456 456 … … 470 470 value_list.append(val) 471 471 value = value_list 472 if co mmon.is_listlike(value):472 if core.is_listlike(value): 473 473 value = numpy.array(value) 474 474 else: -
trunk/src/nest/synapses.py
r711 r713 5 5 """ 6 6 7 from pyNN import common, synapses7 from pyNN import standardmodels, synapses 8 8 9 9 10 SynapseDynamics = common.SynapseDynamics10 SynapseDynamics = standardmodels.SynapseDynamics 11 11 12 class STDPMechanism( common.STDPMechanism):12 class STDPMechanism(standardmodels.STDPMechanism): 13 13 """Specification of STDP models.""" 14 14 … … 18 18 for the purpose of STDP calculations all delays 19 19 are assumed to be dendritic.""" 20 common.STDPMechanism.__init__(self, timing_dependence, weight_dependence,20 standardmodels.STDPMechanism.__init__(self, timing_dependence, weight_dependence, 21 21 voltage_dependence, dendritic_delay_fraction) 22 22 … … 24 24 class TsodyksMarkramMechanism(synapses.TsodyksMarkramMechanism): 25 25 26 translations = common.build_translations(26 translations = standardmodels.build_translations( 27 27 ('U', 'U'), 28 28 ('tau_rec', 'tau_rec'), … … 48 48 """ 49 49 50 translations = common.build_translations(50 translations = standardmodels.build_translations( 51 51 ('w_max', 'Wmax', 1000.0), # unit conversion 52 52 ('w_min', 'w_min_always_zero_in_NEST'), … … 73 73 For potentiation, Dw propto w_max-w 74 74 """ 75 translations = common.build_translations(75 translations = standardmodels.build_translations( 76 76 ('w_max', 'Wmax', 1000.0), # unit conversion 77 77 ('w_min', 'w_min_always_zero_in_NEST'), … … 96 96 depression (Dw propto w-w_min) and is fixed for potentiation. 97 97 """ 98 translations = common.build_translations(98 translations = standardmodels.build_translations( 99 99 ('w_max', 'Wmax', 1000.0), # unit conversion 100 100 ('w_min', 'w_min_always_zero_in_NEST'), … … 121 121 For potentiation, Dw propto w_max-w 122 122 """ 123 translations = common.build_translations(123 translations = standardmodels.build_translations( 124 124 ('w_max', 'Wmax', 1000.0), # unit conversion 125 125 ('w_min', 'w_min_always_zero_in_NEST'), … … 142 142 class SpikePairRule(synapses.SpikePairRule): 143 143 144 translations = common.build_translations(144 translations = standardmodels.build_translations( 145 145 ('tau_plus', 'tau_plus'), 146 146 ('tau_minus', 'tau_minus'), # defined in post-synaptic neuron -
trunk/src/neuron/__init__.py
r712 r713 9 9 from pyNN.random import * 10 10 from pyNN.neuron import simulator 11 from pyNN import common, recording, space, __doc__11 from pyNN import common, recording, space, standardmodels, __doc__ 12 12 common.simulator = simulator 13 13 recording.simulator = simulator … … 30 30 def list_standard_models(): 31 31 """Return a list of all the StandardCellType classes available for this simulator.""" 32 return [obj for obj in globals().values() if isinstance(obj, type) and issubclass(obj, common.StandardCellType)]32 return [obj for obj in globals().values() if isinstance(obj, type) and issubclass(obj, standardmodels.StandardCellType)] 33 33 34 34 # ============================================================================== … … 121 121 e.g., (10,10) will create a two-dimensional population of size 10x10. 122 122 cellclass should either be a standardized cell class (a class inheriting 123 from common.StandardCellType) or a string giving the name of the123 from standardmodels.StandardCellType) or a string giving the name of the 124 124 simulator-specific model that makes up the population. 125 125 cellparams should be a dict which is passed to the neuron model -
trunk/src/neuron/cells.py
r711 r713 6 6 """ 7 7 8 from pyNN import common, cells, errors8 from pyNN import standardmodels, cells, errors 9 9 from neuron import h, nrn, hclass 10 10 from math import pi … … 425 425 shaped post-synaptic current.""" 426 426 427 translations = common.build_translations(427 translations = standardmodels.build_translations( 428 428 ('tau_m', 'tau_m'), 429 429 ('cm', 'c_m'), … … 450 450 excitatory and inhibitory synapses.""" 451 451 452 translations = common.build_translations(452 translations = standardmodels.build_translations( 453 453 ('tau_m', 'tau_m'), 454 454 ('cm', 'c_m'), … … 474 474 shaped post-synaptic conductance.""" 475 475 476 translations = common.build_translations(476 translations = standardmodels.build_translations( 477 477 ('tau_m', 'tau_m'), 478 478 ('cm', 'c_m'), … … 501 501 exponentially-decaying post-synaptic conductance.""" 502 502 503 translations = common.build_translations(503 translations = standardmodels.build_translations( 504 504 ('tau_m', 'tau_m'), 505 505 ('cm', 'c_m'), … … 531 531 """ 532 532 533 translations = common.build_translations(533 translations = standardmodels.build_translations( 534 534 ('v_rest', 'v_rest'), 535 535 ('v_thresh', 'v_thresh'), … … 554 554 class HH_cond_exp(cells.HH_cond_exp): 555 555 556 translations = common.build_translations(556 translations = standardmodels.build_translations( 557 557 ('gbar_Na', 'gbar_Na', 1e-6), 558 558 ('gbar_K', 'gbar_K', 1e-6), … … 581 581 """Spike source, generating spikes according to a Poisson process.""" 582 582 583 translations = common.build_translations(583 translations = standardmodels.build_translations( 584 584 ('start', 'start'), 585 585 ('rate', '_interval', "1000.0/rate", "1000.0/_interval"), … … 592 592 """Spike source generating spikes at the times given in the spike_times array.""" 593 593 594 translations = common.build_translations(594 translations = standardmodels.build_translations( 595 595 ('spike_times', 'spike_times'), 596 596 ) … … 609 609 """ 610 610 611 translations = common.build_translations(611 translations = standardmodels.build_translations( 612 612 ('v_init', 'v_init'), 613 613 ('w_init', 'w_init'), -
trunk/src/neuron/simulator.py
r711 r713 29 29 30 30 from pyNN import __path__ as pyNN_path 31 from pyNN import common, random, errors 31 from pyNN import common, random, errors, standardmodels, core 32 32 import platform 33 33 import logging … … 284 284 raise errors.InvalidModelError("There is no hoc template called %s" % cellclass) 285 285 cell_parameters = cellparams or {} 286 elif isinstance(cellclass, type) and issubclass(cellclass, common.StandardCellType):286 elif isinstance(cellclass, type) and issubclass(cellclass, standardmodels.StandardCellType): 287 287 celltype = cellclass(cellparams) 288 288 cell_model = celltype.model … … 464 464 errmsg = "Invalid source ID: %s (gid_counter=%d)" % (source, state.gid_counter) 465 465 raise errors.ConnectionError(errmsg) 466 if not co mmon.is_listlike(targets):466 if not core.is_listlike(targets): 467 467 targets = [targets] 468 468 if isinstance(weights, float): … … 533 533 matrix (as returned by `get(format='array')`). 534 534 """ 535 if common.is_number(value):535 if numpy.isscalar(value): 536 536 for c in self: 537 537 setattr(c, name, value) … … 548 548 else: 549 549 setattr(c, name, val) 550 elif co mmon.is_listlike(value):550 elif core.is_listlike(value): 551 551 for c,val in zip(self.connections, value): 552 552 setattr(c, name, val) -
trunk/src/neuron/synapses.py
r711 r713 5 5 """ 6 6 7 from pyNN import common, synapses7 from pyNN import standardmodels, synapses 8 8 9 SynapseDynamics = common.SynapseDynamics10 STDPMechanism = common.STDPMechanism9 SynapseDynamics = standardmodels.SynapseDynamics 10 STDPMechanism = standardmodels.STDPMechanism 11 11 12 12 class TsodyksMarkramMechanism(synapses.TsodyksMarkramMechanism): 13 13 14 translations = common.build_translations(14 translations = standardmodels.build_translations( 15 15 ('U', 'U'), 16 16 ('tau_rec', 'tau_rec'), … … 37 37 """ 38 38 39 translations = common.build_translations(39 translations = standardmodels.build_translations( 40 40 ('w_max', 'wmax'), 41 41 ('w_min', 'wmin'), … … 57 57 For potentiation, Dw propto w_max-w 58 58 """ 59 translations = common.build_translations(59 translations = standardmodels.build_translations( 60 60 ('w_max', 'wmax'), 61 61 ('w_min', 'wmin'), … … 75 75 depression (Dw propto w-w_min) and is fixed for potentiation 76 76 """ 77 translations = common.build_translations(77 translations = standardmodels.build_translations( 78 78 ('w_max', 'wmax'), 79 79 ('w_min', 'wmin'), … … 94 94 class SpikePairRule(synapses.SpikePairRule): 95 95 96 translations = common.build_translations(96 translations = standardmodels.build_translations( 97 97 ('tau_plus', 'tauLTP'), 98 98 ('tau_minus', 'tauLTD'), -
trunk/src/pcsim/__init__.py
r712 r713 15 15 16 16 import pyNN.random 17 from pyNN import common, recording, errors, space, __doc__17 from pyNN import common, recording, errors, space, core, __doc__ 18 18 from pyNN.pcsim import simulator 19 19 common.simulator = simulator … … 74 74 """Return a list of all the StandardCellType classes available for this simulator.""" 75 75 setup() 76 standard_cell_types = [obj for obj in globals().values() if isinstance(obj, type) and issubclass(obj, common.StandardCellType)]76 standard_cell_types = [obj for obj in globals().values() if isinstance(obj, type) and issubclass(obj, standardmodels.StandardCellType)] 77 77 for cell_class in standard_cell_types: 78 78 try: … … 261 261 # if type(source) != types.ListType and type(target) != types.ListType: 262 262 # connections = simulator.net.connect(source, target, syn_factory) 263 # if not co mmon.is_listlike(connections):263 # if not core.is_listlike(connections): 264 264 # connections = [connections] 265 265 # return connections … … 304 304 e.g., (10,10) will create a two-dimensional population of size 10x10. 305 305 cellclass should either be a standardized cell class (a class inheriting 306 from common.StandardCellType) or a string giving the name of the306 from standardmodels.StandardCellType) or a string giving the name of the 307 307 simulator-specific model that makes up the population. 308 308 cellparams should be a dict which is passed to the neuron model … … 336 336 cellclass = getattr(pypcsim, cellclass) 337 337 self.celltype = cellclass 338 if issubclass(cellclass, common.StandardCellType):338 if issubclass(cellclass, standardmodels.StandardCellType): 339 339 self.celltype = cellclass(cellparams) 340 340 self.cellfactory = self.celltype.simObjFactory … … 582 582 ## 583 583 # handle synapse dynamics 584 if co mmon.is_listlike(method.weights):584 if core.is_listlike(method.weights): 585 585 w = method.weights[0] 586 586 elif hasattr(method.weights, "next"): # random distribution … … 588 588 else: 589 589 w = method.weights 590 if co mmon.is_listlike(method.delays):590 if core.is_listlike(method.delays): 591 591 d = min(method.delays) 592 592 elif hasattr(method.delays, "next"): # random distribution -
trunk/src/pcsim/cells.py
r711 r713 5 5 """ 6 6 7 from pyNN import common, cells, errors 7 from pyNN import common, cells, errors, standardmodels 8 8 import pypcsim 9 9 import numpy … … 16 16 shaped post-synaptic current.""" 17 17 18 translations = common.build_translations(18 translations = standardmodels.build_translations( 19 19 ('tau_m', 'taum', 1e-3), 20 20 ('cm', 'Cm', 1e-9), … … 43 43 excitatory and inhibitory synapses.""" 44 44 45 translations = common.build_translations(45 translations = standardmodels.build_translations( 46 46 ('tau_m', 'taum', 1e-3), 47 47 ('cm', 'Cm', 1e-9), … … 69 69 shaped post-synaptic conductance.""" 70 70 71 translations = common.build_translations(71 translations = standardmodels.build_translations( 72 72 ('tau_m', 'taum', 1e-3), 73 73 ('cm', 'Cm', 1e-9), … … 98 98 exponentially-decaying post-synaptic conductance.""" 99 99 100 translations = common.build_translations(100 translations = standardmodels.build_translations( 101 101 ('tau_m', 'taum', 1e-3), 102 102 ('cm', 'Cm', 1e-9), … … 127 127 """Spike source, generating spikes according to a Poisson process.""" 128 128 129 translations = common.build_translations(129 translations = standardmodels.build_translations( 130 130 ('start', 'Tstart', 1e-3), 131 131 ('rate', 'rate'), … … 165 165 class SpikeSourceArray(cells.SpikeSourceArray): 166 166 """Spike source generating spikes at the times given in the spike_times array.""" 167 translations = common.build_translations(167 translations = standardmodels.build_translations( 168 168 ('spike_times', 'spikeTimes'), # 1e-3), 169 169 ) … … 201 201 return standard_parameters 202 202 203 class EIF_cond_alpha_isfa_ista( common.ModelNotAvailable):203 class EIF_cond_alpha_isfa_ista(standardmodels.ModelNotAvailable): 204 204 pass 205 205 #class EIF_cond_alpha_isfa_ista(cells.EIF_cond_alpha_isfa_ista): … … 214 214 # """ 215 215 # 216 # translations = common.build_translations(216 # translations = standardmodels.build_translations( 217 217 # ('v_init' , 'Vinit', 1e-3), # mV -> V 218 218 # ('w_init' , 'w', 1e-9), # nA -> A … … 248 248 # self.simObjFactory = getattr(pypcsim, EIF_cond_alpha_isfa_ista.pcsim_name)(**limited_parameters) 249 249 250 class IF_facets_hardware1( common.ModelNotAvailable):251 pass 252 253 class HH_cond_exp( common.ModelNotAvailable):250 class IF_facets_hardware1(standardmodels.ModelNotAvailable): 251 pass 252 253 class HH_cond_exp(standardmodels.ModelNotAvailable): 254 254 pass 255 255 … … 257 257 # """docstring needed here.""" 258 258 # 259 # translations = common.build_translations(259 # translations = standardmodels.build_translations( 260 260 # ('gbar_Na', 'gbar_Na'), 261 261 # ('gbar_K', 'gbar_K'), … … 284 284 285 285 286 class SpikeSourceInhGamma( common.ModelNotAvailable):287 pass 288 289 class IF_cond_exp_gsfa_grr( common.ModelNotAvailable):290 pass 286 class SpikeSourceInhGamma(standardmodels.ModelNotAvailable): 287 pass 288 289 class IF_cond_exp_gsfa_grr(standardmodels.ModelNotAvailable): 290 pass -
trunk/src/pcsim/simulator.py
r711 r713 30 30 import types 31 31 import numpy 32 from pyNN import common, errors 32 from pyNN import common, errors, standardmodels, core 33 33 34 34 recorder_list = [] … … 150 150 assert n > 0, 'n must be a positive integer' 151 151 if isinstance(cellclass, type): 152 if issubclass(cellclass, common.StandardCellType):152 if issubclass(cellclass, standardmodels.StandardCellType): 153 153 cellfactory = cellclass(cellparams).simObjFactory 154 154 elif issubclass(cellclass, pypcsim.SimObject): … … 276 276 errmsg = "Invalid source ID: %s" % source 277 277 raise errors.ConnectionError(errmsg) 278 if not co mmon.is_listlike(targets):278 if not core.is_listlike(targets): 279 279 targets = [targets] 280 280 if isinstance(weights, float): … … 352 352 matrix (as returned by `get(format='array')`) 353 353 """ 354 if common.is_number(value):354 if numpy.isscalar(value): 355 355 for c in self: 356 356 setattr(c, name, value) … … 367 367 else: 368 368 setattr(c, name, val) 369 elif co mmon.is_listlike(value):369 elif core.is_listlike(value): 370 370 for c,val in zip(self.connections, value): 371 371 setattr(c, name, val) -
trunk/src/pcsim/synapses.py
r686 r713 5 5 """ 6 6 7 from pyNN import common, synapses7 from pyNN import standardmodels, synapses 8 8 import pypcsim 9 9 … … 33 33 ]) 34 34 35 SynapseDynamics = common.SynapseDynamics35 SynapseDynamics = standardmodels.SynapseDynamics 36 36 37 class STDPMechanism( common.STDPMechanism):37 class STDPMechanism(standardmodels.STDPMechanism): 38 38 """Specification of STDP models.""" 39 39 … … 41 41 voltage_dependence=None, dendritic_delay_fraction=1.0): 42 42 # not sure what the situation is with dendritic_delay_fraction in PCSIM 43 common.STDPMechanism.__init__(self, timing_dependence, weight_dependence,43 standardmodels.STDPMechanism.__init__(self, timing_dependence, weight_dependence, 44 44 voltage_dependence, dendritic_delay_fraction) 45 45 … … 47 47 class TsodyksMarkramMechanism(synapses.TsodyksMarkramMechanism): 48 48 49 translations = common.build_translations(49 translations = standardmodels.build_translations( 50 50 ('U', 'U'), 51 51 ('tau_rec', 'D', 1e-3), … … 74 74 """ 75 75 76 translations = common.build_translations(76 translations = standardmodels.build_translations( 77 77 ('w_max', 'Wex', 1e-9), # unit conversion. This exposes a limitation of the current 78 78 # translation machinery, because this value depends on the … … 106 106 For potentiation, Dw propto w_max-w 107 107 """ 108 translations = common.build_translations(108 translations = standardmodels.build_translations( 109 109 ('w_max', 'Wex', 1e-9), # unit conversion 110 110 ('w_min', 'w_min_always_zero_in_PCSIM'), … … 133 133 depression (Dw propto w-w_min) and is fixed for potentiation. 134 134 """ 135 translations = common.build_translations(135 translations = standardmodels.build_translations( 136 136 ('w_max', 'Wex', 1e-9), # unit conversion 137 137 ('w_min', 'w_min_always_zero_in_PCSIM'), … … 160 160 For potentiation, Dw propto w_max-w 161 161 """ 162 translations = common.build_translations(162 translations = standardmodels.build_translations( 163 163 ('w_max', 'Wex', 1e-9), # unit conversion 164 164 ('w_min', 'w_min_always_zero_in_PCSIM'), … … 183 183 class SpikePairRule(synapses.SpikePairRule): 184 184 185 translations = common.build_translations(185 translations = standardmodels.build_translations( 186 186 ('tau_plus', 'taupos', 1e-3), 187 187 ('tau_minus', 'tauneg', 1e-3), -
trunk/src/synapses.py
r639 r713 16 16 """ 17 17 18 from commonimport ShortTermPlasticityMechanism, STDPWeightDependence, STDPTimingDependence18 from standardmodels import ShortTermPlasticityMechanism, STDPWeightDependence, STDPTimingDependence 19 19 20 20 class TsodyksMarkramMechanism(ShortTermPlasticityMechanism):
