Exemple #1
0
class SpikeSourcePoisson(cells.SpikeSourcePoisson):
    """Spike source, generating spikes according to a Poisson process."""
    translations = common.build_translations(
        ('rate', 'rate'),
        ('start', 'start'),
        ('duration', 'duration'),
    )

    class rates(object):
        """
        Acts as a function of time for the PoissonGroup, while storing the
        parameters for later retrieval.
        """
        def __init__(self, start, duration, rate):
            self.start = start * ms
            self.duration = duration * ms
            self.rate = rate * Hz

        def __call__(self, t):
            #print t, self.start, self.duration, self.rate
            return (self.start <= t <=
                    self.start + self.duration) and self.rate or 0.0 * Hz

    def __init__(self, parameters):
        cells.SpikeSourcePoisson.__init__(self, parameters)
        start = self.parameters['start']
        duration = self.parameters['duration']
        rate = self.parameters['rate']
        self.fct = SpikeSourcePoisson.rates(start, duration, rate)
Exemple #2
0
class AdditivePotentiationMultiplicativeDepression(synapses.AdditivePotentiationMultiplicativeDepression):
    """
    The amplitude of the weight change depends on the current weight for
    depression (Dw propto w-w_min) and is fixed for potentiation.
    """
    translations = common.build_translations(
        ('w_max',     'Wex',  1e-9), # unit conversion
        ('w_min',     'w_min_always_zero_in_PCSIM'),
        ('A_plus',    'Apos', 1e-9), # Apos has the same units as the weight
        ('A_minus',   'Aneg', -1),   # Aneg is dimensionless
    )
    possible_models = stdp_synapse_models
    scales_with_weight = ['Wex', 'Apos']
    
    def __init__(self, w_min=0.0, w_max=1.0, A_plus=0.01, A_minus=0.01): # units?
        if w_min != 0:
            raise Exception("Non-zero minimum weight is not supported by PCSIM.")
        #synapses.AdditivePotentiationMultiplicativeDepression.__init__(self, w_min, w_max, A_plus, A_minus)
        parameters = dict(locals())
        parameters.pop('self')
        self.parameters = self.translate(parameters)
        self.parameters['useFroemkeDanSTDP'] = False
        self.parameters['mupos'] = 0.0
        self.parameters['muneg'] = 1.0
        self.parameters.pop('w_min_always_zero_in_PCSIM')
Exemple #3
0
class AdditiveWeightDependence(synapses.AdditiveWeightDependence):
    """
    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`.
    """

    translations = common.build_translations(
        ('w_max', 'Wmax', 1000.0),  # unit conversion
        ('w_min', 'w_min_always_zero_in_NEST'),
        ('A_plus', 'lambda'),
        ('A_minus', 'alpha', 'A_minus/A_plus', 'alpha*lambda'),
    )
    possible_models = set(['stdp_synapse'])  #,'stdp_synapse_hom'])

    def __init__(self,
                 w_min=0.0,
                 w_max=1.0,
                 A_plus=0.01,
                 A_minus=0.01):  # units?
        if w_min != 0:
            raise Exception(
                "Non-zero minimum weight is not supported by NEST.")
        #synapses.AdditiveWeightDependence.__init__(self, w_min, w_max, A_plus, A_minus)
        parameters = dict(locals())
        parameters.pop('self')
        self.parameters = self.translate(parameters)
        self.parameters['mu_plus'] = 0.0
        self.parameters['mu_minus'] = 0.0
Exemple #4
0
class IF_cond_alpha(cells.IF_cond_alpha):
    translations = common.build_translations(
        ('v_rest', 'v_rest', mV),
        ('v_reset', 'v_reset'),
        ('cm', 'c_m', nF),
        ('tau_m', 'tau_m', mV),
        ('tau_refrac', 'tau_refrac'),
        ('tau_syn_E', 'tau_syn_E', ms),
        ('tau_syn_I', 'tau_syn_I', ms),
        ('v_thresh', 'v_thresh'),
        ('i_offset', 'i_offset', nA),
        ('e_rev_E', 'e_rev_E', mV),
        ('e_rev_I', 'e_rev_I', mV),
        ('v_init', 'v_init', mV),
    )
    eqs = brian.Equations('''
        dv/dt  = (v_rest-v)/tau_m + (ge*(e_rev_E-v) + gi*(e_rev_I-v) + i_offset + i_inj)/c_m : mV
        dge/dt = (2.7182818284590451*ye-ge)/tau_syn_E  : uS
        dye/dt = -ye/tau_syn_E                         : uS
        dgi/dt = (2.7182818284590451*yi-gi)/tau_syn_I  : uS 
        dyi/dt = -yi/tau_syn_I                         : uS
        tau_syn_E                             : ms
        tau_syn_I                             : ms
        tau_m                                 : ms
        v_rest                                : mV
        e_rev_E                               : mV
        e_rev_I                               : mV
        c_m                                   : nF
        i_offset                              : nA
        i_inj                                 : nA
        ''')
    synapses = {'excitatory': 'ye', 'inhibitory': 'yi'}
