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
Random Resize Crop #10
Comments
Thanks for your interest in our work. We did not use random resized crops in CIFAR10 because of its inherent low resolution and we noticed that it makes the contrastive learning task more difficult than necessary. In general, it's good to design an augmentation policy that neither makes that task too easy nor too difficult. A good way to check that would be logging the contrastive accuracy i.e. the accuracy at which your unsupervised model is able to tell if a pair of images is a positive pair. I think I had mentioned in my response to your email as well :D Regarding the error, you are getting it is mainly stemming from the fact that the augmentation policy is implemented as a |
@sayakpaul Thank you for prompt response, as always. That makes a lot of sense, and I happened to see your recent tweet as well. |
I would recommend doing something like (I haven't tested it yet) -
|
Works like a charm! Thank you! |
Cool. Just verify a couple of batches before you pass them on to the training loop. |
Yep, that's exactly what I did. |
Any particular reason why Random Resize Crop isn't added to the augmentation pipeline when you trained SimCLR on CIFAR-10?
I tried adding it to see if it makes a difference, but I'm facing an error. Would appreciate it if you could tell me where I'm going wrong.
I added a function for random resize crop. The function works for a single image but I get an error when I pass a batch of images from a tf.data.Dataset :
InvalidArgumentError: Incompatible shapes: [4] vs. [3] [Op:GreaterEqual]
The text was updated successfully, but these errors were encountered: