-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_shell.sh
More file actions
54 lines (38 loc) · 4.04 KB
/
run_shell.sh
File metadata and controls
54 lines (38 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# ----------------Evaluation CIFAR10-ResNet18----------------
## Step 1: Pretrain original models (one victim model and five shadow models)
python pretrain_modi.py 0 ./config/cifar10_resnet18.json
## Step 2-1: Prune and fine-tune models with 'Base' defense method
python prune_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --prune_iter 5
## Step 2-2: Adaptive attack on pruned models with 'Base' defense method
python mia_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --attacks threshold,samia
## Step 3-1: Prune and fine-tune models with 'slide_re' defense method (Ours defense)
python prune_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --prune_iter 5 --defend slide_re --stride 50 --width 500
## Step 3-2: Adaptive attack on pruned models with 'slide_re' defense method (Ours defense)
python mia_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --attacks threshold,samia --defend slide_re --adaptive
## Step 4-1: Prune and fine-tune models with 'ml2' defense method (Ours defense)
python prune_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --prune_iter 5 --defend ml2 --weight_decay_mem 0.1 --mem_thre 0.5
## Step 4-2: Adaptive attack on pruned models with 'ml2' defense method (Ours defense)
python mia_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --attacks threshold,samia --defend ml2 --adaptive
## Step 5-1: Prune and fine-tune models with 'slide_ml2' defense method (Ours defense)
python prune_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --prune_iter 5 --defend slide_ml2 --weight_decay_mem 0.1 --stride 100 --width 500 --mem_thre 0.5
## Step 5-2: Adaptive attack on pruned models with 'slide_ml2' defense method (Ours defense)
python mia_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --attacks threshold,samia --defend slide_ml2 --adaptive
# ---------------------Evaluation Location-FC---------------------
## Step 1: Pretrain original models (one victim model and five shadow models)
python pretrain_modi.py 0 ./config/location.json
## Step 2-1: Prune and fine-tune models with 'Base' defense method
python prune_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --prune_iter 5
## Step 2-2: Adaptive attack on pruned models with 'Base' defense method
python mia_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --attacks threshold,samia
## Step 3-1: Prune and fine-tune models with 'slide_re' defense method (Ours defense)
python prune_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --prune_iter 5 --defend slide_re --stride 1 --width 15
## Step 3-2: Adaptive attack on pruned models with 'slide_re' defense method (Ours defense)
python mia_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --attacks threshold,samia --defend slide_re --adaptive
## Step 4-1: Prune and fine-tune models with 'ml2' defense method (Ours defense)
python prune_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --prune_iter 5 --defend ml2 --weight_decay_mem 0.1 --mem_thre 0.6
## Step 4-2: Adaptive attack on pruned models with 'ml2' defense method (Ours defense)
python mia_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --attacks threshold,samia --defend ml2 --adaptive
## Step 5-1: Prune and fine-tune models with 'slide_ml2' defense method (Ours defense)
python prune_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --prune_iter 5 --defend slide_ml2 --weight_decay_mem 0.1 --stride 1 --width 15 --mem_thre 0.6
## Step 5-2: Adaptive attack on pruned models with 'slide_ml2' defense method (Ours defense)
python mia_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --attacks threshold,samia --defend slide_ml2 --adaptive