Skip to content
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

Added TensorMNIST to speed up computation, minor fix in agem and mas #1229

Merged
merged 6 commits into from Nov 30, 2022

Conversation

AndreaCossu
Copy link
Collaborator

@AndreaCossu AndreaCossu commented Nov 30, 2022

The main change of the PR is related to the default MNIST dataset, which is now called TorchMNIST. The dataset does not return a PIL image anymore but directly a Torch tensor.
This speeds up computation of strategies like A-GEM which access dataset items multiple times. The main bottleneck is due to the ToPIL transformation present in the default MNIST implementation (which requires a subsequent ToTensor transformation, thus increasing the total time).

@ContinualAI-bot
Copy link
Collaborator

Oh no! It seems there are some PEP8 errors! 😕
Don't worry, you can fix them! 💪
Here's a report about the errors and where you can find them:

avalanche/training/plugins/agem.py:8:81: E501 line too long (83 > 80 characters)
avalanche/training/plugins/agem.py:34:81: E501 line too long (83 > 80 characters)
avalanche/training/plugins/mas.py:9:81: E501 line too long (86 > 80 characters)
avalanche/training/plugins/mas.py:112:66: E261 at least two spaces before inline comment
avalanche/benchmarks/datasets/external_datasets/mnist.py:15:81: E501 line too long (92 > 80 characters)
avalanche/benchmarks/datasets/external_datasets/mnist.py:39:18: E128 continuation line under-indented for visual indent
avalanche/benchmarks/utils/data_loader.py:315:1: E303 too many blank lines (3)
1       E128 continuation line under-indented for visual indent
1       E261 at least two spaces before inline comment
1       E303 too many blank lines (3)
4       E501 line too long (83 > 80 characters)

@coveralls
Copy link

coveralls commented Nov 30, 2022

Pull Request Test Coverage Report for Build 3584722552

  • 30 of 34 (88.24%) changed or added relevant lines in 4 files are covered.
  • 4 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.02%) to 73.731%

Changes Missing Coverage Covered Lines Changed/Added Lines %
avalanche/training/plugins/mas.py 13 14 92.86%
avalanche/benchmarks/datasets/external_datasets/mnist.py 11 14 78.57%
Files with Coverage Reduction New Missed Lines %
avalanche/evaluation/metrics/images_samples.py 1 84.62%
avalanche/benchmarks/datasets/external_datasets/mnist.py 1 83.33%
avalanche/benchmarks/scenarios/classification_scenario.py 2 86.31%
Totals Coverage Status
Change from base Build 3575187291: -0.02%
Covered Lines: 13652
Relevant Lines: 18516

💛 - Coveralls

@AntonioCarta AntonioCarta merged commit c6e4227 into ContinualAI:master Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants