Changeset 407
- Timestamp:
- 07/03/08 03:17:50 (5 months ago)
- Files:
-
- trunk/src/common.py (modified) (2 diffs)
- trunk/src/nest2/__init__.py (modified) (2 diffs)
- trunk/src/nest2/synapses.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/common.py
r405 r407 1513 1513 """ 1514 1514 default_parameters = { 1515 'w_min' : 20.0,1516 'w_max' : 20.0,1517 'A_plus' : 0.01,1518 'A_minus': 0.01 1515 'w_min' : 0.0, 1516 'w_max' : 1.0, 1517 'A_plus' : 0.01, 1518 'A_minus': 0.01, 1519 1519 } 1520 1520 … … 1530 1530 """ 1531 1531 1532 def __init__(self, w_min=0.0, A_plus=0.01, A_minus=0.01): 1532 default_parameters = { 1533 'w_min' : 0.0, 1534 'w_max' : 1.0, 1535 'A_plus' : 0.01, 1536 'A_minus': 0.01, 1537 } 1538 1539 def __init__(self, w_min=0.0, w_max=1.0, A_plus=0.01, A_minus=0.01): 1533 1540 pass 1534 1541 1535 1542 1536 1543 class GutigWeightDependence(STDPWeightDependence): 1537 pass 1544 1545 default_parameters = { 1546 'w_min' : 0.0, 1547 'w_max' : 1.0, 1548 'A_plus' : 0.01, 1549 'A_minus' : 0.01, 1550 'mu_plus' : 0.5, 1551 'mu_minus': 0.5 1552 } 1553 1554 def __init__(self, w_min=0.0, w_max=1.0, A_plus=0.01, A_minus=0.01,mu_plus=0.5,mu_minus=0.5): 1555 pass 1538 1556 1539 1557 # Not yet implemented for any module trunk/src/nest2/__init__.py
r406 r407 765 765 tmp_list = record_from 766 766 else: 767 rng = rng or numpy.random 767 if not rng: 768 rng = numpy.random 768 769 tmp_list = rng.permutation(numpy.reshape(self.cell, (self.cell.size,)))[0:n_rec] 769 770 … … 863 864 Returns the mean number of spikes per neuron. 864 865 """ 865 n_spikes = len(self.recorders['spikes'].get(gather))866 n_spikes = nest.GetStatus(self.recorders['spikes']._device,'n_events')[0] 866 867 n_rec = len(self.recorders['spikes'].recorded) 867 868 return float(n_spikes)/n_rec trunk/src/nest2/synapses.py
r307 r407 82 82 """ 83 83 translations = common.build_translations( 84 ('w_max', ' wmax', 1000.0), # unit conversion84 ('w_max', 'Wmax', 1000.0), # unit conversion 85 85 ('w_min', 'w_min_always_zero_in_NEST'), 86 ('A_plus', ' aLTP'),86 ('A_plus', 'lambda'), 87 87 ('A_minus', 'alpha', 'A_minus/A_plus', 'alpha*lambda'), 88 88 ) … … 98 98 self.parameters['mu_plus'] = 1.0 99 99 self.parameters['mu_minus'] = 1.0 100 101 class AdditivePotentiationMultiplicativeDepression(common.AdditivePotentiationMultiplicativeDepression): 102 """ 103 The amplitude of the weight change depends on the current weight. 104 For depression, Dw propto w-w_min 105 For potentiation, Dw propto w_max-w 106 """ 107 translations = common.build_translations( 108 ('w_max', 'Wmax', 1000.0), # unit conversion 109 ('w_min', 'w_min_always_zero_in_NEST'), 110 ('A_plus', 'lambda'), 111 ('A_minus', 'alpha', 'A_minus/A_plus', 'alpha*lambda'), 112 ) 113 possible_models = set(['stdp_synapse',]) #'stdp_synapse_hom' 114 115 def __init__(self, w_min=0.0, w_max=1.0, A_plus=0.01, A_minus=0.01): 116 if w_min != 0: 117 raise Exception("Non-zero minimum weight is not supported by NEST.") 118 common.AdditivePotentiationMultiplicativeDepression.__init__(self, w_min, w_max, A_plus, A_minus) 119 parameters = locals() 120 parameters.pop('self') 121 self.parameters = self.translate(parameters) 122 self.parameters['mu_plus'] = 0.0 123 self.parameters['mu_minus'] = 1.0 124 125 126 class GutigWeightDependence(common.GutigWeightDependence): 127 """ 128 The amplitude of the weight change depends on the current weight. 129 For depression, Dw propto w-w_min 130 For potentiation, Dw propto w_max-w 131 """ 132 translations = common.build_translations( 133 ('w_max', 'Wmax', 1000.0), # unit conversion 134 ('w_min', 'w_min_always_zero_in_NEST'), 135 ('A_plus', 'lambda'), 136 ('A_minus', 'alpha', 'A_minus/A_plus', 'alpha*lambda'), 137 ('mu_plus', 'mu_plus'), 138 ('mu_minus', 'mu_minus'), 139 ) 140 possible_models = set(['stdp_synapse',]) #'stdp_synapse_hom' 141 142 def __init__(self, w_min=0.0, w_max=1.0, A_plus=0.01, A_minus=0.01,mu_plus=0.5,mu_minus=0.5): 143 if w_min != 0: 144 raise Exception("Non-zero minimum weight is not supported by NEST.") 145 common.AdditivePotentiationMultiplicativeDepression.__init__(self, w_min, w_max, A_plus, A_minus) 146 parameters = locals() 147 parameters.pop('self') 148 self.parameters = self.translate(parameters) 100 149 101 150

