Skip to content

Neuron Models

Artificial Neurons#

IntegratorNeuron #

Bases: Neuron

TEMPLATE

Integrator Neuron for stop_condition in spiking models.

The variable g_ampa increases for incoming spikes (target ampa) and decreases exponentially with time constant tau. If g_ampa reaches a threshold, the neuron's variable decision, which is by default -1, changes to the neuron_id. This can be used to cause the stop_condition of ANNarchy's simulate_until() function (stop_codnition="decision>=0 : any"). In case of multiple integrator neurons, the neuron_id can be used to identify the neuron that reached the threshold.

Warning

You have to define the variable neuron_id for each neuron in the Integrator population.

Parameters:

Name Type Description Default
tau float

Time constant in ms of the neuron. Default: 1.

1
threshold float

Threshold for the decision g_ampa has to reach. Default: 1.

1

Examples:

from ANNarchy import Population, simulate_until
from CompNeuroPy.neuron_models import Integrator

# Create a population of 10 integrator neurons
integrator_neurons = Population(
    geometry=10,
    neuron=IntegratorNeuron(tau=1, threshold=1),
    stop_condition="decision>=0 : any",
    name="integrator_neurons",)

# set the neuron_id for each neuron
integrator_neurons.neuron_id = range(10)

# simulate until one neuron reaches the threshold
simulate_until(max_duration=1000, population=integrator_neurons)

# check if simulation stop due to stop_codnition and which neuron reached the
# threshold
if (integrator_neurons.decision >= 0).any():
    neurons_reached_thresh = integrator_neurons.neuron_id[
        integrator_neurons.decision >= 0
    ]
    print(f"Neuron(s) {neurons_reached_thresh} reached threshold.")
else:
    print("No neuron reached threshold.")
Variables to record
  • g_ampa
  • decision
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/artificial_nm.py
 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
class IntegratorNeuron(Neuron):
    """
    TEMPLATE

    Integrator Neuron for stop_condition in spiking models.

    The variable g_ampa increases for incoming spikes (target ampa) and decreases
    exponentially with time constant tau. If g_ampa reaches a threshold, the neuron's
    variable decision, which is by default -1, changes to the neuron_id. This can be
    used to cause the stop_condition of ANNarchy's simulate_until() function
    (stop_codnition="decision>=0 : any"). In case of multiple integrator neurons,
    the neuron_id can be used to identify the neuron that reached the threshold.

    !!! warning
        You have to define the variable neuron_id for each neuron in the Integrator
        population.

    Parameters:
        tau (float, optional):
            Time constant in ms of the neuron. Default: 1.
        threshold (float, optional):
            Threshold for the decision g_ampa has to reach. Default: 1.

    Examples:
        ```python
        from ANNarchy import Population, simulate_until
        from CompNeuroPy.neuron_models import Integrator

        # Create a population of 10 integrator neurons
        integrator_neurons = Population(
            geometry=10,
            neuron=IntegratorNeuron(tau=1, threshold=1),
            stop_condition="decision>=0 : any",
            name="integrator_neurons",)

        # set the neuron_id for each neuron
        integrator_neurons.neuron_id = range(10)

        # simulate until one neuron reaches the threshold
        simulate_until(max_duration=1000, population=integrator_neurons)

        # check if simulation stop due to stop_codnition and which neuron reached the
        # threshold
        if (integrator_neurons.decision >= 0).any():
            neurons_reached_thresh = integrator_neurons.neuron_id[
                integrator_neurons.decision >= 0
            ]
            print(f"Neuron(s) {neurons_reached_thresh} reached threshold.")
        else:
            print("No neuron reached threshold.")
        ```

    Variables to record:
        - g_ampa
        - decision
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(self, tau: float = 1, threshold: float = 1):
        # Create the arguments
        parameters = f"""
            tau = {tau} : population
            threshold = {threshold} : population
            neuron_id = 0
        """

        super().__init__(
            parameters=parameters,
            equations="""
                dg_ampa/dt = - g_ampa / tau
                ddecision/dt = 0 : init = -1
            """,
            spike="""
                g_ampa >= threshold
            """,
            reset="""
                decision = neuron_id
            """,
            name="integrator_neuron",
            description="""
                Integrator Neuron, which integrates incoming spikes with value g_ampa
                and emits a spike when reaching a threshold. After spike decision
                changes, which can be used as for stop condition""",
        )

        # For reporting
        self._instantiated.append(True)

IntegratorNeuronSimple #

Bases: Neuron

TEMPLATE

Integrator Neuron for stop_condition in spiking models.

The variable g_ampa increases for incoming spikes (target ampa) and decreases exponentially with time constant tau. You can check g_ampa and use it for the stop_condition of ANNarchy's simulate_until() function (stop_codnition="g_ampa>=some_value : any"). In case of multiple integrator neurons, the neuron_id can be used to identify the neuron that reached the threshold.

Warning

You have to define the variable neuron_id for each neuron in the Integrator population.

Parameters:

Name Type Description Default
tau float

Time constant in ms of the neuron. Default: 1.

1

Examples:

from ANNarchy import Population, simulate_until
from CompNeuroPy.neuron_models import Integrator

# Create a population of 10 integrator neurons
integrator_neurons = Population(
    geometry=10,
    neuron=IntegratorNeuronSimple(tau=1),
    stop_condition="g_ampa>=5 : any",
    name="integrator_neurons",)

# set the neuron_id for each neuron
integrator_neurons.neuron_id = range(10)

# simulate until one neuron reaches the threshold
simulate_until(max_duration=1000, population=integrator_neurons)

# check if simulation stop due to stop_codnition and which neuron reached the
# threshold
if (integrator_neurons.g_ampa >= 5).any():
    neurons_reached_thresh = integrator_neurons.neuron_id[
        integrator_neurons.g_ampa >= 5
    ]
    print(f"Neuron(s) {neurons_reached_thresh} reached threshold.")
else:
    print("No neuron reached threshold.")
Variables to record
  • g_ampa
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/artificial_nm.py
 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
class IntegratorNeuronSimple(Neuron):
    """
    TEMPLATE

    Integrator Neuron for stop_condition in spiking models.

    The variable g_ampa increases for incoming spikes (target ampa) and decreases
    exponentially with time constant tau. You can check g_ampa and use it for the
    stop_condition of ANNarchy's simulate_until() function
    (stop_codnition="g_ampa>=some_value : any"). In case of multiple integrator neurons,
    the neuron_id can be used to identify the neuron that reached the threshold.

    !!! warning
        You have to define the variable neuron_id for each neuron in the Integrator
        population.

    Parameters:
        tau (float, optional):
            Time constant in ms of the neuron. Default: 1.

    Examples:
        ```python
        from ANNarchy import Population, simulate_until
        from CompNeuroPy.neuron_models import Integrator

        # Create a population of 10 integrator neurons
        integrator_neurons = Population(
            geometry=10,
            neuron=IntegratorNeuronSimple(tau=1),
            stop_condition="g_ampa>=5 : any",
            name="integrator_neurons",)

        # set the neuron_id for each neuron
        integrator_neurons.neuron_id = range(10)

        # simulate until one neuron reaches the threshold
        simulate_until(max_duration=1000, population=integrator_neurons)

        # check if simulation stop due to stop_codnition and which neuron reached the
        # threshold
        if (integrator_neurons.g_ampa >= 5).any():
            neurons_reached_thresh = integrator_neurons.neuron_id[
                integrator_neurons.g_ampa >= 5
            ]
            print(f"Neuron(s) {neurons_reached_thresh} reached threshold.")
        else:
            print("No neuron reached threshold.")
        ```

    Variables to record:
        - g_ampa
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(self, tau: float = 1):
        # Create the arguments
        parameters = f"""
            tau = {tau} : population
            neuron_id = 0
        """

        super().__init__(
            parameters=parameters,
            equations="""
                dg_ampa/dt = - g_ampa / tau
                r = 0
            """,
            name="integrator_neuron_simple",
            description="""
                Integrator Neuron, which integrates incoming spikes with value g_ampa,
                which can be used as a stop condition
            """,
        )

        # For reporting
        self._instantiated.append(True)

PoissonNeuron #

Bases: Neuron

TEMPLATE

Poisson neuron whose rate can be specified and is reached instantaneous. The neuron emits spikes following a Poisson distribution, the average firing rate is given by the parameter rates.

Parameters:

Name Type Description Default
rates float

The average firing rate of the neuron in Hz. Default: 0.

0
Variables to record
  • p
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/artificial_nm.py
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
class PoissonNeuron(Neuron):
    """
    TEMPLATE

    Poisson neuron whose rate can be specified and is reached instantaneous. The
    neuron emits spikes following a Poisson distribution, the average firing rate
    is given by the parameter rates.

    Parameters:
        rates (float, optional):
            The average firing rate of the neuron in Hz. Default: 0.

    Variables to record:
        - p
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(self, rates: float = 0):
        # Create the arguments
        parameters = f"""
            rates = {rates}
        """

        super().__init__(
            parameters=parameters,
            equations="""
                p = Uniform(0.0, 1.0) * 1000.0 / dt
            """,
            spike="""
                p <= rates
            """,
            reset="""
                p = 0.0
            """,
            name="poisson_neuron",
            description="""
                Poisson neuron whose rate can be specified and is reached instantaneous.
            """,
        )

        # For reporting
        self._instantiated.append(True)

PoissonNeuronUpDown #

Bases: Neuron

TEMPLATE

The neuron emits spikes following a Poisson distribution, the average firing rate is given by the parameter rates and is reached with time constants tau_up and tau_down.

Attributes:

Name Type Description
rates float

The average firing rate of the neuron in Hz. Default: 0.

tau_up float

Time constant in ms for increasing the firing rate. Default: 1.

tau_down float

Time constant in ms for decreasing the firing rate. Default: 1.

Source code in src/CompNeuroPy/neuron_models/final_models/artificial_nm.py
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
class PoissonNeuronUpDown(Neuron):
    """
    TEMPLATE

    The neuron emits spikes following a Poisson distribution, the average firing rate is
    given by the parameter rates and is reached with time constants tau_up and tau_down.

    Attributes:
        rates (float, optional):
            The average firing rate of the neuron in Hz. Default: 0.
        tau_up (float, optional):
            Time constant in ms for increasing the firing rate. Default: 1.
        tau_down (float, optional):
            Time constant in ms for decreasing the firing rate. Default: 1.
    """

    # For reporting
    _instantiated = []

    def __init__(self, rates: float = 0, tau_up: float = 1, tau_down: float = 1):
        # Create the arguments
        parameters = f"""
            rates = {rates}
            tau_up = {tau_up}
            tau_down = {tau_down}
        """

        super().__init__(
            parameters=parameters,
            equations="""
                p = Uniform(0.0, 1.0) * 1000.0 / dt
                dact/dt = if (rates - act) > 0:
                              (rates - act) / tau_up
                          else:
                              (rates - act) / tau_down
            """,
            spike="""
                p <= act
            """,
            reset="""
                p = 0.0
            """,
            name="poisson_neuron_up_down",
            description="""Poisson neuron whose rate can be specified and is reached
                with time constants tau_up and tau_down.
            """,
        )

        # For reporting
        self._instantiated.append(True)

PoissonNeuronSin #

Bases: Neuron

TEMPLATE

Neuron emitting spikes following a Poisson distribution, the average firing rate is given by a sinus function.

Parameters:

Name Type Description Default
amplitude float

Amplitude of the sinus function. Default: 0.

0
base float

Base (offset) of the sinus function. Default: 0.

0
frequency float

Frequency of the sinus function. Default: 0.

0
phase float

Phase of the sinus function. Default: 0.

0
Variables to record
  • rates
  • p
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/artificial_nm.py
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
class PoissonNeuronSin(Neuron):
    """
    TEMPLATE

    Neuron emitting spikes following a Poisson distribution, the average firing rate
    is given by a sinus function.

    Parameters:
        amplitude (float, optional):
            Amplitude of the sinus function. Default: 0.
        base (float, optional):
            Base (offset) of the sinus function. Default: 0.
        frequency (float, optional):
            Frequency of the sinus function. Default: 0.
        phase (float, optional):
            Phase of the sinus function. Default: 0.

    Variables to record:
        - rates
        - p
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        amplitude: float = 0,
        base: float = 0,
        frequency: float = 0,
        phase: float = 0,
    ):
        # Create the arguments
        parameters = f"""
            amplitude = {amplitude}
            base = {base}
            frequency = {frequency}
            phase = {phase}
        """

        super().__init__(
            parameters=parameters,
            equations="""
                rates = amplitude * sin((2*pi*frequency)*(t/1000-phase)) + base
                p     = Uniform(0.0, 1.0) * 1000.0 / dt
            """,
            spike="""
                p <= rates
            """,
            reset="""
                p = 0.0
            """,
            name="poisson_neuron_sin",
            description="Poisson neuron whose rate varies with a sinus function.",
        )

        # For reporting
        self._instantiated.append(True)