Exemple #5
0
class GutigWeightDependence(synapses.GutigWeightDependence):
    """
    The amplitude of the weight change depends on the current weight.
    For depression, Dw propto w-w_min
    For potentiation, Dw propto w_max-w
    """
    translations = common.build_translations(
        ('w_max',     'Wex',  1e-9), # unit conversion
        ('w_min',     'w_min_always_zero_in_PCSIM'),
        ('A_plus',    'Apos'),
        ('A_minus',   'Aneg', -1),
        ('mu_plus',   'mupos'),
        ('mu_minus',  'muneg')
    )
    possible_models = stdp_synapse_models
    
    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): # units?
        if w_min != 0:
            raise Exception("Non-zero minimum weight is not supported by PCSIM.")
        #synapses.AdditivePotentiationMultiplicativeDepression.__init__(self, w_min, w_max, A_plus, A_minus)
        parameters = dict(locals())
        parameters.pop('self')
        self.parameters = self.translate(parameters)
        self.parameters['useFroemkeDanSTDP'] = False
        self.parameters.pop('w_min_always_zero_in_PCSIM')
Exemple #6
0
class IF_cond_exp(cells.IF_cond_exp):
    """Leaky integrate and fire model with fixed threshold and 
    exponentially-decaying post-synaptic conductance."""
    translations = common.build_translations(
        ('v_rest', 'v_rest', mV),
        ('v_reset', 'v_reset'),
        ('cm', 'cm', nF),
        ('tau_m', 'tau_m', ms),
        ('tau_refrac', 'tau_refrac'),
        ('tau_syn_E', 'tau_syn_E', ms),
        ('tau_syn_I', 'tau_syn_I', ms),
        ('v_thresh', 'v_thresh'),
        ('i_offset', 'i_offset', nA),
        ('e_rev_E', 'e_rev_E', mV),
        ('e_rev_I', 'e_rev_I', mV),
        ('v_init', 'v_init', mV),
    )
    eqs = brian.Equations('''
        dv/dt  = (v_rest-v)/tau_m + (ge*(e_rev_E-v) + gi*(e_rev_I-v) + i_offset + i_inj)/cm : mV
        dge/dt = -ge/tau_syn_E : uS
        dgi/dt = -gi/tau_syn_I : uS
        tau_syn_E              : ms
        tau_syn_I              : ms
        tau_m                  : ms
        cm                     : nF
        v_rest                 : mV
        e_rev_E                : mV
        e_rev_I                : mV
        i_offset               : nA
        i_inj                  : nA
        ''')
    synapses = {'excitatory': 'ge', 'inhibitory': 'gi'}
Exemple #7
0
class GutigWeightDependence(synapses.GutigWeightDependence):
    """
    The amplitude of the weight change depends on the current weight.
    For depression, Dw propto w-w_min
    For potentiation, Dw propto w_max-w
    """
    translations = common.build_translations(
        ('w_max', 'Wmax', 1000.0),  # unit conversion
        ('w_min', 'w_min_always_zero_in_NEST'),
        ('A_plus', 'lambda'),
        ('A_minus', 'alpha', 'A_minus/A_plus', 'alpha*lambda'),
        ('mu_plus', 'mu_plus'),
        ('mu_minus', 'mu_minus'),
    )
    possible_models = set(['stdp_synapse'])  #,'stdp_synapse_hom'])

    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):
        if w_min != 0:
            raise Exception(
                "Non-zero minimum weight is not supported by NEST.")
        #synapses.GutigWeightDependence.__init__(self, w_min, w_max, A_plus, A_minus)
        parameters = dict(locals())
        parameters.pop('self')
        self.parameters = self.translate(parameters)
