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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary MNIST/EMNIST Datasets and Datamodules #866

Merged
merged 15 commits into from Aug 23, 2022

Conversation

matsumotosan
Copy link
Contributor

@matsumotosan matsumotosan commented Aug 15, 2022

What does this PR do?

Fixes part of #839

  • pl_bolts.datamodules.binary_emnist_datamodule.BinaryEMNISTDataModule
  • pl_bolts.datamodules.binary_mnist_datamodule.BinaryMNISTDataModule
  • pl_bolts.datasets.emnist_dataset.BinaryEMNIST (add unit test)
  • pl_bolts.datasets.mnist_dataset.BinaryMNIST (add unit test)

Summary

  • Add tests for binarized MNIST and EMNIST datasets
  • Add threshold attribute (set to 127) to Dataset classes to be used for binarizing MNIST and EMNIST images
  • Add tests for val and test dataloaders

By default, the images are returned as PIL images (mode='L') in line with the torchvision MNIST class. The threshold value is manually set as of right now.

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 馃檭

@github-actions github-actions bot added the datamodule Anything related to datamodules label Aug 15, 2022
@matsumotosan matsumotosan changed the title Binary dm Binary MNIST/EMNIST Datasets and Datamodules Aug 15, 2022
@otaj otaj mentioned this pull request Aug 16, 2022
@matsumotosan matsumotosan marked this pull request as ready for review August 17, 2022 18:15
Copy link
Contributor

@otaj otaj left a comment

Choose a reason for hiding this comment

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

Over all, it looks very good, I have just two nits left in the comments

pl_bolts/datasets/emnist_dataset.py Outdated Show resolved Hide resolved
pl_bolts/datasets/mnist_dataset.py Outdated Show resolved Hide resolved
@mergify mergify bot added the ready label Aug 18, 2022
@otaj otaj enabled auto-merge (squash) August 23, 2022 14:09
@otaj otaj merged commit 7d2a9a1 into Lightning-Universe:master Aug 23, 2022
@matsumotosan matsumotosan deleted the binary_dm branch August 23, 2022 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datamodule Anything related to datamodules ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants