-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement CutMix in Numpy, PyTorch, and TensorFlow #1910
Implement CutMix in Numpy, PyTorch, and TensorFlow #1910
Conversation
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Codecov Report
@@ Coverage Diff @@
## dev_1.13.0 #1910 +/- ##
==============================================
+ Coverage 84.25% 85.57% +1.31%
==============================================
Files 254 257 +3
Lines 23661 23890 +229
Branches 4289 4340 +51
==============================================
+ Hits 19935 20443 +508
+ Misses 2624 2336 -288
- Partials 1102 1111 +9
|
This pull request introduces 7 alerts when merging 707bfa8 into c366b1d - view on LGTM.com new alerts:
|
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
This pull request introduces 5 alerts when merging be08f13 into dcd1fe7 - view on LGTM.com new alerts:
Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog. |
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
else: | ||
# NHWC <-- NFHWC | ||
x_aug = np.squeeze(x_nfhwc, axis=1) | ||
elif x_ndim == 5: # lgtm [py/redundant-comparison] |
Check warning
Code scanning / CodeQL
Redundant comparison
# NHWC <-- NCHW <-- NCFHW | ||
x_nchw = torch.squeeze(x_ncfhw, dim=2) | ||
x_aug = torch.permute(x_nchw, (0, 2, 3, 1)) | ||
elif x_ndim == 5: |
Check warning
Code scanning / CodeQL
Redundant comparison
else: | ||
# NHWC <-- NFHWC | ||
x_aug = tf.squeeze(x_nfhwc, axis=1) | ||
elif x_ndim == 5: |
Check warning
Code scanning / CodeQL
Redundant comparison
Description
Implementation of the CutMix data augmentation defense in the Numpy, PyTorch, and TensorFlow frameworks.
Fixes # (issue)
Type of change
Please check all relevant options.
Testing
Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.
Test Configuration:
Checklist