1""" 2Standard synapses for the NeuroML module. 3 4:copyright: Copyright 2006-2017 by the PyNN team, see AUTHORS. 5:license: CeCILL, see LICENSE for details. 6""" 7 8from pyNN.standardmodels import synapses, build_translations 9from pyNN.neuroml.simulator import state 10import logging 11 12import neuroml 13 14logger = logging.getLogger("PyNN_NeuroML") 15 16 17 18class StaticSynapse(synapses.StaticSynapse): 19 __doc__ = synapses.StaticSynapse.__doc__ 20 translations = build_translations( 21 ('weight', 'WEIGHT'), 22 ('delay', 'DELAY'), 23 ) 24 25 def _get_minimum_delay(self): 26 d = state.min_delay 27 if d == 'auto': 28 d = state.dt 29 return d 30 31 def add_to_nml_doc(self, nml_doc, population): 32 raise NotImplementedError() 33 34 35class TsodyksMarkramSynapse(synapses.TsodyksMarkramSynapse): 36 __doc__ = synapses.TsodyksMarkramSynapse.__doc__ 37 38 translations = build_translations( 39 ('weight', 'WEIGHT'), 40 ('delay', 'DELAY'), 41 ('U', 'UU'), 42 ('tau_rec', 'TAU_REC'), 43 ('tau_facil', 'TAU_FACIL'), 44 ('u0', 'U0'), 45 ('x0', 'X' ), 46 ('y0', 'Y') 47 ) 48 49 def _get_minimum_delay(self): 50 d = state.min_delay 51 if d == 'auto': 52 d = state.dt 53 return d 54 55 def add_to_nml_doc(self, nml_doc, population): 56 raise NotImplementedError() 57 58 59class STDPMechanism(synapses.STDPMechanism): 60 __doc__ = synapses.STDPMechanism.__doc__ 61 62 base_translations = build_translations( 63 ('weight', 'WEIGHT'), 64 ('delay', 'DELAY') 65 ) 66 67 def _get_minimum_delay(self): 68 d = state.min_delay 69 if d == 'auto': 70 d = state.dt 71 return d 72 73 def add_to_nml_doc(self, nml_doc, population): 74 raise NotImplementedError() 75 76 77class AdditiveWeightDependence(synapses.AdditiveWeightDependence): 78 __doc__ = synapses.AdditiveWeightDependence.__doc__ 79 80 translations = build_translations( 81 ('w_max', 'wmax'), 82 ('w_min', 'wmin'), 83 ('A_plus', 'aLTP'), 84 ('A_minus', 'aLTD'), 85 ) 86 87 def add_to_nml_doc(self, nml_doc, population): 88 raise NotImplementedError() 89 90 91class MultiplicativeWeightDependence(synapses.MultiplicativeWeightDependence): 92 __doc__ = synapses.MultiplicativeWeightDependence.__doc__ 93 94 translations = build_translations( 95 ('w_max', 'wmax'), 96 ('w_min', 'wmin'), 97 ('A_plus', 'aLTP'), 98 ('A_minus', 'aLTD'), 99 ) 100 101 def add_to_nml_doc(self, nml_doc, population): 102 raise NotImplementedError() 103 104 105class AdditivePotentiationMultiplicativeDepression(synapses.AdditivePotentiationMultiplicativeDepression): 106 __doc__ = synapses.AdditivePotentiationMultiplicativeDepression.__doc__ 107 108 translations = build_translations( 109 ('w_max', 'wmax'), 110 ('w_min', 'wmin'), 111 ('A_plus', 'aLTP'), 112 ('A_minus', 'aLTD'), 113 ) 114 115 def add_to_nml_doc(self, nml_doc, population): 116 raise NotImplementedError() 117 118 119class GutigWeightDependence(synapses.GutigWeightDependence): 120 __doc__ = synapses.GutigWeightDependence.__doc__ 121 122 translations = build_translations( 123 ('w_max', 'wmax'), 124 ('w_min', 'wmin'), 125 ('A_plus', 'aLTP'), 126 ('A_minus', 'aLTD'), 127 ('mu_plus', 'muLTP'), 128 ('mu_minus', 'muLTD'), 129 ) 130 131 def add_to_nml_doc(self, nml_doc, population): 132 raise NotImplementedError() 133 134 135class SpikePairRule(synapses.SpikePairRule): 136 __doc__ = synapses.SpikePairRule.__doc__ 137 138 translations = build_translations( 139 ('tau_plus', 'tauLTP'), 140 ('tau_minus', 'tauLTD'), 141 ('A_plus', 'aLTP'), 142 ('A_minus', 'aLTD'), 143 ) 144 145 def add_to_nml_doc(self, nml_doc, population): 146 raise NotImplementedError() 147 148