adversarial-robustness-toolbox icon indicating copy to clipboard operation
adversarial-robustness-toolbox copied to clipboard

Create sample_from_sphere_or_ball

Open nmegiddo opened this issue 2 years ago • 4 comments

The function here samples uniformly from either the ball or the sphere with a given norm with possibly different radii

Description

Please include a summary of the change, motivation and which issue is fixed. Any dependencies changes should also be included.

Fixes # (issue)

Type of change

Please check all relevant options.

  • [x] Improvement (non-breaking)
  • [x] Bug fix (non-breaking)
  • [x] 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.

  • [ ] Test A
  • [ ] Test B

Test Configuration:

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

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] 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

nmegiddo avatar Aug 01 '22 16:08 nmegiddo

Codecov Report

Merging #1804 (b7f0686) into dev_1.12.0 (9fa6749) will decrease coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff               @@
##           dev_1.12.0    #1804      +/-   ##
==============================================
- Coverage       85.57%   85.57%   -0.01%     
==============================================
  Files             271      271              
  Lines           23048    23046       -2     
  Branches         4103     4102       -1     
==============================================
- Hits            19723    19721       -2     
  Misses           2316     2316              
  Partials         1009     1009              
Impacted Files Coverage Δ
art/attacks/evasion/sign_opt.py 86.49% <ø> (ø)
art/estimators/certification/deep_z/pytorch.py 87.50% <ø> (ø)
...certification/derandomized_smoothing/tensorflow.py 85.00% <100.00%> (ø)
art/attacks/evasion/dpatch.py 91.25% <0.00%> (-0.11%) :arrow_down:

codecov-commenter avatar Aug 01 '22 16:08 codecov-commenter

This pull request introduces 1 alert when merging a5f0ff2f980ca2e7bc26319f66e8e1ffcef9e5c9 into 9bc3b269e3cb7cb906603704f895fcddf8b1ac72 - view on LGTM.com

new alerts:

  • 1 for Module is imported more than once

lgtm-com[bot] avatar Aug 02 '22 15:08 lgtm-com[bot]

This pull request introduces 1 alert when merging dbe994fa46e07392d7eba335700ac1c36c729c6e into 9bc3b269e3cb7cb906603704f895fcddf8b1ac72 - view on LGTM.com

new alerts:

  • 1 for Module is imported more than once

lgtm-com[bot] avatar Aug 02 '22 23:08 lgtm-com[bot]

This pull request introduces 1 alert when merging b7f0686219a47f1cfb3f709a1e8834d6c106f115 into 9bc3b269e3cb7cb906603704f895fcddf8b1ac72 - view on LGTM.com

new alerts:

  • 1 for Module is imported more than once

lgtm-com[bot] avatar Aug 03 '22 17:08 lgtm-com[bot]

Hi @nmegiddo Thank you very much for implementing the correct sampling from norm spheres or balls! I pull this PR to a dev branch to move the function to art.utils.

beat-buesser avatar Sep 09 '22 09:09 beat-buesser