-
Notifications
You must be signed in to change notification settings - Fork 330
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
Update random_cutout.py to be a subclass of VectorizedBaseImageAugmentationLayer #2123
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Thanks for the PR!. Can you rebase with Master |
Make RandomCutout a subclass of VectorizedBaseImageAugmentationLayer
50845dc
to
eaeb183
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sup3rgiu can you please add a demo output of this layer and a colab to check the results?
Sure! Colab: https://colab.research.google.com/drive/1luk08YFpR4VFDW_qD1RHgNFaJDV46Dlf The "brightness" difference of the random noise is simply because in the vectorized version I added few instructions to rescale the noise to the input image range. I think this might be useful to apply the noise correctly, regardless of the image range, but if it isn't you can simply remove these lines within the
|
Great work! Rescaling the noise to the input image range is cool! |
I fixed the implementation to support RaggedTensors. The test should be ok now. New colab if needed: https://colab.research.google.com/drive/1luk08YFpR4VFDW_qD1RHgNFaJDV46Dlf |
/gcbrun |
Thank you! triggering the tests again! |
* Adds Kokoro GPU Tests (#2224) * Adds Kokoro tests * Add Kokoro Tests * Update random_cutout.py to be a subclass of VectorizedBaseImageAugmentationLayer (#2123) * Update random_cutout.py Make RandomCutout a subclass of VectorizedBaseImageAugmentationLayer * Fix RandomCutout for ragged inputs * Fix typo and style * Vectorized implementation of RandomColorDegeneration and Equalization preprocessing layers (#2214) * Vectorize RandomColorDegeneration * Vectorize Equalization * Vectorize Equalization * Fix Equalization for ragged input --------- Co-authored-by: Ramesh Sampath <1437573+sampathweb@users.noreply.github.com> Co-authored-by: SUPERGIU <supergiu@outlook.com>
…tationLayer (keras-team#2123) * Update random_cutout.py Make RandomCutout a subclass of VectorizedBaseImageAugmentationLayer * Fix RandomCutout for ragged inputs * Fix typo and style
What does this PR do?
As of v0.6.4, RandomCutout is not implemented in a vectorized manner. This can be easily fixed by making it a subclass of
VectorizedBaseImageAugmentationLayer
and fixing the shape of some computations.A full working vectorized implementation+benchmark is available at:
https://colab.research.google.com/drive/1luk08YFpR4VFDW_qD1RHgNFaJDV46Dlf?usp=sharing
Execution time over 10 CIFAR-10 batches of size 128:
Before submitting
Pull Request section?
to it if that's the case.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.