-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Updatable objects #1633
Updatable objects #1633
Conversation
…o updatable_objects Conflicts: avalanche/models/dynamic_optimizers.py
Pull Request Test Coverage Report for Build 8892479082Details
💛 - Coveralls |
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 so far. I was a bit concerned wether some objects would need to implement something else than "before_training_exp" and "after_training_exp" but I don't think so. For instance for optimizers the "before_backward" call would be replaced by overriding the step() method. In general I think before_training_exp and after_training_exp are sufficient to account for every cases.
As a side comment. Do you think it can happen that one updatable object depends on another ? I am thinking in particular about the optimizer. If we want to use the existing functions for updating optimizer we would need to encapsulate the optimizer into an Updatable object, but then it would need to be updated after the model. In that case we could add some dependency system to each object to make sure they are updated in the correct order. |
@AlbinSou I added the custom weights mode for the MetricCollector and a wrapper for the optimizers. I think the PR is ready to be merged if you agree. |
attempt at #1611.
Right now there is:
Agent
object, which keeps track of CL state and provides some basic utilities to update them or add functional hooksMetricCollector
: a new object to manage metrics. This is needed because the current metric system is tightly coupled to the templates.MetricCollector
is a simplified metric system but it should provide the basic functionality with a simpler API.updatable_objects.py
example.I'm opening the PR for comments right now, just to understand if this may be useful or not. I'm finding it conveniente for some simple experiments that I'm running.
Regarding compatibility, I didn't find any major roadblocks. Everything seems easy to integrate, though some things may need to be adapted. For example, some methods like GEM may be rewritten as optimizer to make their use transparent with this API.