Exemple #8
0
class IF_cond_exp_gsfa_grr(cells.IF_cond_exp_gsfa_grr):
    """
    Linear leaky integrate and fire model with fixed threshold,
    decaying-exponential post-synaptic conductance, conductance based spike-frequency adaptation,
    and a conductance-based relative refractory mechanism.

    See: Muller et al (2007) Spike-frequency adapting neural ensembles: Beyond mean-adaptation
    and renewal theories. Neural Computation 19: 2958-3010.

    See also: EIF_cond_alpha_isfa_ista
    """
    translations = common.build_translations(
        ('v_rest', 'E_L'),
        ('v_reset', 'V_reset'),
        ('cm', 'C_m', 1000.0),  # C_m is in pF, cm in nF
        ('tau_m', 'g_L', "cm/tau_m*1000.0", "C_m/g_L"),
        ('tau_refrac', 't_ref', "max(get_time_step(), tau_refrac)", "t_ref"),
        ('tau_syn_E', 'tau_syn_ex'),
        ('tau_syn_I', 'tau_syn_in'),
        ('v_thresh', 'V_th'),
        ('i_offset', 'I_e', 1000.0),  # I_e is in pA, i_offset in nA
        ('e_rev_E', 'E_ex'),
        ('e_rev_I', 'E_in'),
        ('v_init', 'v_init'),
        ('tau_sfa', 'tau_sfa'),
        ('e_rev_sfa', 'E_sfa'),
        ('q_sfa', 'q_sfa'),
        ('tau_rr', 'tau_rr'),
        ('e_rev_rr', 'E_rr'),
        ('q_rr', 'q_rr'))
    nest_name = "iaf_cond_exp_sfa_rr"
Exemple #9
0
class TsodyksMarkramMechanism(synapses.TsodyksMarkramMechanism):

    translations = common.build_translations(
        ('U', 'U'),
        ('tau_rec', 'tau_rec'),
        ('tau_facil', 'tau_facil'),
        ('u0', 'u0'),
        ('x0', 'x'),  # } note that these two values
        ('y0', 'y')  # } are not used
    )
    native_name = 'tsodkys-markram'

    def __init__(self,
                 U=0.5,
                 tau_rec=100.0,
                 tau_facil=0.0,
                 u0=0.0,
                 x0=1.0,
                 y0=0.0):
        assert (x0 == 1
                and y0 == 0), "It is not currently possible to set x0 and y0"
        #synapses.TsodyksMarkramMechanism.__init__(self, U, tau_rec, tau_facil, u0, x0, y0)
        self.parameters = self.translate({
            'U': U,
            'tau_rec': tau_rec,
            'tau_facil': tau_facil,
            'u0': u0,
            'x0': x0,
            'y0': y0
        })
Exemple #10
0
class TsodyksMarkramMechanism(synapses.TsodyksMarkramMechanism):

    translations = common.build_translations(
        ('U', 'U'),
        ('tau_rec', 'tau_rec'),
        ('tau_facil', 'tau_fac'),
        ('u0', 'u'),  # this could cause problems for reverse translation
        ('x0', 'x'),  # (as for V_m) in cell models, since the initial value
        ('y0', 'y')  # is not stored, only set.
    )
    native_name = 'tsodyks_synapse'

    def __init__(self,
                 U=0.5,
                 tau_rec=100.0,
                 tau_facil=0.0,
                 u0=0.0,
                 x0=1.0,
                 y0=0.0):
        #synapses.TsodyksMarkramMechanism.__init__(self, U, tau_rec, tau_facil, u0, x0, y0)
        parameters = dict(
            locals())  # need the dict to get a copy of locals. When running
        parameters.pop(
            'self'
        )  # through coverage.py, for some reason, the pop() doesn't have any effect
        self.parameters = self.translate(parameters)
