-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
RetrievalPolicy and StoragePolicy for Rehearsal methods #479
Comments
I agree with separation of retrieval and storage. It seems to me that the storage policy is the most complex one, and it will probably need to use the full plugin API because it needs access to the strategy's internal state, especially for complex policies (loss, mini-batch, ...). Retrieval policies may be implemented as custom pytorch I'm not sure if In the end, I would expect to use replay like this:
or alternatively:
@Mattdl you probably have much more experience than me with replay strategies. Let me know if I'm missing anything. |
I favor the alternative you proposed to use the basic Replay plugin and then pass a storage_policy and retrieval_policy.
This way, other Replay-based plugins can just do something similar:
I will implement the initial easy ones and try to use them for my CoPE implementation. |
If you need any comments on a preliminary implementation you can open a PR and tag it with [WIP] until it's ready to merge. |
I'm closing this for now. We can open separate issues for the missing policies in the future. |
I was thinking to implement CoPE in the framework. But there remain two main TODOs for any online data incremental, or replay methods in general.
First, it still seems like the data incremental learning issue remains unsolved (#360), so it'll be hard to reproduce results to check if the implementation is working. That is, we should be able to define a data stream still in task-like streams, whereas processing can happen per batch. This is often used to enable comparison to non-data incremental methods (which need a task-like datastream).
Second, Also there are a lot of replay based methods possible, and I think we should consider using generic objects (e.g. StoragePolicy, RetrievalPolicy) so that we can easily port these for other (replay)methods.
At this point we have a ReplayPlugin, but if we could make this more specific by passing a Retrieval and StoragePolicy to the ReplayPlugin. I see the 'ReplayPlugin' as the plugin actually using the memory (e.g. for optimization), so methods like CoPE could actually be implemented similarly.
The Retrieval and StoragePolicy are defining how to sample from the data stream, and how to sample from the buffer respectively. Replay (ER) or CoPE are actually independent of which retrieval/storage strategy is used.
Furthermore, this modular approach also allows us to easily combine methods, such as GSS (which is a StoragePolicy based on the gradients) or MIR (which is a retrieval strategy based on the loss), which we could then just plug in for ER, CoPE or any other replay based method (iCaRL,...).
We should probably break this down into multiple sub-issues:
The text was updated successfully, but these errors were encountered: