Skip to content

Commit c835a6a

Browse files
author
Alexander Ororbia
committed
added calc_update() co-routine to hebbian-syn component
1 parent af76edb commit c835a6a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ngclearn/components/synapses/hebbian/hebbianSynapse.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,24 @@ def _compute_update(
221221
post_wght=post_wght)
222222
return dW, db
223223

224+
@compilable
225+
def calc_update(self):
226+
# Get the variables
227+
pre = self.pre.get()
228+
post = self.post.get()
229+
weights = self.weights.get()
230+
biases = self.biases.get()
231+
opt_params = self.opt_params.get()
232+
233+
## calculate synaptic update values
234+
dWeights, dBiases = HebbianSynapse._compute_update(
235+
self.w_bound, self.is_nonnegative, self.sign_value, self.prior_type, self.prior_lmbda, self.pre_wght, self.post_wght,
236+
pre, post, weights
237+
)
238+
239+
self.dWeights.set(dWeights)
240+
self.dBiases.set(dBiases)
241+
224242
@compilable
225243
def evolve(self):
226244
# Get the variables

0 commit comments

Comments
 (0)