Exemple #11
0
class EIF_cond_alpha_isfa_ista(cells.EIF_cond_alpha_isfa_ista):
    """
    Exponential integrate and fire neuron with spike triggered and sub-threshold
    adaptation currents (isfa, ista reps.) according to:
    
    Brette R and Gerstner W (2005) Adaptive Exponential Integrate-and-Fire Model as
    an Effective Description of Neuronal Activity. J Neurophysiol 94:3637-3642

    See also: IF_cond_exp_gsfa_grr
    """

    translations = common.build_translations(
        ('v_init', 'v_init'),
        ('w_init', 'w', 1000.0),  # nA -> pA
        ('cm', 'C_m', 1000.0),  # nF -> pF
        ('tau_refrac', 't_ref'),
        ('v_spike', 'V_peak'),
        ('v_reset', 'V_reset'),
        ('v_rest', 'E_L'),
        ('tau_m', 'g_L', "cm/tau_m*1000.0", "C_m/g_L"),
        ('i_offset', 'I_e', 1000.0),  # nA -> pA
        ('a', 'a'),
        ('b', 'b', 1000.0),  # nA -> pA.
        ('delta_T', 'Delta_T'),
        ('tau_w', 'tau_w'),
        ('v_thresh', 'V_th'),
        ('e_rev_E', 'E_ex'),
        ('tau_syn_E', 'tau_syn_ex'),
        ('e_rev_I', 'E_in'),
        ('tau_syn_I', 'tau_syn_in'),
    )
    nest_name = "aeif_cond_alpha"
Exemple #12
0
class IF_facets_hardware1(cells.IF_facets_hardware1):
    """
    Leaky integrate and fire model with fixed threshold and conductance-based synpases,
    describes the neuron model of the Spikey neuromorphic system.
    """

    translations = common.build_translations(
        ('v_reset',                  'v_reset'),
        ('v_rest',                   'v_rest'),
        ('v_thresh',                 'v_thresh'),
        ('e_rev_I',                  'e_rev_I'),
        ('g_leak',                   'g_leak'),
        ('tau_refrac',               'tau_refrac')
    )

    estimator_cm = 0.2
    estimator_e_rev_E = 0.0
    estimator_tau_syn_E = 5.0
    estimator_tau_syn_I = 5.0

    def __init__(self, parameters):

        # extend with Spikey specific neuron parameters
        cells.IF_facets_hardware1.__init__(self, parameters)
        self.parameters['lowlevel_parameters'] = {}
        self.parameters['estimator_cm'] = self.estimator_cm
        self.parameters['estimator_e_rev_E'] = self.estimator_e_rev_E
        self.parameters['estimator_tau_syn_E'] = self.estimator_tau_syn_E
        self.parameters['estimator_tau_syn_I'] = self.estimator_tau_syn_I
Exemple #13
0
class AdditiveWeightDependence(synapses.AdditiveWeightDependence):
    """
    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`.
    """

    translations = common.build_translations(
        ('w_max', 'wmax'),
        ('w_min', 'wmin'),
        ('A_plus', 'aLTP'),
        ('A_minus', 'aLTD'),
    )
    possible_models = set([
        'StdwaSA',
    ])

    def __init__(self,
                 w_min=0.0,
                 w_max=1.0,
                 A_plus=0.01,
                 A_minus=0.01):  # units?
        #synapses.AdditiveWeightDependence.__init__(self, w_min, w_max, A_plus, A_minus)
        self.parameters = self.translate({
            'w_min': w_min,
            'w_max': w_max,
            'A_plus': A_plus,
            'A_minus': A_minus
        })
Exemple #14
0
class IF_curr_alpha(cells.IF_curr_alpha):
    """Leaky integrate and fire model with fixed threshold and alpha-function-
    shaped post-synaptic current."""
    translations = common.build_translations(
        ('v_rest', 'v_rest', mV),
        ('v_reset', 'v_reset'),
        ('cm', 'c_m', nF),
        ('tau_m', 'tau_m', ms),
        ('tau_refrac', 'tau_refrac'),
        ('tau_syn_E', 'tau_syn_E', ms),
        ('tau_syn_I', 'tau_syn_I', ms),
        ('v_thresh', 'v_thresh'),
        ('i_offset', 'i_offset', nA),
        ('v_init', 'v_init', ms),
    )
    eqs = brian.Equations('''
        dv/dt  = (ge + gi + i_offset + i_inj)/c_m + (v_rest-v)/tau_m : mV
        dge/dt = (2.7182818284590451*ye-ge)/tau_syn_E : nA
        dye/dt = -ye/tau_syn_E                        : nA
        dgi/dt = (2.7182818284590451*yi-gi)/tau_syn_I : nA
        dyi/dt = -yi/tau_syn_I                        : nA
        c_m                                    : nF
        tau_syn_E                             : ms
        tau_syn_I                             : ms
        tau_m                                 : ms
        v_rest                                : mV
        i_offset                              : nA
        i_inj                                 : nA
        ''')
    synapses = {'excitatory': 'ye', 'inhibitory': 'yi'}
