Add JointTraining base strategySee original GitHub issue
We should allow the cumulative strategy to skip the training of the passed batch but accumulating the data for futher use.
Something like this:
strat = Cumulative() strat.train(step, skip_training=True)
This would allow to compute the “offline” accuracy directly: i.e. the acc of the model trained on the entire training set:
strat = Cumulative() for i, step in enumerate(train_stream): if i == len(train_stream) -1: strat.train(step) else: strat.train(step, skip_training=True)
or we could go this way:
strat = Cumulative() strat.train(train_stream, train_only_last=True)
What do you think?
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Do we need to call train for this? If I call a train method I expect training, not just data collection.
I would create a separate class JointTraining with a method
train(stream) that trains jointly on the entire stream, instead of sequentially like the BaseStrategy is doing.
Probably JointTraining does not needs most of the stuff developed for BaseStrategy (e.g. Plugins) except for the EvaluationProtocol.
JointTraining has been added as a strategy independent but similar to
BaseStrategy in https://github.com/vlomonaco/avalanche/commit/c2cbef1be4f62da5781d52a3648880505e226773.
Users can subclasses this for more complex join training behaviours. It supports both training on streams with a single task label or multiple of them. You can find a usage example in
I’m closing this issue but you can create new issues if you find something should be changed/improved.