Skip to content

Commit

Permalink
config updates
Browse files Browse the repository at this point in the history
  • Loading branch information
simplymathematics committed Jul 30, 2024
1 parent ab8a119 commit 4060aa1
Show file tree
Hide file tree
Showing 7 changed files with 900 additions and 428 deletions.
91 changes: 45 additions & 46 deletions examples/pytorch/attacks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,63 @@
# # This script is used to generate the attacks for the example.

# Fast Gradient Method
bash models.sh \
stage=attack \
attack=default \
++attack.init.name=art.attacks.evasion.FastGradientMethod \
++attack.init.eps=.001,.01,.1,.5,1 \
++attack.init.norm=2 \
atk_name=FGM $@
# #####################################################
# Projected Gradient Descent
bash models.sh \
stage=attack \
attack=default \
++attack.init.name=art.attacks.evasion.ProjectedGradientDescent \
++attack.init.eps=.001,.01,.1,.5,1 \
++attack.init.norm=2 \
++attack.init.eps_step=.001,.003,.01 \
atk_name=PGD \
++attack.init.max_iter=1,5,10,50,100 $@
# #####################################################
# DeepFool
bash models.sh \
stage=attack \
attack=default \
++attack.init.name=art.attacks.evasion.DeepFool \
++attack.init.max_iter=10 \
++attack.init.batch_size=4096 \
++attack.init.nb_grads=1,3,5,8,10 \
atk_name=Deep $@
# bash models.sh \
# stage=attack \
# attack=default \
# ++attack.init.name=art.attacks.evasion.FastGradientMethod \
# ++attack.init.eps=.001,.01,.1,.5,1 \
# ++attack.init.norm=2 \
# atk_name=FGM $@
# # #####################################################
# # HopSkipJump
# # Projected Gradient Descent
# bash models.sh \
# stage=attack \
# attack=default \
# ++attack.init.name=art.attacks.evasion.HopSkipJump \
# ++attack.init.max_iter=1,3,5,10,15 \
# ++attack.init.init_eval=10 \
# ++attack.init.batch_size=4096 \
# ++attack.init.max_eval=100 \
# ++attack.init.name=art.attacks.evasion.ProjectedGradientDescent \
# ++attack.init.eps=.001,.01,.1,.5,1 \
# ++attack.init.norm=2 \
# atk_name=HSJ $@
# ++attack.init.eps_step=.001,.003,.01 \
# atk_name=PGD \
# ++attack.init.max_iter=1,5,10,50,100 $@
# # #####################################################
# # PixelAttack
# # DeepFool
# bash models.sh \
# stage=attack \
# attack=default \
# ++attack.init.name=art.attacks.evasion.PixelAttack \
# ~attack.init.batch_size \
# ++attack.init.th=1,4,16,64,256 \
# atk_name=Pixel $@
# attack=default \
# ++attack.init.name=art.attacks.evasion.DeepFool \
# ++attack.init.max_iter=10 \
# ++attack.init.batch_size=4096 \
# ++attack.init.nb_grads=1,3,5,8,10 \
# atk_name=Deep $@
# # #####################################################
# # ThresholdAttack
# # HopSkipJump
# bash models.sh \
# stage=attack \
# attack=default \
# ++attack.init.name=art.attacks.evasion.ThresholdAttack \
# ~attack.init.batch_size \
# ++attack.init.th=1,4,16,64,256 \
# atk_name=Thresh $@
# ++attack.init.name=art.attacks.evasion.HopSkipJump \
# ++attack.init.max_iter=1,3,5,10,15 \
# ++attack.init.init_eval=3 \
# ++attack.init.max_eval=10 \
# ++attack.init.norm=2 \
# atk_name=HSJ $@
# #####################################################
# PixelAttack
bash models.sh \
stage=attack \
attack=default \
++attack.init.name=art.attacks.evasion.PixelAttack \
~attack.init.batch_size \
++attack.init.th=1,4,16,64,256 \
atk_name=Pixel $@
# #####################################################
# ThresholdAttack
bash models.sh \
stage=attack \
attack=default \
++attack.init.name=art.attacks.evasion.ThresholdAttack \
~attack.init.batch_size \
++attack.init.th=1,4,16,64,256 \
atk_name=Thresh $@
# #####################################################
# # ZooAttack
# bash models.sh \
Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/conf/cifar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ hydra:
++model.art.initialize.optimizer.lr: shuffle(choice( 0.1, 0.01, 0.001, .0001, .00001, 0.000001))
++model.art.initialize.optimizer.momentum: choice(0.1, 0.9, 0.95, 0.99)
# ++model.trainer.nb_epochs: choice(1, 10, 30, 50, 100)
++model.trainer.batch_size: choice(32, 64, 128, 256, 512, 1024)
++model.trainer.batch_size: choice(128, 256, 512, 1024)
_target_: hydra_plugins.hydra_optuna_sweeper.optuna_sweeper.OptunaSweeper
launcher:
_target_: hydra_plugins.hydra_joblib_launcher.joblib_launcher.JoblibLauncher
Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/conf/cifar100.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ hydra:
++model.art.initialize.optimizer.lr: choice( 0.1, 0.01, 0.001, .0001, .00001, 0.000001)
++model.art.initialize.optimizer.momentum: choice(0.1, 0.9, 0.95, 0.99)
# ++model.trainer.nb_epochs: choice(1, 10, 30, 50, 100)
++model.trainer.batch_size: choice(32, 64, 128, 256, 512, 1024)
++model.trainer.batch_size: choice(128, 256, 512, 1024)
_target_: hydra_plugins.hydra_optuna_sweeper.optuna_sweeper.OptunaSweeper
launcher:
_target_: hydra_plugins.hydra_joblib_launcher.joblib_launcher.JoblibLauncher
Expand Down
4 changes: 2 additions & 2 deletions examples/pytorch/conf/mnist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ hydra:
++model.art.initialize.optimizer.lr: choice( 0.1, 0.01, 0.001, .0001, .00001, 0.000001)
++model.art.initialize.optimizer.momentum: choice(0.1, 0.9, 0.95, 0.99)
# ++model.trainer.nb_epochs: choice(1, 10, 30, 50, 100)
++model.trainer.batch_size: choice(32, 64, 128, 256, 512, 1024)
++model.trainer.batch_size: choice(128, 256, 512, 1024)
_target_: hydra_plugins.hydra_optuna_sweeper.optuna_sweeper.OptunaSweeper
launcher:
_target_: hydra_plugins.hydra_joblib_launcher.joblib_launcher.JoblibLauncher
Expand All @@ -50,4 +50,4 @@ hydra:
batch_size: auto
temp_folder: /tmp/deckard
max_nbytes: 100000
mmap_mode: r
mmap_mode: r
Loading

0 comments on commit 4060aa1

Please sign in to comment.