Exemple #15
0
class SpikeSourceArray(cells.SpikeSourceArray):
    """Spike source generating spikes at the times given in the spike_times array."""

    translations = common.build_translations(
        ('spike_times', 'spike_times'),
    )
    model = VectorSpikeSource
Exemple #16
0
class IF_facets_hardware1(cells.IF_facets_hardware1):
    """Leaky integrate and fire model with conductance-based synapses and fixed
    threshold as it is resembled by the FACETS Hardware Stage 1. For further
    details regarding the hardware model see the FACETS-internal Wiki:
    https://facets.kip.uni-heidelberg.de/private/wiki/index.php/WP7_NNM
    """

    translations = common.build_translations(
        ('v_rest',     'v_rest'),
        ('v_thresh',   'v_thresh'),
        ('v_reset',    'v_reset'),
        ('g_leak',     'tau_m',    "0.2*1000.0/g_leak", "0.2*1000.0/tau_m"),
        ('tau_syn_E',  'tau_e'),
        ('tau_syn_I',  'tau_i'),
        ('e_rev_I',    'e_i')
    )
    model = StandardIF

    def __init__(self, parameters):
        cells.IF_facets_hardware1.__init__(self, parameters)
        self.parameters['syn_type']  = 'conductance'
        self.parameters['syn_shape'] = 'exp'
        self.parameters['i_offset']  = 0.0
        self.parameters['c_m']       = 0.2
        self.parameters['t_refrac']  = 1.0
        self.parameters['e_e']       = 0.0
Exemple #17
0
class AdditiveWeightDependence(synapses.AdditiveWeightDependence):
    """
    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`.
    """
    
    translations = common.build_translations(
        ('w_max',     'Wex',  1e-9), # unit conversion. This exposes a limitation of the current
                                     # translation machinery, because this value depends on the
                                     # type of the post-synaptic cell. We currently work around
                                     # this using the "scales_with_weight" attribute, although
                                     # this breaks reverse translation.
        ('w_min',     'w_min_always_zero_in_PCSIM'),
        ('A_plus',    'Apos', '1e-9*A_plus*w_max', '1e9*Apos/w_max'),  # note that here Apos and Aneg
        ('A_minus',   'Aneg', '-1e-9*A_minus*w_max', '-1e9*Aneg/w_max'), # have the same units as the weight
    )
    possible_models = stdp_synapse_models
    scales_with_weight = ['Wex', 'Apos', 'Aneg']
    
    def __init__(self, w_min=0.0, w_max=1.0, A_plus=0.01, A_minus=0.01): # units?
        if w_min != 0:
            raise Exception("Non-zero minimum weight is not supported by PCSIM.")
        #synapses.AdditiveWeightDependence.__init__(self, w_min, w_max, A_plus, A_minus)
        parameters = dict(locals())
        parameters.pop('self')
        self.parameters = self.translate(parameters)
        self.parameters['useFroemkeDanSTDP'] = False
        self.parameters['mupos'] = 0.0
        self.parameters['muneg'] = 0.0
        self.parameters.pop('w_min_always_zero_in_PCSIM')
Exemple #18
0
class HH_cond_exp(cells.HH_cond_exp):
    
    translations = common.build_translations(
        ('gbar_Na',    'gbar_Na', 1e-6),   
        ('gbar_K',     'gbar_K', 1e-6),    
        ('g_leak',     'g_leak', 1e-6),    
        ('cm',         'c_m'),  
        ('v_offset',   'v_offset'),
        ('e_rev_Na',   'ena'),
        ('e_rev_K',    'ek'), 
        ('e_rev_leak', 'e_leak'),
        ('e_rev_E',    'e_e'),
        ('e_rev_I',    'e_i'),
        ('tau_syn_E',  'tau_e'),
        ('tau_syn_I',  'tau_i'),
        ('i_offset',   'i_offset'),
        ('v_init',     'v_init'),
    )
    model = SingleCompartmentTraub

    def __init__(self, parameters):
        cells.HH_cond_exp.__init__(self, parameters) # checks supplied parameters and adds default
                                                     # values for not-specified parameters.
        self.parameters['syn_type']  = 'conductance'
        self.parameters['syn_shape'] = 'exp'
Exemple #19
0
class IF_cond_exp(cells.IF_cond_exp):
    """Leaky integrate and fire model with fixed threshold and 
    exponentially-decaying post-synaptic conductance."""
    
    translations = common.build_translations(
        ('tau_m',      'tau_m'),
        ('cm',         'c_m'),
        ('v_rest',     'v_rest'),
        ('v_thresh',   'v_thresh'),
        ('v_reset',    'v_reset'),
        ('tau_refrac', 't_refrac'),
        ('i_offset',   'i_offset'),
        ('tau_syn_E',  'tau_e'),
        ('tau_syn_I',  'tau_i'),
        ('v_init',     'v_init'),
        ('e_rev_E',    'e_e'),
        ('e_rev_I',    'e_i')
    )
    model = StandardIF
    
    def __init__(self, parameters):
        cells.IF_cond_exp.__init__(self, parameters) # checks supplied parameters and adds default
                                                       # values for not-specified parameters.
        self.parameters['syn_type']  = 'conductance'
        self.parameters['syn_shape'] = 'exp'
Exemple #20
0
class IF_cond_exp(cells.IF_cond_exp):
    """Leaky integrate and fire model with fixed threshold and 
    exponentially-decaying post-synaptic conductance."""

    translations = common.build_translations(
        ('tau_m', 'taum', 1e-3),
        ('cm', 'Cm', 1e-9),
        ('v_rest', 'Vresting', 1e-3),
        ('v_thresh', 'Vthresh', 1e-3),
        ('v_reset', 'Vreset', 1e-3),
        ('tau_refrac', 'Trefract', 1e-3),
        ('i_offset', 'Iinject', 1e-9),
        ('tau_syn_E', 'TauSynExc', 1e-3),
        ('tau_syn_I', 'TauSynInh', 1e-3),
        ('e_rev_E', 'ErevExc', 1e-3),
        ('e_rev_I', 'ErevInh', 1e-3),
        ('v_init', 'Vinit', 1e-3),
    )
    pcsim_name = "LIFCondExpNeuron"
    simObjFactory = None
    setterMethods = {}
    recordable = ['spikes', 'v']

    def __init__(self, parameters):
        cells.IF_cond_exp.__init__(self, parameters)
        self.parameters['Inoise'] = 0.0
        self.simObjFactory = pypcsim.LIFCondExpNeuron(**self.parameters)
Exemple #21
0
class IF_curr_exp(cells.IF_curr_exp):
    """Leaky integrate and fire model with fixed threshold and
    decaying-exponential post-synaptic current. (Separate synaptic currents for
    excitatory and inhibitory synapses."""

    translations = common.build_translations(
        ('v_rest', 'v_rest', mV),
        ('v_reset', 'v_reset'),
        ('cm', 'c_m', nF),
        ('tau_m', 'tau_m', ms),
        ('tau_refrac', 'tau_refrac'),
        ('tau_syn_E', 'tau_syn_E', ms),
        ('tau_syn_I', 'tau_syn_I', ms),
        ('v_thresh', 'v_thresh'),
        ('i_offset', 'i_offset', nA),
        ('v_init', 'v_init', mV),
    )
    eqs = brian.Equations('''
        dv/dt  = (ie + ii + i_offset + i_inj)/c_m + (v_rest-v)/tau_m : mV
        die/dt = -ie/tau_syn_E                : nA
        dii/dt = -ii/tau_syn_I                : nA
        tau_syn_E                             : ms
        tau_syn_I                             : ms
        tau_m                                 : ms
        c_m                                   : nF
        v_rest                                : mV
        i_offset                              : nA
        i_inj                                 : nA
        ''')

    synapses = {'excitatory': 'ie', 'inhibitory': 'ii'}
Exemple #22
0
class SpikeSourcePoisson(cells.SpikeSourcePoisson):
    """Spike source, generating spikes according to a Poisson process."""

    translations = common.build_translations(
        ('start',    'start'),
        ('rate',     '_interval',  "1000.0/rate",  "1000.0/_interval"),
        ('duration', 'duration'),
    )
    model = RandomSpikeSource
