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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect shape issue when loading raw CIFAR-10 data #1962

Merged
merged 2 commits into from
Dec 16, 2022

Conversation

f4str
Copy link
Collaborator

@f4str f4str commented Dec 9, 2022

Description

Remove the lines in art.utils.load_cifar10 which reshape the CIFAR-10 data to a non-standard size.

Fixes #1961

Type of change

Please check all relevant options.

  • Improvement (non-breaking)
  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing

Testing is trivial, just load the data and check for the shape.

from art.utils import load_cifar10, load_mnist

(x_train, y_train), (x_test, y_test), min_, max_ = load_cifar10(raw=True)
print(y_train.shape)  # (50000,) instead of (50000, 1)
print(y_test.shape)  # (10000,) instead of (10000, 1)

Test Configuration:

  • OS
  • Python version
  • ART version or commit number
  • TensorFlow / Keras / PyTorch / MXNet version

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
@codecov-commenter
Copy link

codecov-commenter commented Dec 9, 2022

Codecov Report

Merging #1962 (00a815b) into dev_1.13.0 (75e37d4) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##           dev_1.13.0    #1962      +/-   ##
==============================================
- Coverage       85.41%   85.39%   -0.02%     
==============================================
  Files             290      290              
  Lines           25439    25437       -2     
  Branches         4573     4573              
==============================================
- Hits            21728    21722       -6     
- Misses           2542     2544       +2     
- Partials         1169     1171       +2     
Impacted Files Coverage Δ
art/utils.py 73.30% <ø> (-0.09%) ⬇️
art/estimators/certification/abstain.py 90.90% <0.00%> (-9.10%) ⬇️
art/estimators/poison_mitigation/strip/strip.py 94.44% <0.00%> (-5.56%) ⬇️
art/attacks/evasion/brendel_bethge.py 86.68% <0.00%> (-0.33%) ⬇️

@beat-buesser beat-buesser self-requested a review December 12, 2022 17:48
@beat-buesser beat-buesser self-assigned this Dec 12, 2022
@beat-buesser beat-buesser added the improvement Improve implementation label Dec 12, 2022
@beat-buesser beat-buesser added this to Pull request open in ART 1.13.0 via automation Dec 12, 2022
@beat-buesser beat-buesser added this to the ART 1.13.0 milestone Dec 12, 2022
@beat-buesser beat-buesser linked an issue Dec 12, 2022 that may be closed by this pull request
Copy link
Collaborator

@beat-buesser beat-buesser left a comment

Choose a reason for hiding this comment

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

Hi @f4str Thank you very much!

@beat-buesser beat-buesser merged commit ed4a5e2 into Trusted-AI:dev_1.13.0 Dec 16, 2022
ART 1.13.0 automation moved this from Pull request open to Pull request done Dec 16, 2022
@f4str f4str deleted the cifar10-fix branch December 16, 2022 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improve implementation
Projects
No open projects
ART 1.13.0
  
Pull request done
Development

Successfully merging this pull request may close these issues.

Incorrect shape when loading raw CIFAR-10 data
3 participants