Skip to content

Commit

Permalink
minor cleanup of hebb syn
Browse files Browse the repository at this point in the history
  • Loading branch information
ago109 committed Jul 1, 2024
1 parent 55eea4c commit ee4e401
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ngclearn/components/synapses/hebbian/hebbianSynapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,15 @@ def _reset(batch_size, shape):
jnp.zeros(shape[1]), # db
)

@resolver(_reset)
def reset(self, inputs, outputs, pre, post, dWeights, dBiases):
self.inputs.set(inputs)
self.outputs.set(outputs)
self.pre.set(pre)
self.post.set(post)
self.dWeights.set(dWeights)
self.dBiases.set(dBiases)

@classmethod
def help(cls): ## component help function
properties = {
Expand Down Expand Up @@ -265,15 +274,6 @@ def help(cls): ## component help function
"hyperparameters": hyperparams}
return info

@resolver(_reset)
def reset(self, inputs, outputs, pre, post, dWeights, dBiases):
self.inputs.set(inputs)
self.outputs.set(outputs)
self.pre.set(pre)
self.post.set(post)
self.dWeights.set(dWeights)
self.dBiases.set(dBiases)

def __repr__(self):
comps = [varname for varname in dir(self) if Compartment.is_compartment(getattr(self, varname))]
maxlen = max(len(c) for c in comps) + 5
Expand Down

0 comments on commit ee4e401

Please sign in to comment.