Hodgkin Huxley Neurons#

HHneuronBischop #

Bases: _HHneuron

PREDEFINED

Hodgkin Huxley neuron model for striatal FSI from Bischop et al. (2012).

Variables to record
  • prev_v
  • I_L
  • alpha_h
  • beta_h
  • h_inf
  • tau_h
  • h
  • alpha_m
  • beta_m
  • m_inf
  • m
  • I_Na
  • alpha_n1
  • beta_n1
  • n1_inf
  • tau_n1
  • n1
  • I_Kv1
  • alpha_n3
  • beta_n3
  • n3_inf
  • tau_n3
  • n3
  • I_Kv3
  • PV
  • PV_Mg
  • dPV_Ca_dt
  • PV_Ca
  • Ca
  • k_inf
  • tau_k
  • k
  • I_SK
  • a_inf
  • a
  • I_Ca
  • v
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/H_and_H_like_nm.py
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
class HHneuronBischop(_HHneuron):
    """
    PREDEFINED

    Hodgkin Huxley neuron model for striatal FSI from
    [Bischop et al. (2012)](https://doi.org/10.3389/fnmol.2012.00078).

    Variables to record:
        - prev_v
        - I_L
        - alpha_h
        - beta_h
        - h_inf
        - tau_h
        - h
        - alpha_m
        - beta_m
        - m_inf
        - m
        - I_Na
        - alpha_n1
        - beta_n1
        - n1_inf
        - tau_n1
        - n1
        - I_Kv1
        - alpha_n3
        - beta_n3
        - n3_inf
        - tau_n3
        - n3
        - I_Kv3
        - PV
        - PV_Mg
        - dPV_Ca_dt
        - PV_Ca
        - Ca
        - k_inf
        - tau_k
        - k
        - I_SK
        - a_inf
        - a
        - I_Ca
        - v
        - r
    """

    def __init__(self):
        self.bischop = _BischopStrings()

        super().__init__()

    def _get_parameters(self):
        return self.bischop.parameters_base

    def _get_equations(self):
        return self.bischop.equations_base + self.bischop.membrane_base

    def _get_name(self):
        return "H_and_H_Bischop"

    def _get_description(self):
        return (
            "Hodgkin Huxley neuron model for striatal FSI from Bischop et al. (2012)."
        )

HHneuronBischopSyn #

Bases: _HHneuron

PREDEFINED

Hodgkin Huxley neuron model for striatal FSI from Bischop et al. (2012) with conductance-based synapses/currents for AMPA and GABA.

Variables to record
  • g_ampa
  • g_gaba
  • prev_v
  • I_L
  • alpha_h
  • beta_h
  • h_inf
  • tau_h
  • h
  • alpha_m
  • beta_m
  • m_inf
  • m
  • I_Na
  • alpha_n1
  • beta_n1
  • n1_inf
  • tau_n1
  • n1
  • I_Kv1
  • alpha_n3
  • beta_n3
  • n3_inf
  • tau_n3
  • n3
  • I_Kv3
  • PV
  • PV_Mg
  • dPV_Ca_dt
  • PV_Ca
  • Ca
  • k_inf
  • tau_k
  • k
  • I_SK
  • a_inf
  • a
  • I_Ca
  • v
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/H_and_H_like_nm.py
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
class HHneuronBischopSyn(_HHneuron):
    """
    PREDEFINED

    Hodgkin Huxley neuron model for striatal FSI from
    [Bischop et al. (2012)](https://doi.org/10.3389/fnmol.2012.00078) with
    conductance-based synapses/currents for AMPA and GABA.

    Variables to record:
        - g_ampa
        - g_gaba
        - prev_v
        - I_L
        - alpha_h
        - beta_h
        - h_inf
        - tau_h
        - h
        - alpha_m
        - beta_m
        - m_inf
        - m
        - I_Na
        - alpha_n1
        - beta_n1
        - n1_inf
        - tau_n1
        - n1
        - I_Kv1
        - alpha_n3
        - beta_n3
        - n3_inf
        - tau_n3
        - n3
        - I_Kv3
        - PV
        - PV_Mg
        - dPV_Ca_dt
        - PV_Ca
        - Ca
        - k_inf
        - tau_k
        - k
        - I_SK
        - a_inf
        - a
        - I_Ca
        - v
        - r
    """

    def __init__(self):
        self.bischop = _BischopStrings()

        super().__init__()

    def _get_parameters(self):
        return self.bischop.parameters_conductance

    def _get_equations(self):
        return self.bischop.equations_conductance + self.bischop.membrane_conductance

    def _get_name(self):
        return "H_and_H_Bischop_syn"

    def _get_description(self):
        return """
                Hodgkin Huxley neuron model for striatal FSI from Bischop et al. (2012)
                with conductance-based synapses/currents for AMPA and GABA.
            """

HHneuronCorbit #

Bases: _HHneuron

PREDEFINED

Hodgkin Huxley neuron model for striatal FSI from Corbit et al. (2016).

Variables to record
  • prev_v
  • I_L
  • m_Na
  • h_Na
  • I_Na
  • n_Kv3_inf
  • tau_n_Kv3_inf
  • n_Kv3
  • I_Kv3
  • m_Kv1
  • h_Kv1
  • I_Kv1
  • v
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/H_and_H_like_nm.py
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
class HHneuronCorbit(_HHneuron):
    """
    PREDEFINED

    Hodgkin Huxley neuron model for striatal FSI from
    [Corbit et al. (2016)](https://doi.org/10.1523/JNEUROSCI.0339-16.2016).

    Variables to record:
        - prev_v
        - I_L
        - m_Na
        - h_Na
        - I_Na
        - n_Kv3_inf
        - tau_n_Kv3_inf
        - n_Kv3
        - I_Kv3
        - m_Kv1
        - h_Kv1
        - I_Kv1
        - v
        - r
    """

    def __init__(self):
        self.corbit = _CorbitStrings()

        super().__init__()

    def _get_parameters(self):
        return self.corbit.parameters_base

    def _get_equations(self):
        return self.corbit.equations_base + self.corbit.membrane_base

    def _get_name(self):
        return "H_and_H_Corbit"

    def _get_description(self):
        return "Hodgkin Huxley neuron model for striatal FSI from Corbit et al. (2016)."

HHneuronCorbitSyn #

Bases: _HHneuron

PREDEFINED

Hodgkin Huxley neuron model for striatal FSI from Corbit et al. (2016) with conductance-based synapses/currents for AMPA and GABA.

Variables to record
  • g_ampa
  • g_gaba
  • prev_v
  • I_L
  • m_Na
  • h_Na
  • I_Na
  • n_Kv3_inf
  • tau_n_Kv3_inf
  • n_Kv3
  • I_Kv3
  • m_Kv1
  • h_Kv1
  • I_Kv1
  • v
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/H_and_H_like_nm.py
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
class HHneuronCorbitSyn(_HHneuron):
    """
    PREDEFINED

    Hodgkin Huxley neuron model for striatal FSI from
    [Corbit et al. (2016)](https://doi.org/10.1523/JNEUROSCI.0339-16.2016) with
    conductance-based synapses/currents for AMPA and GABA.

    Variables to record:
        - g_ampa
        - g_gaba
        - prev_v
        - I_L
        - m_Na
        - h_Na
        - I_Na
        - n_Kv3_inf
        - tau_n_Kv3_inf
        - n_Kv3
        - I_Kv3
        - m_Kv1
        - h_Kv1
        - I_Kv1
        - v
        - r
    """

    def __init__(self):
        self.corbit = _CorbitStrings()

        super().__init__()

    def _get_parameters(self):
        return self.corbit.parameters_conductance

    def _get_equations(self):
        return self.corbit.equations_conductance + self.corbit.membrane_conductance

    def _get_name(self):
        return "H_and_H_Corbit_syn"

    def _get_description(self):
        return """
                Hodgkin Huxley neuron model for striatal FSI from Corbit et al. (2016)
                with conductance-based synapses/currents for AMPA and GABA.
            """

HHneuronCorbitVoltageClamp #

Bases: _HHneuron

PREDEFINED

Hodgkin Huxley neuron model for striatal FSI from Corbit et al. (2016) with voltage clamp. Membrane potential v is clamped and I_inf can be recorded.

Variables to record
  • prev_v
  • I_L
  • m_Na
  • h_Na
  • I_Na
  • n_Kv3_inf
  • tau_n_Kv3_inf
  • n_Kv3
  • I_Kv3
  • m_Kv1
  • h_Kv1
  • I_Kv1
  • v
  • I_inf
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/H_and_H_like_nm.py
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
class HHneuronCorbitVoltageClamp(_HHneuron):
    """
    PREDEFINED

    Hodgkin Huxley neuron model for striatal FSI from
    [Corbit et al. (2016)](https://doi.org/10.1523/JNEUROSCI.0339-16.2016) with
    voltage clamp. Membrane potential v is clamped and I_inf can be recorded.

    Variables to record:
        - prev_v
        - I_L
        - m_Na
        - h_Na
        - I_Na
        - n_Kv3_inf
        - tau_n_Kv3_inf
        - n_Kv3
        - I_Kv3
        - m_Kv1
        - h_Kv1
        - I_Kv1
        - v
        - I_inf
        - r
    """

    def __init__(self):
        self.corbit = _CorbitStrings()

        super().__init__()

    def _get_parameters(self):
        return self.corbit.parameters_base

    def _get_equations(self):
        return self.corbit.equations_base + self.corbit.membrane_voltage_clamp

    def _get_name(self):
        return "H_and_H_Corbit_voltage_clamp"

    def _get_description(self):
        return """
                Hodgkin Huxley neuron model for striatal FSI from Corbit et al. (2016)
                with voltage clamp.
            """

Izhikevich (2003)-like Neurons#

Izhikevich2003FixedNoisyAmpa #

Bases: Neuron

TEMPLATE

Izhikevich (2003)-like neuron model with additional conductance based synapses for AMPA and GABA currents with noise in AMPA conductance. Fixed means, the 3 factors of the quadratic equation cannot be changed.

Parameters:

Name Type Description Default
a float

Time constant of the recovery variable u.

0
b float

Sensitivity of the recovery variable u to the membrane potential v.

0
c float

After-spike reset value of the membrane potential v.

0
d float

After-spike change of the recovery variable u.

0
tau_ampa float

Time constant of the AMPA conductance.

1
tau_gaba float

Time constant of the GABA conductance.

1
E_ampa float

Reversal potential of the AMPA conductance.

0
E_gaba float

Reversal potential of the GABA conductance.

0
I_app float

External applied current.

0
increase_noise float

Increase of the Poisson distributed (equivalent to a Poisson distributed spike train as input) noise in the AMPA conductance.

0
rates_noise float

Rate of the Poisson distributed noise in the AMPA conductance.

0
Variables to record
  • g_ampa
  • g_gaba
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2003_like_nm.py
  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
class Izhikevich2003FixedNoisyAmpa(Neuron):
    """
    TEMPLATE

    [Izhikevich (2003)](https://doi.org/10.1109/TNN.2003.820440)-like neuron model with
    additional conductance based synapses for AMPA and GABA currents with noise in AMPA
    conductance. Fixed means, the 3 factors of the quadratic equation cannot be changed.

    Parameters:
        a (float, optional):
            Time constant of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential v.
        d (float, optional):
            After-spike change of the recovery variable u.
        tau_ampa (float, optional):
            Time constant of the AMPA conductance.
        tau_gaba (float, optional):
            Time constant of the GABA conductance.
        E_ampa (float, optional):
            Reversal potential of the AMPA conductance.
        E_gaba (float, optional):
            Reversal potential of the GABA conductance.
        I_app (float, optional):
            External applied current.
        increase_noise (float, optional):
            Increase of the Poisson distributed (equivalent to a Poisson distributed
            spike train as input) noise in the AMPA conductance.
        rates_noise (float, optional):
            Rate of the Poisson distributed noise in the AMPA conductance.

    Variables to record:
        - g_ampa
        - g_gaba
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        a: float = 0,
        b: float = 0,
        c: float = 0,
        d: float = 0,
        tau_ampa: float = 1,
        tau_gaba: float = 1,
        E_ampa: float = 0,
        E_gaba: float = 0,
        I_app: float = 0,
        increase_noise: float = 0,
        rates_noise: float = 0,
    ):
        # Create the arguments
        parameters = f"""
            a              = {a} : population
            b              = {b} : population
            c              = {c} : population
            d              = {d} : population
            tau_ampa       = {tau_ampa} : population
            tau_gaba       = {tau_gaba} : population
            E_ampa         = {E_ampa} : population
            E_gaba         = {E_gaba} : population
            I_app          = {I_app}
            increase_noise = {increase_noise} : population
            rates_noise    = {rates_noise}
        """

        super().__init__(
            parameters=parameters,
            equations="""
                dg_ampa/dt = ite(Uniform(0.0, 1.0) * 1000.0 / dt > rates_noise, -g_ampa/tau_ampa, -g_ampa/tau_ampa + increase_noise/dt)
                dg_gaba/dt = -g_gaba / tau_gaba
                dv/dt      = 0.04 * v * v + 5 * v + 140 - u + I_app - neg(g_ampa*(v - E_ampa)) - pos(g_gaba*(v - E_gaba))
                du/dt      = a * (b * v - u)
            """,
            spike="""
                v >= 30
            """,
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2003_fixed_noisy_AMPA",
            description="""
                Standard neuron model from Izhikevich (2003) with additional
                conductance-based synapses for AMPA and GABA currents with noise in AMPA
                conductance.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2003NoisyAmpa #

Bases: Neuron

TEMPLATE

Izhikevich (2003)-like neuron model with additional conductance based synapses for AMPA and GABA currents with noise in AMPA conductance.

Parameters:

Name Type Description Default
a float

Time constant of the recovery variable u.

0
b float

Sensitivity of the recovery variable u to the membrane potential v.

0
c float

After-spike reset value of the membrane potential v.

0
d float

After-spike change of the recovery variable u.

0
n2 float

Factor of the quadratic equation of the membrane potential v.

0
n1 float

Factor of the quadratic equation of the membrane potential v.

0
n0 float

Factor of the quadratic equation of the membrane potential v.

0
tau_ampa float

Time constant of the AMPA conductance.

1
tau_gaba float

Time constant of the GABA conductance.

1
E_ampa float

Reversal potential of the AMPA conductance.

0
E_gaba float

Reversal potential of the GABA conductance.

0
I_app float

External applied current.

0
increase_noise float

Increase of the Poisson distributed (equivalent to a Poisson distributed spike train as input) noise in the AMPA conductance.

0
rates_noise float

Rate of the Poisson distributed noise in the AMPA conductance.

0
Variables to record
  • g_ampa
  • g_gaba
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2003_like_nm.py
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
204
205
206
207
208
209
210
211
212
213
214
215
class Izhikevich2003NoisyAmpa(Neuron):
    """
    TEMPLATE

    [Izhikevich (2003)](https://doi.org/10.1109/TNN.2003.820440)-like neuron model with
    additional conductance based synapses for AMPA and GABA currents with noise in AMPA
    conductance.

    Parameters:
        a (float, optional):
            Time constant of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential v.
        d (float, optional):
            After-spike change of the recovery variable u.
        n2 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        n1 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        n0 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        tau_ampa (float, optional):
            Time constant of the AMPA conductance.
        tau_gaba (float, optional):
            Time constant of the GABA conductance.
        E_ampa (float, optional):
            Reversal potential of the AMPA conductance.
        E_gaba (float, optional):
            Reversal potential of the GABA conductance.
        I_app (float, optional):
            External applied current.
        increase_noise (float, optional):
            Increase of the Poisson distributed (equivalent to a Poisson distributed
            spike train as input) noise in the AMPA conductance.
        rates_noise (float, optional):
            Rate of the Poisson distributed noise in the AMPA conductance.

    Variables to record:
        - g_ampa
        - g_gaba
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        a: float = 0,
        b: float = 0,
        c: float = 0,
        d: float = 0,
        n2: float = 0,
        n1: float = 0,
        n0: float = 0,
        tau_ampa: float = 1,
        tau_gaba: float = 1,
        E_ampa: float = 0,
        E_gaba: float = 0,
        I_app: float = 0,
        increase_noise: float = 0,
        rates_noise: float = 0,
    ):
        # Create the arguments
        parameters = f"""
            a              = {a} : population
            b              = {b} : population
            c              = {c} : population
            d              = {d} : population
            n2             = {n2} : population
            n1             = {n1} : population
            n0             = {n0} : population
            tau_ampa       = {tau_ampa} : population
            tau_gaba       = {tau_gaba} : population
            E_ampa         = {E_ampa} : population
            E_gaba         = {E_gaba} : population
            I_app          = {I_app}
            increase_noise = {increase_noise} : population
            rates_noise    = {rates_noise}
        """

        super().__init__(
            parameters=parameters,
            equations="""
                dg_ampa/dt = ite(Uniform(0.0, 1.0) * 1000.0 / dt > rates_noise, -g_ampa/tau_ampa, -g_ampa/tau_ampa + increase_noise/dt)
                dg_gaba/dt = -g_gaba / tau_gaba
                dv/dt      = n2 * v * v + n1 * v + n0 - u + I_app - neg(g_ampa*(v - E_ampa)) - pos(g_gaba*(v - E_gaba))
                du/dt      = a * (b * v - u)
            """,
            spike="""
                v >= 30
            """,
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2003_noisy_AMPA",
            description="""
                Neuron model from Izhikevich (2003). With additional conductance based
                synapses for AMPA and GABA currents with noise in AMPA conductance.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2003NoisyAmpaNonlin #

Bases: Neuron

TEMPLATE

Izhikevich (2003)-like neuron model with additional conductance based synapses for AMPA and GABA currents with noise in AMPA conductance. With nonlinear function for external current.

Parameters:

Name Type Description Default
a float

Time constant of the recovery variable u.

0
b float

Sensitivity of the recovery variable u to the membrane potential v.

0
c float

After-spike reset value of the membrane potential v.

0
d float

After-spike change of the recovery variable u.

0
n2 float

Factor of the quadratic equation of the membrane potential v.

0
n1 float

Factor of the quadratic equation of the membrane potential v.

0
n0 float

Factor of the quadratic equation of the membrane potential v.

0
tau_ampa float

Time constant of the AMPA conductance.

1
tau_gaba float

Time constant of the GABA conductance.

1
E_ampa float

Reversal potential of the AMPA conductance.

0
E_gaba float

Reversal potential of the GABA conductance.

0
I_app float

External applied current.

0
increase_noise float

Increase of the Poisson distributed (equivalent to a Poisson distributed spike train as input) noise in the AMPA conductance.

0
rates_noise float

Rate of the Poisson distributed noise in the AMPA conductance.

0
nonlin float

Exponent of the nonlinear function for the external current.

1
Variables to record
  • g_ampa
  • g_gaba
  • I
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2003_like_nm.py
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
class Izhikevich2003NoisyAmpaNonlin(Neuron):
    """
    TEMPLATE

    [Izhikevich (2003)](https://doi.org/10.1109/TNN.2003.820440)-like neuron model with
    additional conductance based synapses for AMPA and GABA currents with noise in AMPA
    conductance. With nonlinear function for external current.

    Parameters:
        a (float, optional):
            Time constant of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential v.
        d (float, optional):
            After-spike change of the recovery variable u.
        n2 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        n1 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        n0 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        tau_ampa (float, optional):
            Time constant of the AMPA conductance.
        tau_gaba (float, optional):
            Time constant of the GABA conductance.
        E_ampa (float, optional):
            Reversal potential of the AMPA conductance.
        E_gaba (float, optional):
            Reversal potential of the GABA conductance.
        I_app (float, optional):
            External applied current.
        increase_noise (float, optional):
            Increase of the Poisson distributed (equivalent to a Poisson distributed
            spike train as input) noise in the AMPA conductance.
        rates_noise (float, optional):
            Rate of the Poisson distributed noise in the AMPA conductance.
        nonlin (float, optional):
            Exponent of the nonlinear function for the external current.

    Variables to record:
        - g_ampa
        - g_gaba
        - I
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        a: float = 0,
        b: float = 0,
        c: float = 0,
        d: float = 0,
        n2: float = 0,
        n1: float = 0,
        n0: float = 0,
        tau_ampa: float = 1,
        tau_gaba: float = 1,
        E_ampa: float = 0,
        E_gaba: float = 0,
        I_app: float = 0,
        increase_noise: float = 0,
        rates_noise: float = 0,
        nonlin: float = 1,
    ):
        # Create the arguments
        parameters = f"""
            a              = {a} : population
            b              = {b} : population
            c              = {c} : population
            d              = {d} : population
            n2             = {n2} : population
            n1             = {n1} : population
            n0             = {n0} : population
            tau_ampa       = {tau_ampa} : population
            tau_gaba       = {tau_gaba} : population
            E_ampa         = {E_ampa} : population
            E_gaba         = {E_gaba} : population
            I_app          = {I_app}
            increase_noise = {increase_noise} : population
            rates_noise    = {rates_noise}
            nonlin         = {nonlin} : population
        """

        super().__init__(
            parameters=parameters,
            equations="""
                dg_ampa/dt = ite(Uniform(0.0, 1.0) * 1000.0 / dt > rates_noise, -g_ampa/tau_ampa, -g_ampa/tau_ampa + increase_noise/dt)
                dg_gaba/dt = -g_gaba / tau_gaba
                I = I_app - neg(g_ampa*(v - E_ampa)) - pos(g_gaba*(v - E_gaba))
                dv/dt      = n2 * v * v + n1 * v + n0 - u + f(I,nonlin)
                du/dt      = a * (b * v - u)
            """,
            spike="""
                v >= 30
            """,
            reset="""
                v = c
                u = u + d
            """,
            functions="""
                f(x,y)=((abs(x))**(1/y))/((x+1e-20)/(abs(x)+ 1e-20))
            """,
            name="Izhikevich2003_noisy_AMPA_nonlin",
            description="""
                Neuron model from Izhikevich (2003). With additional conductance based
                synapses for AMPA and GABA currents with noise in AMPA conductance.
                With nonlinear function for external current.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2003NoisyAmpaOscillating #

Bases: Neuron

TEMPLATE

Izhikevich (2003)-like neuron model with additional conductance based synapses for AMPA and GABA currents with noise in AMPA conductance. With additional oscillation term.

Parameters:

Name Type Description Default
a float

Time constant of the recovery variable u.

0
b float

Sensitivity of the recovery variable u to the membrane potential v.

0
c float

After-spike reset value of the membrane potential v.

0
d float

After-spike change of the recovery variable u.

0
n2 float

Factor of the quadratic equation of the membrane potential v.

0
n1 float

Factor of the quadratic equation of the membrane potential v.

0
n0 float

Factor of the quadratic equation of the membrane potential v.

0
tau_ampa float

Time constant of the AMPA conductance.

1
tau_gaba float

Time constant of the GABA conductance.

1
E_ampa float

Reversal potential of the AMPA conductance.

0
E_gaba float

Reversal potential of the GABA conductance.

0
I_app float

External applied current.

0
increase_noise float

Increase of the Poisson distributed (equivalent to a Poisson distributed spike train as input) noise in the AMPA conductance.

0
rates_noise float

Rate of the Poisson distributed noise in the AMPA conductance.

0
freq float

Frequency of the oscillation term.

0
amp float

Amplitude of the oscillation term.

6
Variables to record
  • osc
  • g_ampa
  • g_gaba
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2003_like_nm.py
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
class Izhikevich2003NoisyAmpaOscillating(Neuron):
    """
    TEMPLATE

    [Izhikevich (2003)](https://doi.org/10.1109/TNN.2003.820440)-like neuron model with
    additional conductance based synapses for AMPA and GABA currents with noise in AMPA
    conductance. With additional oscillation term.

    Parameters:
        a (float, optional):
            Time constant of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential v.
        d (float, optional):
            After-spike change of the recovery variable u.
        n2 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        n1 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        n0 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        tau_ampa (float, optional):
            Time constant of the AMPA conductance.
        tau_gaba (float, optional):
            Time constant of the GABA conductance.
        E_ampa (float, optional):
            Reversal potential of the AMPA conductance.
        E_gaba (float, optional):
            Reversal potential of the GABA conductance.
        I_app (float, optional):
            External applied current.
        increase_noise (float, optional):
            Increase of the Poisson distributed (equivalent to a Poisson distributed
            spike train as input) noise in the AMPA conductance.
        rates_noise (float, optional):
            Rate of the Poisson distributed noise in the AMPA conductance.
        freq (float, optional):
            Frequency of the oscillation term.
        amp (float, optional):
            Amplitude of the oscillation term.

    Variables to record:
        - osc
        - g_ampa
        - g_gaba
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        a: float = 0,
        b: float = 0,
        c: float = 0,
        d: float = 0,
        n2: float = 0,
        n1: float = 0,
        n0: float = 0,
        tau_ampa: float = 1,
        tau_gaba: float = 1,
        E_ampa: float = 0,
        E_gaba: float = 0,
        I_app: float = 0,
        increase_noise: float = 0,
        rates_noise: float = 0,
        freq: float = 0,
        amp: float = 6,
    ):
        # Create the arguments
        parameters = f"""
            a              = {a} : population
            b              = {b} : population
            c              = {c} : population
            d              = {d} : population
            n2             = {n2} : population
            n1             = {n1} : population
            n0             = {n0} : population
            tau_ampa       = {tau_ampa} : population
            tau_gaba       = {tau_gaba} : population
            E_ampa         = {E_ampa} : population
            E_gaba         = {E_gaba} : population
            I_app          = {I_app}
            increase_noise = {increase_noise} : population
            rates_noise    = {rates_noise}
            freq           = {freq}
            amp            = {amp}
        """

        super().__init__(
            parameters=parameters,
            equations="""
                osc        = amp * sin(t * 2 * pi * (freq / 1000))
                dg_ampa/dt = ite(Uniform(0.0, 1.0) * 1000.0 / dt > rates_noise, -g_ampa/tau_ampa, -g_ampa/tau_ampa + increase_noise/dt)
                dg_gaba/dt = -g_gaba / tau_gaba
                dv/dt      = n2 * v * v + n1 * v + n0 - u + I_app - neg(g_ampa*(v - E_ampa)) - pos(g_gaba*(v - E_gaba)) + osc
                du/dt      = a * (b * v - u)
            """,
            spike="""
                v >= 30
            """,
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2003_noisy_AMPA_oscillating",
            description="""
                Neuron model from Izhikevich (2003). With additional conductance based
                synapses for AMPA and GABA currents with noise in AMPA conductance.
                With additional oscillation term.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2003NoisyBase #

Bases: Neuron

TEMPLATE

Izhikevich (2003)-like neuron model with additional conductance based synapses for AMPA and GABA currents and a noisy baseline current.

Parameters:

Name Type Description Default
a float

Time constant of the recovery variable u.

0
b float

Sensitivity of the recovery variable u to the membrane potential v.

0
c float

After-spike reset value of the membrane potential v.

0
d float

After-spike change of the recovery variable u.

0
n2 float

Factor of the quadratic equation of the membrane potential v.

0
n1 float

Factor of the quadratic equation of the membrane potential v.

0
n0 float

Factor of the quadratic equation of the membrane potential v.

0
tau_ampa float

Time constant of the AMPA conductance.

1
tau_gaba float

Time constant of the GABA conductance.

1
E_ampa float

Reversal potential of the AMPA conductance.

0
E_gaba float

Reversal potential of the GABA conductance.

0
I_app float

External applied current.

0
base_mean float

Mean of the baseline current.

0
base_noise float

Standard deviation of the baseline current.

0
rate_base_noise float

Rate of the Poisson distributed noise in the baseline current, i.e. how often the baseline current is changed randomly.

0
Variables to record
  • g_ampa
  • g_gaba
  • offset_base
  • I_base
  • I
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2003_like_nm.py
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
class Izhikevich2003NoisyBase(Neuron):
    """
    TEMPLATE

    [Izhikevich (2003)](https://doi.org/10.1109/TNN.2003.820440)-like neuron model with
    additional conductance based synapses for AMPA and GABA currents and a noisy baseline
    current.

    Parameters:
        a (float, optional):
            Time constant of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential v.
        d (float, optional):
            After-spike change of the recovery variable u.
        n2 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        n1 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        n0 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        tau_ampa (float, optional):
            Time constant of the AMPA conductance.
        tau_gaba (float, optional):
            Time constant of the GABA conductance.
        E_ampa (float, optional):
            Reversal potential of the AMPA conductance.
        E_gaba (float, optional):
            Reversal potential of the GABA conductance.
        I_app (float, optional):
            External applied current.
        base_mean (float, optional):
            Mean of the baseline current.
        base_noise (float, optional):
            Standard deviation of the baseline current.
        rate_base_noise (float, optional):
            Rate of the Poisson distributed noise in the baseline current, i.e. how
            often the baseline current is changed randomly.

    Variables to record:
        - g_ampa
        - g_gaba
        - offset_base
        - I_base
        - I
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        a: float = 0,
        b: float = 0,
        c: float = 0,
        d: float = 0,
        n2: float = 0,
        n1: float = 0,
        n0: float = 0,
        tau_ampa: float = 1,
        tau_gaba: float = 1,
        E_ampa: float = 0,
        E_gaba: float = 0,
        I_app: float = 0,
        base_mean: float = 0,
        base_noise: float = 0,
        rate_base_noise: float = 0,
    ):
        # Create the arguments
        parameters = f"""
            a               = {a} : population
            b               = {b} : population
            c               = {c} : population
            d               = {d} : population
            n2              = {n2} : population
            n1              = {n1} : population
            n0              = {n0} : population
            tau_ampa        = {tau_ampa} : population
            tau_gaba        = {tau_gaba} : population
            E_ampa          = {E_ampa} : population
            E_gaba          = {E_gaba} : population
            I_app           = {I_app}
            base_mean       = {base_mean}
            base_noise      = {base_noise}
            rate_base_noise = {rate_base_noise}
        """

        super().__init__(
            parameters=parameters,
            equations="""
                dg_ampa/dt  = -g_ampa/tau_ampa
                dg_gaba/dt  = -g_gaba / tau_gaba
                offset_base = ite(Uniform(0.0, 1.0) * 1000.0 / dt > rate_base_noise, offset_base, Normal(0, 1) * base_noise)
                I_base      = base_mean + offset_base
                I           = I_app - neg(g_ampa*(v - E_ampa)) - pos(g_gaba*(v - E_gaba)) + I_base
                dv/dt       = n2 * v * v + n1 * v + n0 - u + I
                du/dt       = a * (b * v - u)
            """,
            spike="""
                v >= 30
            """,
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2003_noisy_I",
            description="""
                Neuron model from Izhikevich (2003). With additional conductance based
                synapses for AMPA and GABA currents and a noisy baseline current.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2003NoisyBaseNonlin #

Bases: Neuron

TEMPLATE

Izhikevich (2003)-like neuron model with additional conductance based synapses for AMPA and GABA currents and a noisy baseline current. With nonlinear function for external current.

Parameters:

Name Type Description Default
a float

Time constant of the recovery variable u.

0
b float

Sensitivity of the recovery variable u to the membrane potential v.

0
c float

After-spike reset value of the membrane potential v.

0
d float

After-spike change of the recovery variable u.

0
n2 float

Factor of the quadratic equation of the membrane potential v.

0
n1 float

Factor of the quadratic equation of the membrane potential v.

0
n0 float

Factor of the quadratic equation of the membrane potential v.

0
tau_ampa float

Time constant of the AMPA conductance.

1
tau_gaba float

Time constant of the GABA conductance.

1
E_ampa float

Reversal potential of the AMPA conductance.

0
E_gaba float

Reversal potential of the GABA conductance.

0
I_app float

External applied current.

0
base_mean float

Mean of the baseline current.

0
base_noise float

Standard deviation of the baseline current.

0
rate_base_noise float

Rate of the Poisson distributed noise in the baseline current, i.e. how often the baseline current is changed randomly.

0
nonlin float

Exponent of the nonlinear function for the external current.

1
Variables to record
  • g_ampa
  • g_gaba
  • offset_base
  • I_base
  • I
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2003_like_nm.py
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
class Izhikevich2003NoisyBaseNonlin(Neuron):
    """
    TEMPLATE

    [Izhikevich (2003)](https://doi.org/10.1109/TNN.2003.820440)-like neuron model with
    additional conductance based synapses for AMPA and GABA currents and a noisy baseline
    current. With nonlinear function for external current.

    Parameters:
        a (float, optional):
            Time constant of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential v.
        d (float, optional):
            After-spike change of the recovery variable u.
        n2 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        n1 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        n0 (float, optional):
            Factor of the quadratic equation of the membrane potential v.
        tau_ampa (float, optional):
            Time constant of the AMPA conductance.
        tau_gaba (float, optional):
            Time constant of the GABA conductance.
        E_ampa (float, optional):
            Reversal potential of the AMPA conductance.
        E_gaba (float, optional):
            Reversal potential of the GABA conductance.
        I_app (float, optional):
            External applied current.
        base_mean (float, optional):
            Mean of the baseline current.
        base_noise (float, optional):
            Standard deviation of the baseline current.
        rate_base_noise (float, optional):
            Rate of the Poisson distributed noise in the baseline current, i.e. how
            often the baseline current is changed randomly.
        nonlin (float, optional):
            Exponent of the nonlinear function for the external current.

    Variables to record:
        - g_ampa
        - g_gaba
        - offset_base
        - I_base
        - I
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        a: float = 0,
        b: float = 0,
        c: float = 0,
        d: float = 0,
        n2: float = 0,
        n1: float = 0,
        n0: float = 0,
        tau_ampa: float = 1,
        tau_gaba: float = 1,
        E_ampa: float = 0,
        E_gaba: float = 0,
        I_app: float = 0,
        base_mean: float = 0,
        base_noise: float = 0,
        rate_base_noise: float = 0,
        nonlin: float = 1,
    ):
        # Create the arguments
        parameters = f"""
            a               = {a} : population
            b               = {b} : population
            c               = {c} : population
            d               = {d} : population
            n2              = {n2} : population
            n1              = {n1} : population
            n0              = {n0} : population
            tau_ampa        = {tau_ampa} : population
            tau_gaba        = {tau_gaba} : population
            E_ampa          = {E_ampa} : population
            E_gaba          = {E_gaba} : population
            I_app           = {I_app}
            base_mean       = {base_mean}
            base_noise      = {base_noise}
            rate_base_noise = {rate_base_noise}
            nonlin          = {nonlin} : population
        """

        super().__init__(
            parameters=parameters,
            equations="""
                dg_ampa/dt  = -g_ampa/tau_ampa
                dg_gaba/dt  = -g_gaba / tau_gaba
                offset_base = ite(Uniform(0.0, 1.0) * 1000.0 / dt > rate_base_noise, offset_base, Normal(0, 1) * base_noise)
                I_base      = base_mean + offset_base
                I           = I_app - neg(g_ampa*(v - E_ampa)) - pos(g_gaba*(v - E_gaba))
                dv/dt       = n2 * v * v + n1 * v + n0 - u + f(I,nonlin) + I_base
                du/dt       = a * (b * v - u)
            """,
            spike="""
                v >= 30
            """,
            reset="""
                v = c
                u = u + d
            """,
            functions="""
                f(x,y)=((abs(x))**(1/y))/((x+1e-20)/(abs(x)+ 1e-20))
            """,
            name="Izhikevich2003_noisy_I_nonlin",
            description="""
                Neuron model from Izhikevich (2003). With additional conductance based
                synapses for AMPA and GABA currents and a noisy baseline current.
                With nonlinear function for external current.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich (2007)-like Neurons#

Izhikevich2007 #

Bases: Neuron

TEMPLATE

Izhikevich (2007)-like neuron model.

Parameters:

Name Type Description Default
C float

Membrane capacitance.

100.0
k float

Scaling factor for the quadratic term in the membrane potential.

0.7
v_r float

Resting membrane potential.

-60.0
v_t float

Instantaneous activation threshold potential.

-40.0
a float

Time scale of the recovery variable u.

0.03
b float

Sensitivity of the recovery variable u to the the membrane potential v.

-2.0
c float

After-spike reset value of the membrane potential.

-50.0
d float

After-spike change of the recovery variable u.

100.0
v_peak float

Spike cut-off value for the membrane potential.

35.0
I_app float

External applied input current.

0.0
params_for_pop bool

If True, the parameters are population-wide and not neuron-specific.

False
init dict

Initial values for the variables.

{}
Variables to record
  • I_v
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2007_like_nm.py
 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
class Izhikevich2007(Neuron):
    """
    TEMPLATE

    [Izhikevich (2007)](https://isbnsearch.org/isbn/9780262090438)-like neuron model.

    Parameters:
        C (float, optional):
            Membrane capacitance.
        k (float, optional):
            Scaling factor for the quadratic term in the membrane potential.
        v_r (float, optional):
            Resting membrane potential.
        v_t (float, optional):
            Instantaneous activation threshold potential.
        a (float, optional):
            Time scale of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential.
        d (float, optional):
            After-spike change of the recovery variable u.
        v_peak (float, optional):
            Spike cut-off value for the membrane potential.
        I_app (float, optional):
            External applied input current.
        params_for_pop (bool, optional):
            If True, the parameters are population-wide and not neuron-specific.
        init (dict, optional):
            Initial values for the variables.

    Variables to record:
        - I_v
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        C: float = 100.0,
        k: float = 0.7,
        v_r: float = -60.0,
        v_t: float = -40.0,
        a: float = 0.03,
        b: float = -2.0,
        c: float = -50.0,
        d: float = 100.0,
        v_peak: float = 35.0,
        I_app: float = 0.0,
        params_for_pop: bool = False,
        init: dict = {},
    ):
        # Create the arguments
        parameters = f"""
            C      = {C} {': population' if params_for_pop else ''} # pF
            k      = {k} {': population' if params_for_pop else ''} # pS * mV**-1
            v_r    = {v_r} {': population' if params_for_pop else ''} # mV
            v_t    = {v_t} {': population' if params_for_pop else ''} # mV
            a      = {a} {': population' if params_for_pop else ''} # ms**-1
            b      = {b} {': population' if params_for_pop else ''} # nS
            c      = {c} {': population' if params_for_pop else ''} # mV
            d      = {d} {': population' if params_for_pop else ''} # pA
            v_peak = {v_peak} {': population' if params_for_pop else ''} # mV
            I_app  = {I_app} # pA
        """

        # get equations
        equations = _get_equation_izhikevich_2007()

        # set initial values
        equations = _set_init(equations, init)

        # create the neuron
        super().__init__(
            parameters=parameters,
            equations=equations,
            spike="v >= v_peak",
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2007",
            description="Neuron model equations from Izhikevich (2007).",
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2007RecCur #

Bases: Neuron

TEMPLATE

Izhikevich (2007)-like neuron model with separate currents to record.

Parameters:

Name Type Description Default
C float

Membrane capacitance.

100.0
k float

Scaling factor for the quadratic term in the membrane potential.

0.7
v_r float

Resting membrane potential.

-60.0
v_t float

Instantaneous activation threshold potential.

-40.0
a float

Time scale of the recovery variable u.

0.03
b float

Sensitivity of the recovery variable u to the the membrane potential v.

-2.0
c float

After-spike reset value of the membrane potential.

-50.0
d float

After-spike change of the recovery variable u.

100.0
v_peak float

Spike cut-off value for the membrane potential.

35.0
I_app float

External applied input current.

0.0
params_for_pop bool

If True, the parameters are population-wide and not neuron-specific.

False
init dict

Initial values for the variables.

{}
Variables to record
  • I_v
  • v
  • u
  • I_u
  • I_k
  • I_a
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2007_like_nm.py
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
class Izhikevich2007RecCur(Neuron):
    """
    TEMPLATE

    [Izhikevich (2007)](https://isbnsearch.org/isbn/9780262090438)-like neuron model
    with separate currents to record.

    Parameters:
        C (float, optional):
            Membrane capacitance.
        k (float, optional):
            Scaling factor for the quadratic term in the membrane potential.
        v_r (float, optional):
            Resting membrane potential.
        v_t (float, optional):
            Instantaneous activation threshold potential.
        a (float, optional):
            Time scale of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential.
        d (float, optional):
            After-spike change of the recovery variable u.
        v_peak (float, optional):
            Spike cut-off value for the membrane potential.
        I_app (float, optional):
            External applied input current.
        params_for_pop (bool, optional):
            If True, the parameters are population-wide and not neuron-specific.
        init (dict, optional):
            Initial values for the variables.

    Variables to record:
        - I_v
        - v
        - u
        - I_u
        - I_k
        - I_a
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        C: float = 100.0,
        k: float = 0.7,
        v_r: float = -60.0,
        v_t: float = -40.0,
        a: float = 0.03,
        b: float = -2.0,
        c: float = -50.0,
        d: float = 100.0,
        v_peak: float = 35.0,
        I_app: float = 0.0,
        params_for_pop: bool = False,
        init: dict = {},
    ):
        # Create the arguments
        parameters = f"""
            C      = {C} {': population' if params_for_pop else ''} # pF
            k      = {k} {': population' if params_for_pop else ''} # pS * mV**-1
            v_r    = {v_r} {': population' if params_for_pop else ''} # mV
            v_t    = {v_t} {': population' if params_for_pop else ''} # mV
            a      = {a} {': population' if params_for_pop else ''} # ms**-1
            b      = {b} {': population' if params_for_pop else ''} # nS
            c      = {c} {': population' if params_for_pop else ''} # mV
            d      = {d} {': population' if params_for_pop else ''} # pA
            v_peak = {v_peak} {': population' if params_for_pop else ''} # mV
            I_app  = {I_app} # pA
        """

        affix = """
            I_u = -u
            I_k = k*(v - v_r)*(v - v_t)
            I_a = I_app
        """

        # get equations
        equations = _get_equation_izhikevich_2007(affix=affix)

        # set initial values
        equations = _set_init(equations, init)

        super().__init__(
            parameters=parameters,
            equations=equations,
            spike="v >= v_peak",
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2007_record_currents",
            description="""
                Neuron model equations from Izhikevich (2007) with separate
                currents to record.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2007VoltageClamp #

Bases: Neuron

TEMPLATE

Izhikevich (2007)-like neuron model with voltage clamp to record I_inf.

Parameters:

Name Type Description Default
C float

Membrane capacitance.

100.0
k float

Scaling factor for the quadratic term in the membrane potential.

0.7
v_r float

Resting membrane potential.

-60.0
v_t float

Instantaneous activation threshold potential.

-40.0
a float

Time scale of the recovery variable u.

0.03
b float

Sensitivity of the recovery variable u to the the membrane potential v.

-2.0
c float

After-spike reset value of the membrane potential.

-50.0
d float

After-spike change of the recovery variable u.

100.0
v_peak float

Spike cut-off value for the membrane potential.

35.0
I_app float

External applied input current.

0.0
params_for_pop bool

If True, the parameters are population-wide and not neuron-specific.

False
init dict

Initial values for the variables.

{}
Variables to record
  • I_v
  • v
  • u
  • I_inf
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2007_like_nm.py
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
class Izhikevich2007VoltageClamp(Neuron):
    """
    TEMPLATE

    [Izhikevich (2007)](https://isbnsearch.org/isbn/9780262090438)-like neuron model
    with voltage clamp to record I_inf.

    Parameters:
        C (float, optional):
            Membrane capacitance.
        k (float, optional):
            Scaling factor for the quadratic term in the membrane potential.
        v_r (float, optional):
            Resting membrane potential.
        v_t (float, optional):
            Instantaneous activation threshold potential.
        a (float, optional):
            Time scale of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential.
        d (float, optional):
            After-spike change of the recovery variable u.
        v_peak (float, optional):
            Spike cut-off value for the membrane potential.
        I_app (float, optional):
            External applied input current.
        params_for_pop (bool, optional):
            If True, the parameters are population-wide and not neuron-specific.
        init (dict, optional):
            Initial values for the variables.

    Variables to record:
        - I_v
        - v
        - u
        - I_inf
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        C: float = 100.0,
        k: float = 0.7,
        v_r: float = -60.0,
        v_t: float = -40.0,
        a: float = 0.03,
        b: float = -2.0,
        c: float = -50.0,
        d: float = 100.0,
        v_peak: float = 35.0,
        I_app: float = 0.0,
        params_for_pop: bool = False,
        init: dict = {},
    ):
        # Create the arguments
        parameters = f"""
            C      = {C} {': population' if params_for_pop else ''} # pF
            k      = {k} {': population' if params_for_pop else ''} # pS * mV**-1
            v_r    = {v_r} {': population' if params_for_pop else ''} # mV
            v_t    = {v_t} {': population' if params_for_pop else ''} # mV
            a      = {a} {': population' if params_for_pop else ''} # ms**-1
            b      = {b} {': population' if params_for_pop else ''} # nS
            c      = {c} {': population' if params_for_pop else ''} # mV
            d      = {d} {': population' if params_for_pop else ''} # pA
            v_peak = {v_peak} {': population' if params_for_pop else ''} # mV
            I_app  = {I_app} # pA
        """

        dv = "0"
        affix = f"I_inf = {_dv_default}"

        # get equations
        equations = _get_equation_izhikevich_2007(dv=dv, affix=affix)

        # set initial values
        equations = _set_init(equations, init)

        super().__init__(
            parameters=parameters,
            equations=equations,
            spike="v >= v_peak",
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2007_voltage_clamp",
            description="""
                Neuron model equations from Izhikevich (2007) with voltage clamp
                to record I_inf.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2007Syn #

Bases: Neuron

TEMPLATE

Izhikevich (2007)-like neuron model with conductance-based synapses.

Parameters:

Name Type Description Default
C float

Membrane capacitance.

100.0
k float

Scaling factor for the quadratic term in the membrane potential.

0.7
v_r float

Resting membrane potential.

-60.0
v_t float

Instantaneous activation threshold potential.

-40.0
a float

Time scale of the recovery variable u.

0.03
b float

Sensitivity of the recovery variable u to the the membrane potential v.

-2.0
c float

After-spike reset value of the membrane potential.

-50.0
d float

After-spike change of the recovery variable u.

100.0
v_peak float

Spike cut-off value for the membrane potential.

35.0
I_app float

External applied input current.

0.0
tau_ampa float

Time constant of the AMPA synapse.

10.0
tau_gaba float

Time constant of the GABA synapse.

10.0
E_ampa float

Reversal potential of the AMPA synapse.

0.0
E_gaba float

Reversal potential of the GABA synapse.

-90.0
params_for_pop bool

If True, the parameters are population-wide and not neuron-specific.

False
init dict

Initial values for the variables.

{}
Variables to record
  • g_ampa
  • g_gaba
  • I_v
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2007_like_nm.py
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
class Izhikevich2007Syn(Neuron):
    """
    TEMPLATE

    [Izhikevich (2007)](https://isbnsearch.org/isbn/9780262090438)-like neuron model
    with conductance-based synapses.

    Parameters:
        C (float, optional):
            Membrane capacitance.
        k (float, optional):
            Scaling factor for the quadratic term in the membrane potential.
        v_r (float, optional):
            Resting membrane potential.
        v_t (float, optional):
            Instantaneous activation threshold potential.
        a (float, optional):
            Time scale of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential.
        d (float, optional):
            After-spike change of the recovery variable u.
        v_peak (float, optional):
            Spike cut-off value for the membrane potential.
        I_app (float, optional):
            External applied input current.
        tau_ampa (float, optional):
            Time constant of the AMPA synapse.
        tau_gaba (float, optional):
            Time constant of the GABA synapse.
        E_ampa (float, optional):
            Reversal potential of the AMPA synapse.
        E_gaba (float, optional):
            Reversal potential of the GABA synapse.
        params_for_pop (bool, optional):
            If True, the parameters are population-wide and not neuron-specific.
        init (dict, optional):
            Initial values for the variables.

    Variables to record:
        - g_ampa
        - g_gaba
        - I_v
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        C: float = 100.0,
        k: float = 0.7,
        v_r: float = -60.0,
        v_t: float = -40.0,
        a: float = 0.03,
        b: float = -2.0,
        c: float = -50.0,
        d: float = 100.0,
        v_peak: float = 35.0,
        I_app: float = 0.0,
        tau_ampa: float = 10.0,
        tau_gaba: float = 10.0,
        E_ampa: float = 0.0,
        E_gaba: float = -90.0,
        params_for_pop: bool = False,
        init: dict = {},
    ):
        # Create the arguments
        parameters = f"""
            C      = {C} {': population' if params_for_pop else ''}
            k      = {k} {': population' if params_for_pop else ''}
            v_r    = {v_r} {': population' if params_for_pop else ''}
            v_t    = {v_t} {': population' if params_for_pop else ''}
            a      = {a} {': population' if params_for_pop else ''}
            b      = {b} {': population' if params_for_pop else ''}
            c      = {c} {': population' if params_for_pop else ''}
            d      = {d} {': population' if params_for_pop else ''}
            v_peak = {v_peak} {': population' if params_for_pop else ''}
            I_app  = {I_app} # pA
            tau_ampa = {tau_ampa} {': population' if params_for_pop else ''}
            tau_gaba = {tau_gaba} {': population' if params_for_pop else ''}
            E_ampa   = {E_ampa} {': population' if params_for_pop else ''}
            E_gaba   = {E_gaba} {': population' if params_for_pop else ''}
        """

        syn = _syn_default
        i_v = f"I_app {_I_syn}"

        # get equations
        equations = _get_equation_izhikevich_2007(syn=syn, i_v=i_v)

        # set initial values
        equations = _set_init(equations, init)

        super().__init__(
            parameters=parameters,
            equations=equations,
            spike="v >= v_peak",
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2007_syn",
            description="""
                Neuron model equations from Izhikevich (2007) with conductance-based
                AMPA and GABA synapses/currents.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2007NoisyAmpa #

Bases: Neuron

TEMPLATE

Izhikevich (2007)-like neuron model with conductance-based AMPA and GABA synapses with noise in the AMPA conductance.

Parameters:

Name Type Description Default
C float

Membrane capacitance.

100.0
k float

Scaling factor for the quadratic term in the membrane potential.

0.7
v_r float

Resting membrane potential.

-60.0
v_t float

Instantaneous activation threshold potential.

-40.0
a float

Time scale of the recovery variable u.

0.03
b float

Sensitivity of the recovery variable u to the the membrane potential v.

-2.0
c float

After-spike reset value of the membrane potential.

-50.0
d float

After-spike change of the recovery variable u.

100.0
v_peak float

Spike cut-off value for the membrane potential.

35.0
I_app float

External applied input current.

0.0
tau_ampa float

Time constant of the AMPA synapse.

10.0
tau_gaba float

Time constant of the GABA synapse.

10.0
E_ampa float

Reversal potential of the AMPA synapse.

0.0
E_gaba float

Reversal potential of the GABA synapse.

-90.0
increase_noise float

Increase of AMPA conductance due to noise (equal to a Poisson distributed spike train as input).

0.0
rates_noise float

Rate of the noise in the AMPA conductance.

0.0
params_for_pop bool

If True, the parameters are population-wide and not neuron-specific.

False
init dict

Initial values for the variables.

{}
Variables to record
  • g_ampa
  • g_gaba
  • I_v
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2007_like_nm.py
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
class Izhikevich2007NoisyAmpa(Neuron):
    """
    TEMPLATE

    [Izhikevich (2007)](https://isbnsearch.org/isbn/9780262090438)-like neuron model
    with conductance-based AMPA and GABA synapses with noise in the AMPA conductance.

    Parameters:
        C (float, optional):
            Membrane capacitance.
        k (float, optional):
            Scaling factor for the quadratic term in the membrane potential.
        v_r (float, optional):
            Resting membrane potential.
        v_t (float, optional):
            Instantaneous activation threshold potential.
        a (float, optional):
            Time scale of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential.
        d (float, optional):
            After-spike change of the recovery variable u.
        v_peak (float, optional):
            Spike cut-off value for the membrane potential.
        I_app (float, optional):
            External applied input current.
        tau_ampa (float, optional):
            Time constant of the AMPA synapse.
        tau_gaba (float, optional):
            Time constant of the GABA synapse.
        E_ampa (float, optional):
            Reversal potential of the AMPA synapse.
        E_gaba (float, optional):
            Reversal potential of the GABA synapse.
        increase_noise (float, optional):
            Increase of AMPA conductance due to noise (equal to a Poisson distributed
            spike train as input).
        rates_noise (float, optional):
            Rate of the noise in the AMPA conductance.
        params_for_pop (bool, optional):
            If True, the parameters are population-wide and not neuron-specific.
        init (dict, optional):
            Initial values for the variables.

    Variables to record:
        - g_ampa
        - g_gaba
        - I_v
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        C: float = 100.0,
        k: float = 0.7,
        v_r: float = -60.0,
        v_t: float = -40.0,
        a: float = 0.03,
        b: float = -2.0,
        c: float = -50.0,
        d: float = 100.0,
        v_peak: float = 35.0,
        I_app: float = 0.0,
        tau_ampa: float = 10.0,
        tau_gaba: float = 10.0,
        E_ampa: float = 0.0,
        E_gaba: float = -90.0,
        increase_noise: float = 0.0,
        rates_noise: float = 0.0,
        params_for_pop: bool = False,
        init: dict = {},
    ):
        # Create the arguments
        parameters = f"""
            C              = {C} {': population' if params_for_pop else ''}
            k              = {k} {': population' if params_for_pop else ''}
            v_r            = {v_r} {': population' if params_for_pop else ''}
            v_t            = {v_t} {': population' if params_for_pop else ''}
            a              = {a} {': population' if params_for_pop else ''}
            b              = {b} {': population' if params_for_pop else ''}
            c              = {c} {': population' if params_for_pop else ''}
            d              = {d} {': population' if params_for_pop else ''}
            v_peak         = {v_peak} {': population' if params_for_pop else ''}
            tau_ampa       = {tau_ampa} {': population' if params_for_pop else ''}
            tau_gaba       = {tau_gaba} {': population' if params_for_pop else ''}
            E_ampa         = {E_ampa} {': population' if params_for_pop else ''}
            E_gaba         = {E_gaba} {': population' if params_for_pop else ''}
            I_app          = {I_app} # pA
            increase_noise = {increase_noise} {': population' if params_for_pop else ''}
            rates_noise    = {rates_noise}
        """

        syn = _syn_noisy
        i_v = f"I_app {_I_syn}"

        # get equations
        equations = _get_equation_izhikevich_2007(syn=syn, i_v=i_v)

        # set initial values
        equations = _set_init(equations, init)

        super().__init__(
            parameters=parameters,
            equations=equations,
            spike="v >= v_peak",
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2007_noisy_AMPA",
            description="""
                Standard neuron model from Izhikevich (2007) with additional
                conductance based synapses for AMPA and GABA currents with noise
                in AMPA conductance.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2007NoisyBase #

Bases: Neuron

TEMPLATE

Izhikevich (2007)-like neuron model with conductance-based AMPA and GABA synapses with noise in the baseline current.

Parameters:

Name Type Description Default
C float

Membrane capacitance.

100.0
k float

Scaling factor for the quadratic term in the membrane potential.

0.7
v_r float

Resting membrane potential.

-60.0
v_t float

Instantaneous activation threshold potential.

-40.0
a float

Time scale of the recovery variable u.

0.03
b float

Sensitivity of the recovery variable u to the the membrane potential v.

-2.0
c float

After-spike reset value of the membrane potential.

-50.0
d float

After-spike change of the recovery variable u.

100.0
v_peak float

Spike cut-off value for the membrane potential.

35.0
I_app float

External applied input current.

0.0
tau_ampa float

Time constant of the AMPA synapse.

10.0
tau_gaba float

Time constant of the GABA synapse.

10.0
E_ampa float

Reversal potential of the AMPA synapse.

0.0
E_gaba float

Reversal potential of the GABA synapse.

-90.0
base_mean float

Mean of the baseline current.

0.0
base_noise float

Standard deviation of the baseline current noise.

0.0
rate_base_noise float

Rate of the noise update (Poisson distributed) in the baseline current.

0.0
params_for_pop bool

If True, the parameters are population-wide and not neuron-specific.

False
init dict

Initial values for the variables.

{}
Variables to record
  • offset_base
  • I_base
  • g_ampa
  • g_gaba
  • I_v
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2007_like_nm.py
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
class Izhikevich2007NoisyBase(Neuron):
    """
    TEMPLATE

    [Izhikevich (2007)](https://isbnsearch.org/isbn/9780262090438)-like neuron model
    with conductance-based AMPA and GABA synapses with noise in the baseline current.

    Parameters:
        C (float, optional):
            Membrane capacitance.
        k (float, optional):
            Scaling factor for the quadratic term in the membrane potential.
        v_r (float, optional):
            Resting membrane potential.
        v_t (float, optional):
            Instantaneous activation threshold potential.
        a (float, optional):
            Time scale of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential.
        d (float, optional):
            After-spike change of the recovery variable u.
        v_peak (float, optional):
            Spike cut-off value for the membrane potential.
        I_app (float, optional):
            External applied input current.
        tau_ampa (float, optional):
            Time constant of the AMPA synapse.
        tau_gaba (float, optional):
            Time constant of the GABA synapse.
        E_ampa (float, optional):
            Reversal potential of the AMPA synapse.
        E_gaba (float, optional):
            Reversal potential of the GABA synapse.
        base_mean (float, optional):
            Mean of the baseline current.
        base_noise (float, optional):
            Standard deviation of the baseline current noise.
        rate_base_noise (float, optional):
            Rate of the noise update (Poisson distributed) in the baseline current.
        params_for_pop (bool, optional):
            If True, the parameters are population-wide and not neuron-specific.
        init (dict, optional):
            Initial values for the variables.

    Variables to record:
        - offset_base
        - I_base
        - g_ampa
        - g_gaba
        - I_v
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        C: float = 100.0,
        k: float = 0.7,
        v_r: float = -60.0,
        v_t: float = -40.0,
        a: float = 0.03,
        b: float = -2.0,
        c: float = -50.0,
        d: float = 100.0,
        v_peak: float = 35.0,
        I_app: float = 0.0,
        tau_ampa: float = 10.0,
        tau_gaba: float = 10.0,
        E_ampa: float = 0.0,
        E_gaba: float = -90.0,
        base_mean: float = 0.0,
        base_noise: float = 0.0,
        rate_base_noise: float = 0.0,
        params_for_pop: bool = False,
        init: dict = {},
    ):
        # Create the arguments
        parameters = f"""
            C              = {C} {': population' if params_for_pop else ''}
            k              = {k} {': population' if params_for_pop else ''}
            v_r            = {v_r} {': population' if params_for_pop else ''}
            v_t            = {v_t} {': population' if params_for_pop else ''}
            a              = {a} {': population' if params_for_pop else ''}
            b              = {b} {': population' if params_for_pop else ''}
            c              = {c} {': population' if params_for_pop else ''}
            d              = {d} {': population' if params_for_pop else ''}
            v_peak         = {v_peak} {': population' if params_for_pop else ''}
            tau_ampa       = {tau_ampa} {': population' if params_for_pop else ''}
            tau_gaba       = {tau_gaba} {': population' if params_for_pop else ''}
            E_ampa         = {E_ampa} {': population' if params_for_pop else ''}
            E_gaba         = {E_gaba} {': population' if params_for_pop else ''}
            I_app          = {I_app} # pA
            base_mean      = {base_mean}
            base_noise     = {base_noise}
            rate_base_noise = {rate_base_noise}
        """

        syn = _syn_default
        i_v = f"I_app {_I_syn} + I_base"
        prefix = _I_base_noise

        # get equations
        equations = _get_equation_izhikevich_2007(syn=syn, i_v=i_v, prefix=prefix)

        # set initial values
        equations = _set_init(equations, init)

        super().__init__(
            parameters=parameters,
            equations=equations,
            spike="v >= v_peak",
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2007_noisy_base",
            description="""
                Standard neuron model from Izhikevich (2007) with additional
                conductance based synapses for AMPA and GABA currents and noisy
                baseline current.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2007FsiNoisyAmpa #

Bases: Neuron

TEMPLATE

Izhikevich (2007)-like neuron model for fast-spiking neurons, with conductance-based AMPA and GABA synapses with noise in the AMPA conductance.

Parameters:

Name Type Description Default
C float

Membrane capacitance.

20.0
k float

Scaling factor for the quadratic term in the membrane potential.

1.0
v_r float

Resting membrane potential.

-55.0
v_t float

Instantaneous activation threshold potential.

-40.0
v_b float

Instantaneous activation threshold potential for the recovery variable u.

-55.0
a float

Time scale of the recovery variable u.

0.1
b float

Sensitivity of the recovery variable u to the the membrane potential v.

-2.0
c float

After-spike reset value of the membrane potential.

-50.0
d float

After-spike change of the recovery variable u.

2.0
v_peak float

Spike cut-off value for the membrane potential.

25.0
I_app float

External applied input current.

0.0
tau_ampa float

Time constant of the AMPA synapse.

2.0
tau_gaba float

Time constant of the GABA synapse.

5.0
E_ampa float

Reversal potential of the AMPA synapse.

0.0
E_gaba float

Reversal potential of the GABA synapse.

-80.0
increase_noise float

Increase of AMPA conductance due to noise (equal to a Poisson distributed spike train as input).

0.0
rates_noise float

Rate of the noise in the AMPA conductance.

0.0
params_for_pop bool

If True, the parameters are population-wide and not neuron-specific.

False
init dict

Initial values for the variables.

{}
Variables to record
  • g_ampa
  • g_gaba
  • I_v
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2007_like_nm.py
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
class Izhikevich2007FsiNoisyAmpa(Neuron):
    """
    TEMPLATE

    [Izhikevich (2007)](https://isbnsearch.org/isbn/9780262090438)-like neuron model
    for fast-spiking neurons, with conductance-based AMPA and GABA synapses with noise
    in the AMPA conductance.

    Parameters:
        C (float, optional):
            Membrane capacitance.
        k (float, optional):
            Scaling factor for the quadratic term in the membrane potential.
        v_r (float, optional):
            Resting membrane potential.
        v_t (float, optional):
            Instantaneous activation threshold potential.
        v_b (float, optional):
            Instantaneous activation threshold potential for the recovery variable u.
        a (float, optional):
            Time scale of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential.
        d (float, optional):
            After-spike change of the recovery variable u.
        v_peak (float, optional):
            Spike cut-off value for the membrane potential.
        I_app (float, optional):
            External applied input current.
        tau_ampa (float, optional):
            Time constant of the AMPA synapse.
        tau_gaba (float, optional):
            Time constant of the GABA synapse.
        E_ampa (float, optional):
            Reversal potential of the AMPA synapse.
        E_gaba (float, optional):
            Reversal potential of the GABA synapse.
        increase_noise (float, optional):
            Increase of AMPA conductance due to noise (equal to a Poisson distributed
            spike train as input).
        rates_noise (float, optional):
            Rate of the noise in the AMPA conductance.
        params_for_pop (bool, optional):
            If True, the parameters are population-wide and not neuron-specific.
        init (dict, optional):
            Initial values for the variables.

    Variables to record:
        - g_ampa
        - g_gaba
        - I_v
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        C: float = 20.0,
        k: float = 1.0,
        v_r: float = -55.0,
        v_t: float = -40.0,
        v_b: float = -55.0,
        a: float = 0.1,
        b: float = -2.0,
        c: float = -50.0,
        d: float = 2.0,
        v_peak: float = 25.0,
        I_app: float = 0.0,
        tau_ampa: float = 2.0,
        tau_gaba: float = 5.0,
        E_ampa: float = 0.0,
        E_gaba: float = -80.0,
        increase_noise: float = 0.0,
        rates_noise: float = 0.0,
        params_for_pop: bool = False,
        init: dict = {},
    ):
        # Create the arguments
        parameters = f"""
            C              = {C} {': population' if params_for_pop else ''}
            k              = {k} {': population' if params_for_pop else ''}
            v_r            = {v_r} {': population' if params_for_pop else ''}
            v_t            = {v_t} {': population' if params_for_pop else ''}
            v_b            = {v_b} {': population' if params_for_pop else ''}
            a              = {a} {': population' if params_for_pop else ''}
            b              = {b} {': population' if params_for_pop else ''}
            c              = {c} {': population' if params_for_pop else ''}
            d              = {d} {': population' if params_for_pop else ''}
            v_peak         = {v_peak} {': population' if params_for_pop else ''}
            tau_ampa       = {tau_ampa} {': population' if params_for_pop else ''}
            tau_gaba       = {tau_gaba} {': population' if params_for_pop else ''}
            E_ampa         = {E_ampa} {': population' if params_for_pop else ''}
            E_gaba         = {E_gaba} {': population' if params_for_pop else ''}
            I_app          = {I_app} # pA
            increase_noise = {increase_noise} {': population' if params_for_pop else ''}
            rates_noise    = {rates_noise}
        """

        syn = _syn_noisy
        i_v = f"I_app {_I_syn}"
        du = "if v<v_b: -a * u else: a * (b * (v - v_b)**3 - u)"

        # get equations
        equations = _get_equation_izhikevich_2007(syn=syn, i_v=i_v, du=du)

        # set initial values
        equations = _set_init(equations, init)

        super().__init__(
            parameters=parameters,
            equations=equations,
            spike="v >= v_peak",
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2007_FSI_noisy_AMPA",
            description="""
                Standard neuron model from Izhikevich (2007) with additional
                conductance based synapses for AMPA and GABA currents with noise
                in AMPA conductance.
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2007CorbitFsiNoisyAmpa #

Bases: Neuron

TEMPLATE

Izhikevich (2007)-like neuron model with conductance-based AMPA and GABA synapses with noise in the AMPA conductance. Additional slow currents were added to fit the striatal FSI neuron model from Corbit et al. (2016). The additional currents should allow the neuron to produce late spiking.

Parameters:

Name Type Description Default
C float

Membrane capacitance.

20.0
k float

Scaling factor for the quadratic term in the membrane potential.

1.0
b_n float

Sensitivity of the slow current n to the difference between the slow current s and the recovery variable u.

0.1
a_s float

Time scale of the slow current s.

0.1
a_n float

Time scale of the slow current n.

0.1
v_r float

Resting membrane potential.

-55.0
v_t float

Instantaneous activation threshold potential.

-40.0
a float

Time scale of the recovery variable u.

0.1
b float

Sensitivity of the recovery variable u to the the membrane potential v.

-2.0
c float

After-spike reset value of the membrane potential.

-50.0
d float

After-spike change of the recovery variable u.

2.0
v_peak float

Spike cut-off value for the membrane potential.

25.0
nonlin float

Nonlinearity of the input current. (1.0 = linear, 2.0 = square, etc.)

0.1
I_app float

External applied input current.

0.0
tau_ampa float

Time constant of the AMPA synapse.

2.0
tau_gaba float

Time constant of the GABA synapse.

5.0
E_ampa float

Reversal potential of the AMPA synapse.

0.0
E_gaba float

Reversal potential of the GABA synapse.

-80.0
increase_noise float

Increase of AMPA conductance due to noise (equal to a Poisson distributed spike train as input).

0.0
rates_noise float

Rate of the noise in the AMPA conductance.

0.0
params_for_pop bool

If True, the parameters are population-wide and not neuron-specific.

False
init dict

Initial values for the variables.

{}
Variables to record
  • g_ampa
  • g_gaba
  • I_v
  • v
  • u
  • s
  • n
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2007_like_nm.py
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
class Izhikevich2007CorbitFsiNoisyAmpa(Neuron):
    """
    TEMPLATE

    [Izhikevich (2007)](https://isbnsearch.org/isbn/9780262090438)-like neuron model
    with conductance-based AMPA and GABA synapses with noise in the AMPA conductance.
    Additional slow currents were added to fit the striatal FSI neuron model from
    [Corbit et al. (2016)](https://doi.org/10.1523/JNEUROSCI.0339-16.2016). The
    additional currents should allow the neuron to produce late spiking.

    Parameters:
        C (float, optional):
            Membrane capacitance.
        k (float, optional):
            Scaling factor for the quadratic term in the membrane potential.
        b_n (float, optional):
            Sensitivity of the slow current n to the difference between the slow current
            s and the recovery variable u.
        a_s (float, optional):
            Time scale of the slow current s.
        a_n (float, optional):
            Time scale of the slow current n.
        v_r (float, optional):
            Resting membrane potential.
        v_t (float, optional):
            Instantaneous activation threshold potential.
        a (float, optional):
            Time scale of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential.
        d (float, optional):
            After-spike change of the recovery variable u.
        v_peak (float, optional):
            Spike cut-off value for the membrane potential.
        nonlin (float, optional):
            Nonlinearity of the input current. (1.0 = linear, 2.0 = square, etc.)
        I_app (float, optional):
            External applied input current.
        tau_ampa (float, optional):
            Time constant of the AMPA synapse.
        tau_gaba (float, optional):
            Time constant of the GABA synapse.
        E_ampa (float, optional):
            Reversal potential of the AMPA synapse.
        E_gaba (float, optional):
            Reversal potential of the GABA synapse.
        increase_noise (float, optional):
            Increase of AMPA conductance due to noise (equal to a Poisson distributed
            spike train as input).
        rates_noise (float, optional):
            Rate of the noise in the AMPA conductance.
        params_for_pop (bool, optional):
            If True, the parameters are population-wide and not neuron-specific.
        init (dict, optional):
            Initial values for the variables.

    Variables to record:
        - g_ampa
        - g_gaba
        - I_v
        - v
        - u
        - s
        - n
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        C: float = 20.0,
        k: float = 1.0,
        b_n: float = 0.1,
        a_s: float = 0.1,
        a_n: float = 0.1,
        v_r: float = -55.0,
        v_t: float = -40.0,
        a: float = 0.1,
        b: float = -2.0,
        c: float = -50.0,
        d: float = 2.0,
        v_peak: float = 25.0,
        nonlin: float = 0.1,
        I_app: float = 0.0,
        tau_ampa: float = 2.0,
        tau_gaba: float = 5.0,
        E_ampa: float = 0.0,
        E_gaba: float = -80.0,
        increase_noise: float = 0.0,
        rates_noise: float = 0.0,
        params_for_pop: bool = False,
        init: dict = {},
    ):
        # Create the arguments
        parameters = f"""
            C              = {C} {': population' if params_for_pop else ''}
            k              = {k} {': population' if params_for_pop else ''}
            b_n            = {b_n} {': population' if params_for_pop else ''}
            a_s            = {a_s} {': population' if params_for_pop else ''}
            a_n            = {a_n} {': population' if params_for_pop else ''}
            v_r            = {v_r} {': population' if params_for_pop else ''}
            v_t            = {v_t} {': population' if params_for_pop else ''}
            a              = {a} {': population' if params_for_pop else ''}
            b              = {b} {': population' if params_for_pop else ''}
            c              = {c} {': population' if params_for_pop else ''}
            d              = {d} {': population' if params_for_pop else ''}
            v_peak         = {v_peak} {': population' if params_for_pop else ''}
            nonlin         = {nonlin} {': population' if params_for_pop else ''}
            tau_ampa       = {tau_ampa} {': population' if params_for_pop else ''}
            tau_gaba       = {tau_gaba} {': population' if params_for_pop else ''}
            E_ampa         = {E_ampa} {': population' if params_for_pop else ''}
            E_gaba         = {E_gaba} {': population' if params_for_pop else ''}
            I_app          = {I_app} # pA
            increase_noise = {increase_noise} {': population' if params_for_pop else ''}
            rates_noise    = {rates_noise}
        """

        syn = _syn_noisy
        i_v = f"root_func(I_app {_I_syn}, nonlin) - n"
        affix = """
            ds/dt     = a_s*(pos(u)**0.1 - s)
            dn/dt     = a_n*(b_n*(pos(u)**0.1-s) - n)
        """

        # get equations
        equations = _get_equation_izhikevich_2007(syn=syn, i_v=i_v, affix=affix)

        # set initial values
        equations = _set_init(equations, init)

        super().__init__(
            parameters=parameters,
            equations=equations,
            functions="""
                root_func(x,y)=((abs(x))**(1/y))/((x+1e-20)/(abs(x)+ 1e-20))
            """,
            spike="v >= v_peak",
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2007_Corbit_FSI_noisy_AMPA",
            description="""
                Standard neuron model from Izhikevich (2007) with additional
                conductance based synapses for AMPA and GABA currents with noise
                in AMPA conductance. Additional slow currents were added to fit
                the striatal FSI neuron model from Corbit et al. (2016).
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2007CorbitFsiNoisyBase #

Bases: Neuron

TEMPLATE

Izhikevich (2007)-like neuron model with conductance-based AMPA and GABA synapses with noise in the baseline current. Additional slow currents were added to fit the striatal FSI neuron model from Corbit et al. (2016). The additional currents should allow the neuron to produce late spiking.

Parameters:

Name Type Description Default
C float

Membrane capacitance.

20.0
k float

Scaling factor for the quadratic term in the membrane potential.

1.0
b_n float

Sensitivity of the slow current n to the difference between the slow current s and the recovery variable u.

0.1
a_s float

Time scale of the slow current s.

0.1
a_n float

Time scale of the slow current n.

0.1
v_r float

Resting membrane potential.

-55.0
v_t float

Instantaneous activation threshold potential.

-40.0
a float

Time scale of the recovery variable u.

0.1
b float

Sensitivity of the recovery variable u to the the membrane potential v.

-2.0
c float

After-spike reset value of the membrane potential.

-50.0
d float

After-spike change of the recovery variable u.

2.0
v_peak float

Spike cut-off value for the membrane potential.

25.0
nonlin float

Nonlinearity of the input current. (1.0 = linear, 2.0 = square, etc.)

0.1
I_app float

External applied input current.

0.0
tau_ampa float

Time constant of the AMPA synapse.

2.0
tau_gaba float

Time constant of the GABA synapse.

5.0
E_ampa float

Reversal potential of the AMPA synapse.

0.0
E_gaba float

Reversal potential of the GABA synapse.

-80.0
base_mean float

Mean of the baseline current.

0.0
base_noise float

Standard deviation of the baseline current noise.

0.0
rate_base_noise float

Rate of the noise update (Poisson distributed) in the baseline current.

0.0
params_for_pop bool

If True, the parameters are population-wide and not neuron-specific.

False
init dict

Initial values for the variables.

{}
Variables to record
  • offset_base
  • I_base
  • g_ampa
  • g_gaba
  • I_v
  • v
  • u
  • s
  • n
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2007_like_nm.py
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
class Izhikevich2007CorbitFsiNoisyBase(Neuron):
    """
    TEMPLATE

    [Izhikevich (2007)](https://isbnsearch.org/isbn/9780262090438)-like neuron model
    with conductance-based AMPA and GABA synapses with noise in the baseline current.
    Additional slow currents were added to fit the striatal FSI neuron model from
    [Corbit et al. (2016)](https://doi.org/10.1523/JNEUROSCI.0339-16.2016). The
    additional currents should allow the neuron to produce late spiking.

    Parameters:
        C (float, optional):
            Membrane capacitance.
        k (float, optional):
            Scaling factor for the quadratic term in the membrane potential.
        b_n (float, optional):
            Sensitivity of the slow current n to the difference between the slow current
            s and the recovery variable u.
        a_s (float, optional):
            Time scale of the slow current s.
        a_n (float, optional):
            Time scale of the slow current n.
        v_r (float, optional):
            Resting membrane potential.
        v_t (float, optional):
            Instantaneous activation threshold potential.
        a (float, optional):
            Time scale of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential.
        d (float, optional):
            After-spike change of the recovery variable u.
        v_peak (float, optional):
            Spike cut-off value for the membrane potential.
        nonlin (float, optional):
            Nonlinearity of the input current. (1.0 = linear, 2.0 = square, etc.)
        I_app (float, optional):
            External applied input current.
        tau_ampa (float, optional):
            Time constant of the AMPA synapse.
        tau_gaba (float, optional):
            Time constant of the GABA synapse.
        E_ampa (float, optional):
            Reversal potential of the AMPA synapse.
        E_gaba (float, optional):
            Reversal potential of the GABA synapse.
        base_mean (float, optional):
            Mean of the baseline current.
        base_noise (float, optional):
            Standard deviation of the baseline current noise.
        rate_base_noise (float, optional):
            Rate of the noise update (Poisson distributed) in the baseline current.
        params_for_pop (bool, optional):
            If True, the parameters are population-wide and not neuron-specific.
        init (dict, optional):
            Initial values for the variables.

    Variables to record:
        - offset_base
        - I_base
        - g_ampa
        - g_gaba
        - I_v
        - v
        - u
        - s
        - n
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        C: float = 20.0,
        k: float = 1.0,
        b_n: float = 0.1,
        a_s: float = 0.1,
        a_n: float = 0.1,
        v_r: float = -55.0,
        v_t: float = -40.0,
        a: float = 0.1,
        b: float = -2.0,
        c: float = -50.0,
        d: float = 2.0,
        v_peak: float = 25.0,
        nonlin: float = 0.1,
        I_app: float = 0.0,
        tau_ampa: float = 2.0,
        tau_gaba: float = 5.0,
        E_ampa: float = 0.0,
        E_gaba: float = -80.0,
        base_mean: float = 0.0,
        base_noise: float = 0.0,
        rate_base_noise: float = 0.0,
        params_for_pop: bool = False,
        init: dict = {},
    ):
        # Create the arguments
        parameters = f"""
            C              = {C} {': population' if params_for_pop else ''}
            k              = {k} {': population' if params_for_pop else ''}
            b_n            = {b_n} {': population' if params_for_pop else ''}
            a_s            = {a_s} {': population' if params_for_pop else ''}
            a_n            = {a_n} {': population' if params_for_pop else ''}
            v_r            = {v_r} {': population' if params_for_pop else ''}
            v_t            = {v_t} {': population' if params_for_pop else ''}
            a              = {a} {': population' if params_for_pop else ''}
            b              = {b} {': population' if params_for_pop else ''}
            c              = {c} {': population' if params_for_pop else ''}
            d              = {d} {': population' if params_for_pop else ''}
            v_peak         = {v_peak} {': population' if params_for_pop else ''}
            nonlin         = {nonlin} {': population' if params_for_pop else ''}
            tau_ampa       = {tau_ampa} {': population' if params_for_pop else ''}
            tau_gaba       = {tau_gaba} {': population' if params_for_pop else ''}
            E_ampa         = {E_ampa} {': population' if params_for_pop else ''}
            E_gaba         = {E_gaba} {': population' if params_for_pop else ''}
            I_app          = {I_app} # pA
            base_mean      = {base_mean}
            base_noise     = {base_noise}
            rate_base_noise = {rate_base_noise}
        """

        syn = _syn_default
        i_v = f"root_func(I_app {_I_syn}, nonlin) - n + I_base"
        prefix = _I_base_noise
        affix = """
            ds/dt     = a_s*(pos(u)**0.1 - s)
            dn/dt     = a_n*(b_n*(pos(u)**0.1-s) - n)
        """

        # get equations
        equations = _get_equation_izhikevich_2007(
            syn=syn, i_v=i_v, prefix=prefix, affix=affix
        )

        # set initial values
        equations = _set_init(equations, init)

        super().__init__(
            parameters=parameters,
            equations=equations,
            functions="""
                root_func(x,y)=((abs(x))**(1/y))/((x+1e-20)/(abs(x)+ 1e-20))
            """,
            spike="v >= v_peak",
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2007_Corbit_FSI_noisy_base",
            description="""
                Standard neuron model from Izhikevich (2007) with additional
                conductance based synapses for AMPA and GABA currents with noise
                in the baseline current. Additional slow currents were added to fit
                the striatal FSI neuron model from Corbit et al. (2016).
            """,
        )

        # For reporting
        self._instantiated.append(True)

Izhikevich2007NoisyAmpaOscillating #

Bases: Neuron

TEMPLATE

Izhikevich (2007)-like neuron model with conductance-based AMPA and GABA synapses with noise in the AMPA conductance. An additional oscillating current was added to the model.

Parameters:

Name Type Description Default
C float

Membrane capacitance.

20.0
k float

Scaling factor for the quadratic term in the membrane potential.

1.0
v_r float

Resting membrane potential.

-55.0
v_t float

Instantaneous activation threshold potential.

-40.0
a float

Time scale of the recovery variable u.

0.1
b float

Sensitivity of the recovery variable u to the the membrane potential v.

-2.0
c float

After-spike reset value of the membrane potential.

-50.0
d float

After-spike change of the recovery variable u.

2.0
v_peak float

Spike cut-off value for the membrane potential.

25.0
I_app float

External applied input current.

0.0
tau_ampa float

Time constant of the AMPA synapse.

2.0
tau_gaba float

Time constant of the GABA synapse.

5.0
E_ampa float

Reversal potential of the AMPA synapse.

0.0
E_gaba float

Reversal potential of the GABA synapse.

-80.0
increase_noise float

Increase of AMPA conductance due to noise (equal to a Poisson distributed spike train as input).

0.0
rates_noise float

Rate of the noise in the AMPA conductance.

0.0
freq float

Frequency of the oscillating current.

0.0
amp float

Amplitude of the oscillating current.

300.0
params_for_pop bool

If True, the parameters are population-wide and not neuron-specific.

False
init dict

Initial values for the variables.

{}
Variables to record
  • osc
  • g_ampa
  • g_gaba
  • I_v
  • v
  • u
  • r
Source code in src/CompNeuroPy/neuron_models/final_models/izhikevich_2007_like_nm.py
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
class Izhikevich2007NoisyAmpaOscillating(Neuron):
    """
    TEMPLATE

    [Izhikevich (2007)](https://isbnsearch.org/isbn/9780262090438)-like neuron model
    with conductance-based AMPA and GABA synapses with noise in the AMPA conductance.
    An additional oscillating current was added to the model.

    Parameters:
        C (float, optional):
            Membrane capacitance.
        k (float, optional):
            Scaling factor for the quadratic term in the membrane potential.
        v_r (float, optional):
            Resting membrane potential.
        v_t (float, optional):
            Instantaneous activation threshold potential.
        a (float, optional):
            Time scale of the recovery variable u.
        b (float, optional):
            Sensitivity of the recovery variable u to the the membrane potential v.
        c (float, optional):
            After-spike reset value of the membrane potential.
        d (float, optional):
            After-spike change of the recovery variable u.
        v_peak (float, optional):
            Spike cut-off value for the membrane potential.
        I_app (float, optional):
            External applied input current.
        tau_ampa (float, optional):
            Time constant of the AMPA synapse.
        tau_gaba (float, optional):
            Time constant of the GABA synapse.
        E_ampa (float, optional):
            Reversal potential of the AMPA synapse.
        E_gaba (float, optional):
            Reversal potential of the GABA synapse.
        increase_noise (float, optional):
            Increase of AMPA conductance due to noise (equal to a Poisson distributed
            spike train as input).
        rates_noise (float, optional):
            Rate of the noise in the AMPA conductance.
        freq (float, optional):
            Frequency of the oscillating current.
        amp (float, optional):
            Amplitude of the oscillating current.
        params_for_pop (bool, optional):
            If True, the parameters are population-wide and not neuron-specific.
        init (dict, optional):
            Initial values for the variables.

    Variables to record:
        - osc
        - g_ampa
        - g_gaba
        - I_v
        - v
        - u
        - r
    """

    # For reporting
    _instantiated = []

    def __init__(
        self,
        C: float = 20.0,
        k: float = 1.0,
        v_r: float = -55.0,
        v_t: float = -40.0,
        a: float = 0.1,
        b: float = -2.0,
        c: float = -50.0,
        d: float = 2.0,
        v_peak: float = 25.0,
        I_app: float = 0.0,
        tau_ampa: float = 2.0,
        tau_gaba: float = 5.0,
        E_ampa: float = 0.0,
        E_gaba: float = -80.0,
        increase_noise: float = 0.0,
        rates_noise: float = 0.0,
        freq: float = 0.0,
        amp: float = 300.0,
        params_for_pop: bool = False,
        init: dict = {},
    ):
        # Create the arguments
        parameters = f"""
            C              = {C} {': population' if params_for_pop else ''}
            k              = {k} {': population' if params_for_pop else ''}
            v_r            = {v_r} {': population' if params_for_pop else ''}
            v_t            = {v_t} {': population' if params_for_pop else ''}
            a              = {a} {': population' if params_for_pop else ''}
            b              = {b} {': population' if params_for_pop else ''}
            c              = {c} {': population' if params_for_pop else ''}
            d              = {d} {': population' if params_for_pop else ''}
            v_peak         = {v_peak} {': population' if params_for_pop else ''}
            tau_ampa       = {tau_ampa} {': population' if params_for_pop else ''}
            tau_gaba       = {tau_gaba} {': population' if params_for_pop else ''}
            E_ampa         = {E_ampa} {': population' if params_for_pop else ''}
            E_gaba         = {E_gaba} {': population' if params_for_pop else ''}
            I_app          = {I_app} # pA
            increase_noise = {increase_noise} {': population' if params_for_pop else ''}
            rates_noise    = {rates_noise}
            freq           = {freq}
            amp            = {amp}
        """

        syn = _syn_noisy
        i_v = f"I_app {_I_syn} + osc"
        prefix = "osc = amp * sin(t * 2 * pi * (freq  /1000))"

        # get equations
        equations = _get_equation_izhikevich_2007(syn=syn, i_v=i_v, prefix=prefix)

        # set initial values
        equations = _set_init(equations, init)

        super().__init__(
            parameters=parameters,
            equations=equations,
            spike="v >= v_peak",
            reset="""
                v = c
                u = u + d
            """,
            name="Izhikevich2007_noisy_AMPA_oscillating",
            description="""
                Standard neuron model from Izhikevich (2007) with additional
                conductance based synapses for AMPA and GABA currents with noise
                in AMPA conductance. An additional oscillating current was added
                to the model.
            """,
        )

        # For reporting
        self._instantiated.append(True)