Skip to content

Commit d352293

Browse files
committed
Merge branch 'major_release_update' of github.com:NACLab/ngc-learn into major_release_update
2 parents 40812ff + fe28a03 commit d352293

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

ngclearn/components/synapses/modulated/MSTDPETSynapse.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,28 @@ def __init__(
9494
def evolve(
9595
dt, w_bound, w_eps, preTrace_target, mu, Aplus, Aminus, tau_elg, elg_decay, preSpike, postSpike, preTrace,
9696
postTrace, weights, dWeights, eta, modulator, eligibility
97-
):
97+
):
98+
'''
99+
dW_dt = TraceSTDPSynapse._compute_update( ## use Hebbian/STDP rule to obtain a non-modulated update
100+
dt, w_bound, preTrace_target, mu, Aplus, Aminus, preSpike, postSpike, preTrace, postTrace, weights
101+
)
102+
dWeights = dW_dt ## can think of this as eligibility at time t
103+
'''
104+
98105
if tau_elg > 0.: ## perform dynamics of M-STDP-ET
99106
eligibility = eligibility * jnp.exp(-dt / tau_elg) * elg_decay + dWeights/tau_elg
100107
else: ## otherwise, just do M-STDP
101108
eligibility = dWeights ## dynamics of M-STDP had no eligibility tracing
102109
## do a gradient ascent update/shift
103110
weights = weights + eligibility * modulator * eta ## do modulated update
111+
#'''
104112
dW_dt = TraceSTDPSynapse._compute_update( ## use Hebbian/STDP rule to obtain a non-modulated update
105113
dt, w_bound, preTrace_target, mu, Aplus, Aminus, preSpike, postSpike, preTrace, postTrace, weights
106114
)
107115
dWeights = dW_dt ## can think of this as eligibility at time t
108-
109-
#w_eps = 0. # 0.01
116+
#'''
117+
118+
#w_eps = 0.01
110119
weights = jnp.clip(weights, w_eps, w_bound - w_eps) # jnp.abs(w_bound))
111120

112121
return weights, dWeights, eligibility

tests/components/synapses/modulated/test_MSTDPETSynapse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ def test_MSTDPETSynapse1():
8383
#print(a.weights.value)
8484
assert_array_equal(a.weights.value, jnp.array([[0.75]]))
8585

86-
test_MSTDPETSynapse1()
86+
#test_MSTDPETSynapse1()

0 commit comments

Comments
 (0)