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

Add support for CIFAR10 Dataset in the DCGAN Module #1046

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ishandutta0098
Copy link

@ishandutta0098 ishandutta0098 commented Jul 2, 2023

What does this PR do?

This PR adds the CIFAR10 dataset as an option in the DCGAN module and updates the arguments accordingly.

Fixes # (issue)
#971

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


馃摎 Documentation preview 馃摎: https://lightning-bolts--1046.org.readthedocs.build/en/1046/

[
transform_lib.Resize(script_args.image_size),
transform_lib.ToTensor(),
transform_lib.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
Copy link
Member

Choose a reason for hiding this comment

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

is this right with respect to the dataset color distribution?

Copy link
Contributor

Choose a reason for hiding this comment

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

the official PyTorch example seem to use the same normalization - https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html

Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

do we have a test for it?

@ishandutta0098
Copy link
Author

ishandutta0098 commented Aug 8, 2023

@Borda @aniketmaurya I read more on it and calculated it as well, the values given in the pytorch docs are an approximation. The exact values are these:
mean: 0.49139968, 0.48215827 ,0.44653124
std: 0.24703233 0.24348505 0.26158768
I checked a number of implementations, found people either approximating the above values to 3 decimal places or using 0.5 values directly.

I will update the code accordingly with the exact values

Reference - https://stackoverflow.com/questions/66678052/how-to-calculate-the-mean-and-the-std-of-cifar10-data

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

3 participants