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

Printable representation of Attack objects [JATIC-I2-IBM] #2274

Merged

Conversation

kieranfraser
Copy link
Collaborator

@kieranfraser kieranfraser commented Sep 7, 2023

Description

Facilitating printable representation of attacks. Aids users distinguish between attacks of the same type but different parameters without having to manually inspect or print individual parameters, they can simply print the attack object. This PR also adds a missing attack_param, decay, to ProjectedGradientDescentCommon to ensure it appears in when Numpy, TensorFlow and PyTorch PGD attacks are printed.

Fixes #2272

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

Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.

  • tests/attacks/test_attack.py - added a base class test for __repr__

Test Configuration:

  • OS: macOS
  • Python version: 3.10
  • ART version or commit number: dev_1.16.0
  • 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

…est. Updating PGD common to include a missing attack_param.

Signed-off-by: Kieran Fraser <Kieran.Fraser@ibm.com>
Signed-off-by: Kieran Fraser <Kieran.Fraser@ibm.com>
@kieranfraser kieranfraser marked this pull request as ready for review September 7, 2023 08:34
@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2023

Codecov Report

Merging #2274 (08bf83f) into dev_1.16.0 (161c406) will decrease coverage by 14.65%.
The diff coverage is 20.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Impacted file tree graph

@@               Coverage Diff               @@
##           dev_1.16.0    #2274       +/-   ##
===============================================
- Coverage       83.87%   69.23%   -14.65%     
===============================================
  Files             318      318               
  Lines           28329    28338        +9     
  Branches         5157     5161        +4     
===============================================
- Hits            23761    19619     -4142     
- Misses           3243     7588     +4345     
+ Partials         1325     1131      -194     
Files Changed Coverage Δ
art/attacks/attack.py 87.24% <11.11%> (-5.61%) ⬇️
...adient_descent/projected_gradient_descent_numpy.py 88.04% <100.00%> (ø)

... and 83 files with indirect coverage changes

📢 Have feedback on the report? Share it here.

@beat-buesser beat-buesser self-requested a review September 7, 2023 14:25
@beat-buesser beat-buesser self-assigned this Sep 7, 2023
@beat-buesser beat-buesser added the enhancement New feature or request label Sep 7, 2023
@beat-buesser beat-buesser added this to the ART 1.16.0 milestone Sep 7, 2023
@beat-buesser beat-buesser linked an issue Sep 7, 2023 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 @kieranfraser Thank you very much for your pull request adding rear-strings to the attacks!

kieranfraser and others added 2 commits September 8, 2023 09:43
Signed-off-by: Kieran Fraser <Kieran.Fraser@ibm.com>
@beat-buesser beat-buesser merged commit 596aa14 into Trusted-AI:dev_1.16.0 Sep 12, 2023
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Printable representation of Attack objects [JATIC-I2-IBM]
3 participants