Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Adding optional sampler input to DataModule #390

Merged

Conversation

lillekemiker
Copy link
Contributor

@lillekemiker lillekemiker commented Jun 10, 2021

What does this PR do?

This PR adds the option of specifying a sampler to be used in the training DataLoader returned by a DataModule.

Fixes # 350

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@lillekemiker
Copy link
Contributor Author

Could someone supply me with info on how I should add this to the CHANGELOG.md? Considering that it technically changes the user facing API, I guess the semantic version should be bumped on the "minor" level, but that just seems big for this pretty small change.

@codecov
Copy link

codecov bot commented Jun 10, 2021

Codecov Report

Merging #390 (a4dbbc2) into master (b49bf04) will decrease coverage by 6.38%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #390      +/-   ##
==========================================
- Coverage   89.79%   83.40%   -6.39%     
==========================================
  Files          80       80              
  Lines        4203     4207       +4     
==========================================
- Hits         3774     3509     -265     
- Misses        429      698     +269     
Flag Coverage Δ
unittests 83.40% <100.00%> (-6.39%) ⬇️

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

Impacted Files Coverage Δ
flash/core/data/data_module.py 93.05% <100.00%> (-0.35%) ⬇️
flash/text/seq2seq/summarization/metric.py 26.98% <0.00%> (-68.26%) ⬇️
flash/text/classification/data.py 36.49% <0.00%> (-51.10%) ⬇️
flash/text/seq2seq/core/data.py 37.33% <0.00%> (-50.01%) ⬇️
flash/text/classification/model.py 40.00% <0.00%> (-50.00%) ⬇️
flash/core/schedulers.py 55.55% <0.00%> (-44.45%) ⬇️
flash/text/seq2seq/core/model.py 41.42% <0.00%> (-31.43%) ⬇️
flash/text/seq2seq/summarization/model.py 57.89% <0.00%> (-21.06%) ⬇️
flash/text/seq2seq/translation/model.py 55.00% <0.00%> (-20.00%) ⬇️
flash/text/seq2seq/summarization/utils.py 50.00% <0.00%> (-20.00%) ⬇️
... and 5 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 b49bf04...a4dbbc2. Read the comment docs.

Copy link
Collaborator

@ethanwharris ethanwharris left a comment

Choose a reason for hiding this comment

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

@lillekemiker Awesome! LGTM. Regarding the CHANGELOG, could you just add a line under Added in the Unreleased section at the top, no need for a version bump 😃

Copy link
Contributor

@edgarriba edgarriba left a comment

Choose a reason for hiding this comment

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

LGTM. Just small suggestion

flash/core/data/data_module.py Outdated Show resolved Hide resolved
@ethanwharris ethanwharris enabled auto-merge (squash) June 10, 2021 17:24
@ethanwharris ethanwharris merged commit c720807 into Lightning-Universe:master Jun 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants