-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 Interval Bound Propagation Training #2044
Implement Interval Bound Propagation Training #2044
Conversation
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
45f8262
to
d900c5f
Compare
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## dev_1.14.0 #2044 +/- ##
==============================================
+ Coverage 76.94% 85.58% +8.63%
==============================================
Files 291 292 +1
Lines 25612 25798 +186
Branches 4631 4665 +34
==============================================
+ Hits 19708 22079 +2371
+ Misses 4871 2529 -2342
- Partials 1033 1190 +157
|
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
ABLATOR_TYPE = Union[BlockAblator, ColumnAblator] # pylint: disable=C0103 | ||
|
||
CERTIFIER_TYPE = Union[PytorchDeepZ] # pylint: disable=C0103 | ||
IBP_CERTIFIER_TYPE = Union[PyTorchIBPClassifier] # pylint: disable=C0103 |
Check notice
Code scanning / CodeQL
Unused global variable
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.
Hi @GiulioZizzo Thank you very much for your pull request in Interval Bound Propagation training! I have left a few comments, what do you think?
art/defences/trainer/__init__.py
Outdated
@@ -4,6 +4,7 @@ | |||
from art.defences.trainer.trainer import Trainer | |||
from art.defences.trainer.adversarial_trainer import AdversarialTrainer | |||
from art.defences.trainer.certified_adversarial_trainer_pytorch import AdversarialTrainerCertifiedPytorch | |||
from art.defences.trainer.ibp_certified_trainer_pytorch import AdversarialTrainerCertifiedIBPPytorch |
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.
from art.defences.trainer.ibp_certified_trainer_pytorch import AdversarialTrainerCertifiedIBPPytorch | |
from art.defences.trainer.ibp_certified_trainer_pytorch import AdversarialTrainerCertifiedIBPPyTorch |
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.
Agree, name changed!
This classifier has 3 modes which can be set via: classifier.model.set_forward_mode('mode') | ||
|
||
'mode' can be one of: | ||
+ 'abstract': When we wish to certifiy datapoints and have abstract predictions | ||
+ 'concrete': When normal predictions need to be made | ||
+ 'attack': When we are interfacing with an ART attack (for example PGD). |
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.
Does this docstring build correctly?
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.
checked, all ok!
@@ -0,0 +1,462 @@ | |||
# MIT License |
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.
Please update docs
and check if new docstrings build correctly.
…with much less protected member access Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Co-authored-by: Beat Buesser <49047826+beat-buesser@users.noreply.github.com> Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Co-authored-by: Beat Buesser <49047826+beat-buesser@users.noreply.github.com> Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Co-authored-by: Beat Buesser <49047826+beat-buesser@users.noreply.github.com> Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
887660e
to
879d8fd
Compare
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Signed-off-by: GiulioZizzo <giulio.zizzo@yahoo.co.uk>
Description
In this PR we include adversarial training with interval bound propagation. With careful training this can achieve excellent certified robustness.
Fixes #2037
Type of change
Please check all relevant options.
Testing
Tests can be found in test_interval.py. We check that the certification gives the correct results, runs without errors, propagates gradients correctly and when running without bounds gives the same results as regular neural networks.
Test Configuration:
Checklist