Skip to content

Commit c2620c3

Browse files
authored
Add plastic synapse weight sign test (#973)
1 parent 731455c commit c2620c3

10 files changed

+233
-81
lines changed

models/synapses/neuromodulated_stdp_synapse.nestml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# neuromodulated_stdp - Synapse model for spike-timing dependent plasticity modulated by a neurotransmitter such as dopamine
22
# ##########################################################################################################################
3-
#
3+
#
44
# Description
55
# +++++++++++
6-
#
6+
#
77
# stdp_dopamine_synapse is a connection to create synapses with
88
# dopamine-modulated spike-timing dependent plasticity (used as a
99
# benchmark model in [1]_, based on [2]_). The dopaminergic signal is a
1010
# low-pass filtered version of the spike rate of a user-specific pool
1111
# of neurons. The spikes emitted by the pool of dopamine neurons are
1212
# delivered to the synapse via the assigned volume transmitter. The
1313
# dopaminergic dynamics is calculated in the synapse itself.
14-
#
14+
#
15+
# Note that in this particular STDP synapse model, the weight is not allowed to be negative. In case an inhibitory STDP synapse needs to be modeled, this model (with weight >= 0 at all times) can be connected to a postsynaptic neuron at its appropriate (inhibitory) input port. The sign of the postsynaptic response is thus handled in the postsynaptic neuron. In principle, an STDP synapse model can be defined that allows for negative weights, but in this case, care should be taken to prevent the sign of the weight from changing during learning, as a biological synapse cannot simply switch from one type to another, say, from glutamatergic to GABAergic.
16+
#
17+
#
1518
# References
1619
# ++++++++++
1720
#
@@ -28,7 +31,7 @@
2831
# +++++++++++++++++++
2932
#
3033
# This file is part of NEST.
31-
#
34+
#
3235
# Copyright (C) 2004 The NEST Initiative
3336
#
3437
# NEST is free software: you can redistribute it and/or modify
@@ -47,7 +50,7 @@
4750
#
4851
model neuromodulated_stdp_synapse:
4952
state:
50-
w real = 1.
53+
w real = 1. [[w >= 0]]
5154
n real = 0. # Neuromodulator concentration
5255
c real = 0. # Eligibility trace
5356
pre_tr real = 0.
@@ -60,8 +63,8 @@ model neuromodulated_stdp_synapse:
6063
tau_c ms = 1000 ms # Time constant of eligibility trace
6164
tau_n ms = 200 ms # Time constant of dopaminergic trace
6265
b real = 0. # Dopaminergic baseline concentration
63-
Wmax real = 200. # Maximal synaptic weight
64-
Wmin real = 0. # Minimal synaptic weight
66+
Wmax real = 200. [[Wmax >= 0]] # Maximal synaptic weight
67+
Wmin real = 0. [[Wmin >= 0]] # Minimal synaptic weight
6568
A_plus real = 1. # Multiplier applied to weight changes caused by pre-before-post spike pairings. If b (dopamine baseline concentration) is zero, then A_plus is simply the multiplier for facilitation (as in the stdp_synapse model). If b is not zero, then A_plus will be the multiplier for facilitation only if n - b is positive, where n is the instantenous dopamine concentration in the volume transmitter. If n - b is negative, A_plus will be the multiplier for depression.
6669
A_minus real = 1.5 # Multiplier applied to weight changes caused by post-before-pre spike pairings. If b (dopamine baseline concentration) is zero, then A_minus is simply the multiplier for depression (as in the stdp_synapse model). If b is not zero, then A_minus will be the multiplier for depression only if n - b is positive, where n is the instantenous dopamine concentration in the volume transmitter. If n - b is negative, A_minus will be the multiplier for facilitation.
6770

models/synapses/noisy_synapse.nestml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# noisy_synapse - Static synapse with Gaussian noise
22
# ##################################################
3-
#
3+
#
44
# Description
55
# +++++++++++
6-
#
6+
#
77
# Each presynaptic spike is passed to the postsynaptic partner with a weight sampled as :math:`w + A_\text{noise} \mathcal{N}(0, 1)`.
88
#
99
#
1010
# Copyright statement
1111
# +++++++++++++++++++
1212
#
1313
# This file is part of NEST.
14-
#
14+
#
1515
# Copyright (C) 2004 The NEST Initiative
1616
#
1717
# NEST is free software: you can redistribute it and/or modify

models/synapses/static_synapse.nestml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Static synapse
22
# ##############
3-
#
3+
#
44
# Description
55
# +++++++++++
66
# A synapse where the synaptic strength (weight) does not evolve with simulated time, but is defined as a (constant) parameter.
@@ -10,7 +10,7 @@
1010
# +++++++++++++++++++
1111
#
1212
# This file is part of NEST.
13-
#
13+
#
1414
# Copyright (C) 2004 The NEST Initiative
1515
#
1616
# NEST is free software: you can redistribute it and/or modify

models/synapses/stdp_nn_pre_centered_synapse.nestml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# stdp_nn_pre_centered - Synapse type for spike-timing dependent plasticity, with nearest-neighbour spike pairing
22
# ###############################################################################################################
3-
#
3+
#
44
# Description
55
# +++++++++++
6-
#
6+
#
77
# stdp_nn_pre_centered_synapse is a connector to create synapses with spike
88
# time dependent plasticity with the presynaptic-centered nearest-neighbour
99
# spike pairing scheme, as described in [1]_.
10-
#
10+
#
1111
# Each presynaptic spike is taken into account in the STDP weight change rule
1212
# with the nearest preceding postsynaptic one and the nearest succeeding
1313
# postsynaptic one (instead of pairing with all spikes, like in stdp_synapse).
@@ -16,35 +16,37 @@
1616
# occurs, it is accounted in the facilitation rule with all preceding
1717
# presynaptic spikes that were not earlier than the previous postsynaptic
1818
# spike. For a clear illustration of this scheme see fig. 7B in [2]_.
19-
#
19+
#
2020
# The pairs exactly coinciding (so that presynaptic_spike == postsynaptic_spike
2121
# + dendritic_delay), leading to zero delta_t, are discarded. In this case the
2222
# concerned pre/postsynaptic spike is paired with the second latest preceding
2323
# post/presynaptic one (for example, pre=={10 ms; 20 ms} and post=={20 ms} will
2424
# result in a potentiation pair 20-to-10).
25-
#
25+
#
2626
# The implementation involves two additional variables - presynaptic and
2727
# postsynaptic traces [2]_. The presynaptic trace decays exponentially over
2828
# time with the time constant tau_plus, increases by 1 on a pre-spike
2929
# occurrence, and is reset to 0 on a post-spike occurrence. The postsynaptic
3030
# trace (implemented on the postsynaptic neuron side) decays with the time
3131
# constant tau_minus and increases to 1 on a post-spike occurrence.
32-
#
32+
#
3333
# .. figure:: https://raw.githubusercontent.com/nest/nestml/master/doc/fig/stdp-nearest-neighbour.png
34-
#
34+
#
3535
# Figure 7 from Morrison, Diesmann and Gerstner
36-
#
36+
#
3737
# Original caption:
38-
#
38+
#
3939
# Phenomenological models of synaptic plasticity based on spike timing", Biological Cybernetics 98 (2008). "Examples of nearest neighbor spike pairing schemes for a pre-synaptic neuron j and a postsynaptic neuron i. In each case, the dark gray indicate which pairings contribute toward depression of a synapse, and light gray indicate which pairings contribute toward potentiation. **(a)** Symmetric interpretation: each presynaptic spike is paired with the last postsynaptic spike, and each postsynaptic spike is paired with the last presynaptic spike (Morrison et al. 2007). **(b)** Presynaptic centered interpretation: each presynaptic spike is paired with the last postsynaptic spike and the next postsynaptic spike (Izhikevich and Desai 2003; Burkitt et al. 2004: Model II). **(c)** Reduced symmetric interpretation: as in **(b)** but only for immediate pairings (Burkitt et al. 2004: Model IV, also implemented in hardware by Schemmel et al. 2006)
40-
#
41-
#
40+
#
41+
# Note that in this particular STDP synapse model, the weight is not allowed to be negative. In case an inhibitory STDP synapse needs to be modeled, this model (with weight >= 0 at all times) can be connected to a postsynaptic neuron at its appropriate (inhibitory) input port. The sign of the postsynaptic response is thus handled in the postsynaptic neuron. In principle, an STDP synapse model can be defined that allows for negative weights, but in this case, care should be taken to prevent the sign of the weight from changing during learning, as a biological synapse cannot simply switch from one type to another, say, from glutamatergic to GABAergic.
42+
#
43+
#
4244
# References
4345
# ++++++++++
44-
#
46+
#
4547
# .. [1] Izhikevich E. M., Desai N. S. (2003) Relating STDP to BCM,
4648
# Neural Comput. 15, 1511--1523
47-
#
49+
#
4850
# .. [2] Morrison A., Diesmann M., and Gerstner W. (2008) Phenomenological
4951
# models of synaptic plasticity based on spike timing,
5052
# Biol. Cybern. 98, 459--478
@@ -54,7 +56,7 @@
5456
# +++++++++++++++++++
5557
#
5658
# This file is part of NEST.
57-
#
59+
#
5860
# Copyright (C) 2004 The NEST Initiative
5961
#
6062
# NEST is free software: you can redistribute it and/or modify
@@ -73,7 +75,7 @@
7375
#
7476
model stdp_nn_pre_centered_synapse:
7577
state:
76-
w real = 1 # Synaptic weight
78+
w real = 1 [[w >= 0]] # Synaptic weight
7779
pre_trace real = 0.
7880
post_trace real = 0.
7981

@@ -85,8 +87,8 @@ model stdp_nn_pre_centered_synapse:
8587
alpha real = 1.
8688
mu_plus real = 1.
8789
mu_minus real = 1.
88-
Wmax real = 100.
89-
Wmin real = 0.
90+
Wmin real = 0. [[Wmin >= 0]]
91+
Wmax real = 100. [[Wmax >= 0]]
9092

9193
equations:
9294
# nearest-neighbour trace of presynaptic neuron

models/synapses/stdp_nn_restr_symm_synapse.nestml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Synapse type for spike-timing dependent plasticity with restricted symmetric nearest-neighbour spike pairing scheme
22
# ###################################################################################################################
3-
#
3+
#
44
# Description
55
# +++++++++++
6-
#
6+
#
77
# stdp_nn_restr_synapse is a connector to create synapses with spike time
88
# dependent plasticity with the restricted symmetric nearest-neighbour spike
99
# pairing scheme (fig. 7C in [1]_).
10-
#
10+
#
1111
# When a presynaptic spike occurs, it is taken into account in the depression
1212
# part of the STDP weight change rule with the nearest preceding postsynaptic
1313
# one, but only if the latter occured not earlier than the previous presynaptic
@@ -20,23 +20,26 @@
2020
# concerned pre/postsynaptic spike is paired with the second latest preceding
2121
# post/presynaptic one (for example, pre=={10 ms; 20 ms} and post=={20 ms} will
2222
# result in a potentiation pair 20-to-10).
23-
#
23+
#
2424
# The implementation relies on an additional variable - the postsynaptic
2525
# eligibility trace [1]_ (implemented on the postsynaptic neuron side). It
2626
# decays exponentially with the time constant tau_minus and increases to 1 on
2727
# a post-spike occurrence (instead of increasing by 1 as in stdp_synapse).
28-
#
28+
#
2929
# .. figure:: https://raw.githubusercontent.com/nest/nestml/master/doc/fig/stdp-nearest-neighbour.png
30-
#
30+
#
3131
# Figure 7 from Morrison, Diesmann and Gerstner
32-
#
32+
#
3333
# Original caption:
34-
#
34+
#
3535
# Phenomenological models of synaptic plasticity based on spike timing", Biological Cybernetics 98 (2008). "Examples of nearest neighbor spike pairing schemes for a pre-synaptic neuron j and a postsynaptic neuron i. In each case, the dark gray indicate which pairings contribute toward depression of a synapse, and light gray indicate which pairings contribute toward potentiation. **(a)** Symmetric interpretation: each presynaptic spike is paired with the last postsynaptic spike, and each postsynaptic spike is paired with the last presynaptic spike (Morrison et al. 2007). **(b)** Presynaptic centered interpretation: each presynaptic spike is paired with the last postsynaptic spike and the next postsynaptic spike (Izhikevich and Desai 2003; Burkitt et al. 2004: Model II). **(c)** Reduced symmetric interpretation: as in **(b)** but only for immediate pairings (Burkitt et al. 2004: Model IV, also implemented in hardware by Schemmel et al. 2006)
36-
#
36+
#
37+
# Note that in this particular STDP synapse model, the weight is not allowed to be negative. In case an inhibitory STDP synapse needs to be modeled, this model (with weight >= 0 at all times) can be connected to a postsynaptic neuron at its appropriate (inhibitory) input port. The sign of the postsynaptic response is thus handled in the postsynaptic neuron. In principle, an STDP synapse model can be defined that allows for negative weights, but in this case, care should be taken to prevent the sign of the weight from changing during learning, as a biological synapse cannot simply switch from one type to another, say, from glutamatergic to GABAergic.
38+
#
39+
#
3740
# References
3841
# ++++++++++
39-
#
42+
#
4043
# .. [1] Morrison A., Diesmann M., and Gerstner W. (2008) Phenomenological
4144
# models of synaptic plasticity based on spike timing,
4245
# Biol. Cybern. 98, 459--478
@@ -46,7 +49,7 @@
4649
# +++++++++++++++++++
4750
#
4851
# This file is part of NEST.
49-
#
52+
#
5053
# Copyright (C) 2004 The NEST Initiative
5154
#
5255
# NEST is free software: you can redistribute it and/or modify
@@ -65,7 +68,7 @@
6568
#
6669
model stdp_nn_restr_symm_synapse:
6770
state:
68-
w real = 1. # Synaptic weight
71+
w real = 1. [[w >= 0]] # Synaptic weight
6972
pre_trace real = 0.
7073
post_trace real = 0.
7174
pre_handled boolean = True
@@ -78,8 +81,8 @@ model stdp_nn_restr_symm_synapse:
7881
alpha real = 1.
7982
mu_plus real = 1.
8083
mu_minus real = 1.
81-
Wmax real = 100.
82-
Wmin real = 0.
84+
Wmin real = 0. [[Wmin >= 0]]
85+
Wmax real = 100. [[Wmax >= 0]]
8386

8487
equations:
8588
# nearest-neighbour trace of presynaptic neuron

models/synapses/stdp_nn_symm_synapse.nestml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,50 @@
11
# Synapse type for spike-timing dependent plasticity with symmetric nearest-neighbour spike pairing scheme
22
# ########################################################################################################
3-
#
3+
#
44
# Description
55
# +++++++++++
6-
#
6+
#
77
# stdp_nn_symm_synapse is a connector to create synapses with spike time
88
# dependent plasticity with the symmetric nearest-neighbour spike pairing
99
# scheme [1]_.
10-
#
10+
#
1111
# When a presynaptic spike occurs, it is taken into account in the depression
1212
# part of the STDP weight change rule with the nearest preceding postsynaptic
1313
# one, and when a postsynaptic spike occurs, it is accounted in the
1414
# facilitation rule with the nearest preceding presynaptic one (instead of
1515
# pairing with all spikes, like in stdp_synapse). For a clear illustration of
1616
# this scheme see fig. 7A in [2]_.
17-
#
17+
#
1818
# The pairs exactly coinciding (so that presynaptic_spike == postsynaptic_spike
1919
# + dendritic_delay), leading to zero delta_t, are discarded. In this case the
2020
# concerned pre/postsynaptic spike is paired with the second latest preceding
2121
# post/presynaptic one (for example, pre=={10 ms; 20 ms} and post=={20 ms} will
2222
# result in a potentiation pair 20-to-10).
23-
#
23+
#
2424
# The implementation involves two additional variables - presynaptic and
2525
# postsynaptic traces [2]_. The presynaptic trace decays exponentially over
2626
# time with the time constant tau_plus and increases to 1 on a pre-spike
2727
# occurrence. The postsynaptic trace (implemented on the postsynaptic neuron
2828
# side) decays with the time constant tau_minus and increases to 1 on a
2929
# post-spike occurrence.
30-
#
30+
#
3131
# .. figure:: https://raw.githubusercontent.com/nest/nestml/master/doc/fig/stdp-nearest-neighbour.png
32-
#
32+
#
3333
# Figure 7 from Morrison, Diesmann and Gerstner
34-
#
34+
#
3535
# Original caption:
36-
#
36+
#
3737
# Phenomenological models of synaptic plasticity based on spike timing", Biological Cybernetics 98 (2008). "Examples of nearest neighbor spike pairing schemes for a pre-synaptic neuron j and a postsynaptic neuron i. In each case, the dark gray indicate which pairings contribute toward depression of a synapse, and light gray indicate which pairings contribute toward potentiation. **(a)** Symmetric interpretation: each presynaptic spike is paired with the last postsynaptic spike, and each postsynaptic spike is paired with the last presynaptic spike (Morrison et al. 2007). **(b)** Presynaptic centered interpretation: each presynaptic spike is paired with the last postsynaptic spike and the next postsynaptic spike (Izhikevich and Desai 2003; Burkitt et al. 2004: Model II). **(c)** Reduced symmetric interpretation: as in **(b)** but only for immediate pairings (Burkitt et al. 2004: Model IV, also implemented in hardware by Schemmel et al. 2006)
38-
#
38+
#
39+
# Note that in this particular STDP synapse model, the weight is not allowed to be negative. In case an inhibitory STDP synapse needs to be modeled, this model (with weight >= 0 at all times) can be connected to a postsynaptic neuron at its appropriate (inhibitory) input port. The sign of the postsynaptic response is thus handled in the postsynaptic neuron. In principle, an STDP synapse model can be defined that allows for negative weights, but in this case, care should be taken to prevent the sign of the weight from changing during learning, as a biological synapse cannot simply switch from one type to another, say, from glutamatergic to GABAergic.
40+
#
41+
#
3942
# References
4043
# ++++++++++
41-
#
44+
#
4245
# .. [1] Morrison A., Aertsen A., Diesmann M. (2007) Spike-timing dependent
4346
# plasticity in balanced random networks, Neural Comput. 19:1437--1467
44-
#
47+
#
4548
# .. [2] Morrison A., Diesmann M., and Gerstner W. (2008) Phenomenological
4649
# models of synaptic plasticity based on spike timing,
4750
# Biol. Cybern. 98, 459--478
@@ -51,7 +54,7 @@
5154
# +++++++++++++++++++
5255
#
5356
# This file is part of NEST.
54-
#
57+
#
5558
# Copyright (C) 2004 The NEST Initiative
5659
#
5760
# NEST is free software: you can redistribute it and/or modify
@@ -70,7 +73,7 @@
7073
#
7174
model stdp_nn_symm_synapse:
7275
state:
73-
w real = 1 # Synaptic weight
76+
w real = 1 [[w >= 0]] # Synaptic weight
7477
pre_trace real = 0.
7578
post_trace real = 0.
7679

@@ -82,8 +85,8 @@ model stdp_nn_symm_synapse:
8285
alpha real = 1.
8386
mu_plus real = 1.
8487
mu_minus real = 1.
85-
Wmax real = 100.
86-
Wmin real = 0.
88+
Wmax real = 100. [[Wmax >= 0]]
89+
Wmin real = 0. [[Wmin >= 0]]
8790

8891
equations:
8992
# nearest-neighbour trace of presynaptic neuron

0 commit comments

Comments
 (0)