From 94b2453bc321c185dd8a6420e32a0be29f03e2df Mon Sep 17 00:00:00 2001 From: ago109 Date: Mon, 1 Jul 2024 17:04:07 -0400 Subject: [PATCH] mod to gated-hebb --- ngclearn/components/synapses/hebbian/gatedHebbianSynapse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ngclearn/components/synapses/hebbian/gatedHebbianSynapse.py b/ngclearn/components/synapses/hebbian/gatedHebbianSynapse.py index b1e99c0fc..3d17f77cf 100755 --- a/ngclearn/components/synapses/hebbian/gatedHebbianSynapse.py +++ b/ngclearn/components/synapses/hebbian/gatedHebbianSynapse.py @@ -43,11 +43,11 @@ def _evolve(bias_init, eta, w_decay, w_bound, pre, post, preSpike, ## calculate synaptic update values dWeights, dBiases = GatedHebbianSynapse._compute_update(w_bound, pre, post, weights) weights = weights + dWeights * eta - if bias_init != None: - biases = biases + dBiases * eta if w_decay > 0.: Wdec = jnp.matmul((1. - preSpike).T, postSpike) * w_decay weights = weights - Wdec + if bias_init != None: + biases = biases + dBiases * eta weights = jnp.clip(weights, 0., w_bound) return weights, biases, dWeights, dBiases