Exemple #23
0
class SpikeSourceArray(cells.SpikeSourceArray):
    '''Spike source generating spikes at the times given in the spike_times array.'''

    translations = common.build_translations(
        ('spike_times',   'spike_times')
    )

    def __init__(self, parameters):

        cells.SpikeSourceArray.__init__(self, parameters)
        self.index = None
Exemple #24
0
class SpikeSourcePoisson(cells.SpikeSourcePoisson):
    """Spike source, generating spikes according to a Poisson process."""

    translations = common.build_translations(('start', 'Tstart', 1e-3),
                                             ('rate', 'rate'),
                                             ('duration', 'duration', 1e-3))
    pcsim_name = 'PoissonInputNeuron'
    simObjFactory = None
    setterMethods = {}

    def __init__(self, parameters):
        cells.SpikeSourcePoisson.__init__(self, parameters)
        self.simObjFactory = pypcsim.PoissonInputNeuron(**self.parameters)
Exemple #25
0
class SpikeSourcePoisson(cells.SpikeSourcePoisson):
    '''Spike source, generating spikes according to a Poisson process.'''

    translations = common.build_translations(
        ('rate',      'rate'),
        ('start',     'start'),
        ('duration',  'duration')
    )

    def __init__(self, parameters):

        cells.SpikeSourcePoisson.__init__(self, parameters)
        self.index = None
Exemple #26
0
class SpikePairRule(synapses.SpikePairRule):

    translations = common.build_translations(
        ('tau_plus', 'tau_plus'),
        ('tau_minus', 'tau_minus'),  # defined in post-synaptic neuron
    )
    possible_models = set(['stdp_synapse'])  #,'stdp_synapse_hom'])

    def __init__(self, tau_plus=20.0, tau_minus=20.0):
        #synapses.SpikePairRule.__init__(self, tau_plus, tau_minus)
        parameters = dict(locals())
        parameters.pop('self')
        self.parameters = self.translate(parameters)
Exemple #27
0
class SpikeSourcePoisson(cells.SpikeSourcePoisson):
    """Spike source, generating spikes according to a Poisson process."""

    translations = common.build_translations(
        ('rate', 'rate'),
        ('start', 'start'),
        ('duration', 'stop', "start+duration", "stop-start"),
    )
    nest_name = 'poisson_generator'
    always_local = True

    def __init__(self, parameters):
        cells.SpikeSourcePoisson.__init__(self, parameters)
        self.parameters['origin'] = 1.0
Exemple #28
0
class SpikePairRule(synapses.SpikePairRule):

    translations = common.build_translations(
        ('tau_plus', 'tauLTP'),
        ('tau_minus', 'tauLTD'),
    )
    possible_models = set(['StdwaSA', 'StdwaSoft', 'StdwaGuetig'])

    def __init__(self, tau_plus=20.0, tau_minus=20.0):
        #synapses.SpikePairRule.__init__(self, tau_plus, tau_minus)
        self.parameters = self.translate({
            'tau_plus': tau_plus,
            'tau_minus': tau_minus
        })
Exemple #29
0
class SpikePairRule(synapses.SpikePairRule):
    
    translations = common.build_translations(
        ('tau_plus',  'taupos', 1e-3),
        ('tau_minus', 'tauneg', 1e-3), 
    )
    possible_models = stdp_synapse_models
    
    def __init__(self, tau_plus=20.0, tau_minus=20.0):
        #synapses.SpikePairRule.__init__(self, tau_plus, tau_minus)
        parameters = dict(locals())
        parameters.pop('self')
        self.parameters = self.translate(parameters)
        self.parameters['STDPgap'] = 0.0
Exemple #30
0
class SpikeSourceArray(cells.SpikeSourceArray):
    """Spike source generating spikes at the times given in the spike_times array."""
    translations = common.build_translations(
        ('spike_times', 'spiketimes', ms), )

    @classmethod
    def translate(cls, parameters):
        if 'spike_times' in parameters:
            try:
                parameters['spike_times'] = numpy.array(
                    parameters['spike_times'], float)
            except ValueError:
                raise common.InvalidParameterValueError(
                    "spike times must be floats")
        return super(SpikeSourceArray, cls).translate(parameters)