Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.

Better Optimizer - #147

Merged
dxoigmn merged 39 commits into
mainfrom
better_optimizer
Jun 1, 2023
Merged

Better Optimizer#147
dxoigmn merged 39 commits into
mainfrom
better_optimizer

Conversation

@dxoigmn

@dxoigmn dxoigmn commented May 5, 2023

Copy link
Copy Markdown
Member

What does this PR do?

This PR removes attack-specific optimizers and moves them to be generic PL optimizers.

Depends upon #146.

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.

  • pytest
  • python -m mart experiment=CIFAR10_CNN_Adv trainer=gpu achieves 71% accuracy.

Before submitting

  • The title is self-explanatory and the description concisely explains the PR
  • My PR does only one thing, instead of bundling different changes together
  • I list all the breaking changes introduced by this pull request
  • I have commented my code
  • 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
  • I have run pre-commit hooks with pre-commit run -a command without errors

Did you have fun?

Make sure you had fun coding 🙃

@dxoigmn
dxoigmn changed the base branch from main to better_perturber May 5, 2023 21:25
@dxoigmn
dxoigmn marked this pull request as ready for review May 16, 2023 18:17
@dxoigmn
dxoigmn requested a review from mzweilin May 16, 2023 18:17
@dxoigmn
dxoigmn removed the request for review from mzweilin May 16, 2023 19:45
@dxoigmn
dxoigmn changed the base branch from better_perturber to main May 16, 2023 20:01
@dxoigmn dxoigmn mentioned this pull request May 16, 2023
15 tasks
@dxoigmn
dxoigmn marked this pull request as draft May 16, 2023 20:03
@dxoigmn
dxoigmn marked this pull request as ready for review May 16, 2023 20:06
@dxoigmn
dxoigmn requested a review from mzweilin May 16, 2023 20:06
@dxoigmn dxoigmn mentioned this pull request May 16, 2023
20 tasks
@dxoigmn
dxoigmn marked this pull request as draft May 17, 2023 18:28
@dxoigmn
dxoigmn marked this pull request as ready for review May 17, 2023 18:28
@dxoigmn
dxoigmn changed the base branch from main to better_perturber May 22, 2023 21:46

@mzweilin mzweilin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like the change! Maybe we can further simplify the config.

Comment thread mart/attack/adversary.py
self.perturber = perturber
self.composer = composer
self.optimizer_fn = optimizer
if not isinstance(self.optimizer_fn, OptimizerFactory):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shall we add this to mart/models/modular.py so that we can simplify the config in mart/configs/optimizer? That will make it easier to add other off-the-shelf optimizers from PyTorch.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Perhaps. But I think that should live in another PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I created an issue.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I will make a PR.

…r` (and `Adversary`) (#152)

* Simplify optimizer configs by hiding OptimizerFactory in LitModular abd Adversary.

* Add simplified config in comment/

@mzweilin mzweilin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@dxoigmn
dxoigmn merged commit 3d5d5c7 into main Jun 1, 2023
@dxoigmn
dxoigmn deleted the better_optimizer branch June 1, 2023 21:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants