This file is indexed.

/usr/share/pyshared/pyNN/standardmodels/synapses.py is in python-pynn 0.7.4-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# encoding: utf-8
"""
Definition of default parameters (and hence, standard parameter names) for
standard dynamic synapse models. 

Classes for specifying short-term plasticity (facilitation/depression):
    TsodyksMarkramMechanism
    
Classes for defining STDP rules:
    AdditiveWeightDependence
    MultiplicativeWeightDependence
    AdditivePotentiationMultiplicativeDepression
    GutigWeightDependence
    SpikePairRule

:copyright: Copyright 2006-2011 by the PyNN team, see AUTHORS.
:license: CeCILL, see LICENSE for details.
"""

from pyNN.standardmodels import ShortTermPlasticityMechanism, STDPWeightDependence, STDPTimingDependence

class TsodyksMarkramMechanism(ShortTermPlasticityMechanism):
    """
    Synapse exhibiting facilitation and depression, implemented using the model
    of Tsodyks, Markram et al.:
    
    Tsodyks, Uziel, Markram (2000) Synchrony Generation in Recurrent Networks
       with Frequency-Dependent Synapses. Journal of Neuroscience, vol 20 RC50
       
    Note that the time constant of the post-synaptic current is set in the
    neuron model, not here.
    """
    default_parameters = {
        'U': 0.5,   # use parameter
        'tau_rec': 100.0, # depression time constant (ms)
        'tau_facil': 0.0,   # facilitation time constant (ms)
        'u0': 0.0,  # }
        'x0': 1.0,  # } initial values
        'y0': 0.0   # }
    }
    
    def __init__(self, U=0.5, tau_rec=100.0, tau_facil=0.0, u0=0.0, x0=1.0, y0=0.0):
        """
        Create a new specification for a short-term plasticity mechanism.
        
        `U` -- use parameter
        `tau_rec` -- depression time constant (ms)
        `tau_facil` -- facilitation time constant (ms)
        `u0`, `x0`, `y0` -- initial conditions.
        """
        raise NotImplementedError
    

class AdditiveWeightDependence(STDPWeightDependence):
    """
    The amplitude of the weight change is fixed for depression (`A_minus`)
    and for potentiation (`A_plus`).
    If the new weight would be less than `w_min` it is set to `w_min`. If it would
    be greater than `w_max` it is set to `w_max`.
    """
    default_parameters = {
        'w_min':   0.0,
        'w_max':   1.0,
        'A_plus':  0.01,
        'A_minus': 0.01
    }
    
    def __init__(self, w_min=0.0, w_max=1.0, A_plus=0.01, A_minus=0.01): # units?
        """
        Create a new specification for the weight-dependence of an STDP rule.
        
        `w_min`   -- minimum synaptic weight, in the same units as the weight, i.e.
                     µS or nA.
        `w_max`   -- maximum synaptic weight.
        `A_plus`  -- synaptic weight increase as a fraction of `w_max` when the
                     pre-synaptic spike precedes the post-synaptic spike by an
                     infinitessimal amount.
        `A_minus` -- synaptic weight decrease as a fraction of `w_max` when the
                     pre-synaptic spike lags the post-synaptic spike by an
                     infinitessimal amount.
        """
        raise NotImplementedError


class MultiplicativeWeightDependence(STDPWeightDependence):
    """
    The amplitude of the weight change depends on the current weight.
    For depression, Δw ∝ w - w_min
    For potentiation, Δw ∝ w_max - w
    """
    default_parameters = {
        'w_min'  : 0.0,
        'w_max'  : 1.0,
        'A_plus' : 0.01,
        'A_minus': 0.01,
    }
    
    def __init__(self, w_min=0.0, w_max=1.0, A_plus=0.01, A_minus=0.01):
        """
        Create a new specification for the weight-dependence of an STDP rule.
        
        `w_min`   -- minimum synaptic weight, in the same units as the weight, i.e.
                     µS or nA.
        `w_max`   -- maximum synaptic weight.
        `A_plus`  -- synaptic weight increase as a fraction of `w_max-w` when the
                     pre-synaptic spike precedes the post-synaptic spike by an
                     infinitessimal amount.
        `A_minus` -- synaptic weight decrease as a fraction of `w-w_min` when the
                     pre-synaptic spike lags the post-synaptic spike by an
                     infinitessimal amount.
        """
        raise NotImplementedError
    

class AdditivePotentiationMultiplicativeDepression(STDPWeightDependence):
    """
    The amplitude of the weight change depends on the current weight for
    depression (Δw ∝ w) and is fixed for potentiation.
    """

    default_parameters = {
        'w_min'  : 0.0,
        'w_max'  : 1.0,
        'A_plus' : 0.01,
        'A_minus': 0.01,
    }

    def __init__(self, w_min=0.0,  w_max=1.0, A_plus=0.01, A_minus=0.01):
        """
        Create a new specification for the weight-dependence of an STDP rule.
        
        `w_min`   -- minimum synaptic weight, in the same units as the weight, i.e.
                     µS or nA.
        `w_max`   -- maximum synaptic weight.
        `A_plus`  -- synaptic weight increase as a fraction of `w_max` when the
                     pre-synaptic spike precedes the post-synaptic spike by an
                     infinitessimal amount.
        `A_minus` -- synaptic weight decrease as a fraction of `w-w_min` when the
                     pre-synaptic spike lags the post-synaptic spike by an
                     infinitessimal amount.
        """
        raise NotImplementedError

    
class GutigWeightDependence(STDPWeightDependence):
    """
    The amplitude of the weight change depends on (w_max-w)^mu_plus for
    potentiation and (w-w_min)^mu_minus for depression.
    """
    
    default_parameters = {
        'w_min'   : 0.0,
        'w_max'   : 1.0,
        'A_plus'  : 0.01,
        'A_minus' : 0.01,
        'mu_plus' : 0.5,
        'mu_minus': 0.5
    }

    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):
        """
        Create a new specification for the weight-dependence of an STDP rule.
        
        `w_min`    -- minimum synaptic weight, in the same units as the weight, i.e.
                      µS or nA.
        `w_max`    -- maximum synaptic weight.
        `A_plus`   -- synaptic weight increase as a fraction of `(w_max-w)^mu_plus`
                      when the pre-synaptic spike precedes the post-synaptic
                      spike by an infinitessimal amount.
        `A_minus`  -- synaptic weight decrease as a fraction of `(w-w_min)^mu_minus`
                      when the pre-synaptic spike lags the post-synaptic spike
                      by an infinitessimal amount.
        `mu_plus`  -- see above
        `mu_minus` -- see above
        """
        raise NotImplementedError

# Not yet implemented for any module
#class PfisterSpikeTripletRule(STDPTimingDependence):
#    raise NotImplementedError


class SpikePairRule(STDPTimingDependence):
    """
    The amplitude of the weight change depends only on the relative timing of
    spike pairs, not triplets, etc.
    """
    
    default_parameters = {
        'tau_plus':  20.0,
        'tau_minus': 20.0,
    }
    
    def __init__(self, tau_plus=20.0, tau_minus=20.0):
        """
        Create a new specification for the timing-dependence of an STDP rule.
        
        `tau_plus`  -- time constant of the positive part of the STDP curve, in
                       milliseconds.
        `tau_minus` -- time constant of the negative part of the STDP curve, in
                       milliseconds.
        """
        raise NotImplementedError #_abstract_method(self)