IntelLabs / MART

Modular Adversarial Robustness Toolkit
BSD 3-Clause "New" or "Revised" License
16 stars 0 forks source link

Make the Adversary Trainer accept loggers. #164

Closed mzweilin closed 1 year ago

mzweilin commented 1 year ago

What does this PR do?

Make Adversary's Trainer accept loggers, so that we can log gradients of perturbation, etc.

Example

CUDA_VISIBLE_DEVICES=0 \
python -m mart \
experiment=CIFAR10_CNN_Adv \
fit=false \
trainer=gpu \
+trainer.limit_test_batches=1 \
+callbacks@model.modules.input_adv_test.callbacks=gradient_monitor \
+model.modules.input_adv_test.callbacks.gradient_monitor.frequency=1 \
+logger@model.modules.input_adv_test.logger=[tensorboard]
image image

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.

Before submitting

Did you have fun?

Make sure you had fun coding 🙃