-
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
Addition of SmoothMix Training in the Randomized Smoothing Module #1668
Conversation
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
…ated fit_pytorch Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
…f test results Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
This pull request introduces 9 alerts when merging fa16b0e into e4efd6d - view on LGTM.com new alerts:
|
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
This pull request introduces 1 alert when merging bcb3988 into e4efd6d - view on LGTM.com new alerts:
|
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
…ess-toolbox into smoothmix
…ess-toolbox into smoothmix
Thanks for the heads up @beat-buesser, I've never used |
…ess-toolbox into smoothmix Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
…ss-toolbox into smoothmix
This pull request fixes 1 alert when merging c1c72ec into 8df19af - view on LGTM.com fixed alerts:
|
Also @beat-buesser, do I need to address anything from the lgtm-com bot's recent comment on fixing one alert? |
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
…lso tensorflowfasterrcnn fix) Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Hi @asarj Can you check the commits again, it looks like there are some unrelated commits left from May 8. Can we implement Can we move the training procedure in to the fit method of the randomised smoothing estimator? Should we create a separate estimator for SmoothMix? I think SmoothMix is adding a large umber of arguments to the randomised smoothing estimator which might make it more challenging to recognise which arguments are required for randomised smoothing. |
@beat-buesser I can create a separate estimator for smoothmix and model this based on the randomized smoothing estimator and look into implementing SmoothMixPGD inheriting from |
Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Closing this because the changes have undergone a refactor based on recent feedback and are in a new PR found here: #1705 (comment). |
* added files from PR Trusted-AI#1668 Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * moved smoothmix training to fit method of smoothmix estimator and created a separate estimator for smoothmix Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * added unit test for SmoothMix estimator Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * added demo notebook for smoothmix estimator Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * formatting test for smoothmix Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * fixed typo in smoothmix test Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * reverted randomized smoothing tests file to original state Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * removed unecessary gaussian augmentation import Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * fixed ART repo checks errors Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * fixed argument error in demo notebook Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * flake8 test fix Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * cleanup smoothmix Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * cleanup notebook and unit tests Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * update smoothmix to be compatible with ART 1.14 Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * consolidate pytorch smoothmix implementation Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * cleanup and lint Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * update notebook readme with smoothmix demo Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * fixed smoothmix unit test Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * upgrade smoothmix unit tests to pytest Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * refactor smoothmix into randomized smoothing module Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> --------- Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> Co-authored-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
* added files from PR Trusted-AI#1668 Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * moved smoothmix training to fit method of smoothmix estimator and created a separate estimator for smoothmix Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * added unit test for SmoothMix estimator Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * added demo notebook for smoothmix estimator Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * formatting test for smoothmix Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * fixed typo in smoothmix test Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * reverted randomized smoothing tests file to original state Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * removed unecessary gaussian augmentation import Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * fixed ART repo checks errors Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * fixed argument error in demo notebook Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * flake8 test fix Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> * cleanup smoothmix Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * cleanup notebook and unit tests Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * update smoothmix to be compatible with ART 1.14 Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * consolidate pytorch smoothmix implementation Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * cleanup and lint Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * update notebook readme with smoothmix demo Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * fixed smoothmix unit test Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * upgrade smoothmix unit tests to pytest Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> * refactor smoothmix into randomized smoothing module Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> --------- Signed-off-by: Ajay Sarjoo <ajay.sarjoo@outlook.com> Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com> Co-authored-by: Ajay Sarjoo <ajay.sarjoo@outlook.com>
Description
train_method
argument in thefit
method via kwargs with support for SmoothMix training.RandomizedSmoothingMixin
andPyTorchRandomizedSmoothing
modules with the parameters needed to train the classifier properly.fit_pytorch
method that performs the SmoothMix training via PyTorchPaper Link: https://arxiv.org/pdf/2111.09277.pdf
Code Repository based on paper: https://github.com/jh-jeong/smoothmix
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