-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable get/set on learning rule parameters #622
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I believe the runtime change is only at 2 places to encode the str as np.array of int32. Okay with me.
7a85a19
to
639ccff
Compare
1e92032
to
b2183d1
Compare
de7128e
to
59c02d5
Compare
e397242
to
2c4c8d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had a quick look - good overall, just some minor remarks.
* pre-traces and string for floating * y params and tests * tests for fixed pt * minor cleanup * lint * adde lr to initial parameters of LearningDense * rm unused imports * avoid using learning lif * temp: just one stdp test * enable 2f learning rules * revert neuron.py * minor change * lint * clean up str representation of learning rule * cleanup * lint
Issue Number:
#582 #542
Objective of pull request:
This PR enables to use get/set on parameters of the learning rule.
For that to work, we create Vars in the LearningDense Process and ProcessModel and initialize them with the values given by the learning rule object.
Furthermore, we add a function 'on_var_update' to the
AbstractProcessModel
which is called when a Var is being updated. This allows us to do further checks and computation if the updated Var leads to changes in the functionality.In order to enable the get/set function for 'dw', 'dt' and 'dd', we had to implement a String LavaType. Strings can be communicated through ports by encoding/decoding them into ASCII.
Pull request checklist
Your PR fulfills the following requirements:
flakeheaven lint src/lava tests/
) and (bandit -r src/lava/.
) pass locallypytest
) passes locallyPull request type
Please check your PR type:
What is the current behavior?
What is the new behavior?
Does this introduce a breaking change?
Supplemental information