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

[Feature] Repeated Aug and Sampler Registry #588

Merged
merged 11 commits into from
Dec 21, 2021

Conversation

0x4f5da2
Copy link
Contributor

@0x4f5da2 0x4f5da2 commented Dec 6, 2021

Motivation

RepAug is a necessary part to re-implement 'ResNet Strikes Back'

Modification

  • implement repeated aug

Use cases

Just add sampler = dict(type="RepeatAugSampler") to the config file

@mzr1996
Copy link
Member

mzr1996 commented Dec 7, 2021

Can we use a dataset wrapper to implement this function?

@0x4f5da2
Copy link
Contributor Author

0x4f5da2 commented Dec 7, 2021

Can we use a dataset wrapper to implement this function?

@mzr1996 Probably not. Repeated Augmentation requires the repeated samples co-exist in the same batch while the Dataset class is epoch agnostic. In this way, we have to use un-shuffled data for training or implement the shuffle logic in the wrapper and use the same shuffled sequence for all epochs.

@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #588 (36dc51b) into master (894a82e) will increase coverage by 1.22%.
The diff coverage is 80.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #588      +/-   ##
==========================================
+ Coverage   80.11%   81.33%   +1.22%     
==========================================
  Files         113      116       +3     
  Lines        6526     6720     +194     
  Branches     1120     1156      +36     
==========================================
+ Hits         5228     5466     +238     
+ Misses       1153     1103      -50     
- Partials      145      151       +6     
Flag Coverage Δ
unittests 81.33% <80.82%> (+1.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmcls/datasets/builder.py 46.15% <55.55%> (+3.60%) ⬆️
mmcls/apis/train.py 27.77% <72.72%> (+6.25%) ⬆️
mmcls/datasets/samplers/repeat_aug.py 85.10% <85.10%> (ø)
mmcls/datasets/__init__.py 100.00% <100.00%> (ø)
mmcls/datasets/samplers/__init__.py 100.00% <100.00%> (ø)
mmcls/datasets/samplers/distributed_sampler.py 28.00% <100.00%> (+6.26%) ⬆️
mmcls/models/classifiers/image.py 84.88% <0.00%> (-1.96%) ⬇️
mmcls/models/heads/__init__.py 100.00% <0.00%> (ø)
mmcls/models/backbones/__init__.py 100.00% <0.00%> (ø)
mmcls/models/backbones/deit.py 97.50% <0.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f25beb...36dc51b. Read the comment docs.

@0x4f5da2 0x4f5da2 marked this pull request as ready for review December 8, 2021 04:55
@0x4f5da2 0x4f5da2 requested a review from mzr1996 December 8, 2021 04:55
mmcls/apis/train.py Show resolved Hide resolved
mmcls/datasets/samplers/__init__.py Outdated Show resolved Hide resolved
mmcls/datasets/samplers/builder.py Outdated Show resolved Hide resolved
mmcls/datasets/samplers/repeat_aug.py Outdated Show resolved Hide resolved
0x4f5da2 and others added 2 commits December 21, 2021 13:13
Co-authored-by: Ma Zerun <mzr1996@163.com>
Copy link
Member

@mzr1996 mzr1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mzr1996 mzr1996 merged commit d5ae255 into open-mmlab:master Dec 21, 2021
mzr1996 pushed a commit to mzr1996/mmpretrain that referenced this pull request Nov 24, 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

2 participants