-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
59 lines (56 loc) · 2.44 KB
/
config.py
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
51
52
53
54
55
56
57
58
59
import torch
device=torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def get_config(task):
if task=='task0':
config = {
'task' : 'task0',
'shadow_dataset' : 'cifar10',
'shadow_model' : 'resnet34',
'target_model' : 'resnet34',
'attack_model' : 'BasicNN',
'split_ratio' : 0.5,
'shadow_dataset_num_classes' : 10,
'train_attack_epochs' : 50,
'train_shadow_epochs' : 50,
'mode' : 'eval', # eval, test : (only for submission)
}
if task=='task1':
config = {
'task' : 'task1',
'shadow_dataset' : 'cifar10',
'shadow_model' : 'mobilenetv2',
'target_model' : 'mobilenetv2',
'attack_model' : 'BasicNN',
'split_ratio' : 0.5,
'shadow_dataset_num_classes' : 10,
'train_attack_epochs' : 50,
'train_shadow_epochs' : 50,
'mode' : 'eval', # eval, test : (only for submission)
}
if task=='task2':
config = {
'task' : 'task2',
'shadow_dataset' : 'tinyimagenet',
'shadow_model' : 'resnet34',
'target_model' : 'resnet34',
'attack_model' : 'BasicNN',
'split_ratio' : 0.5,
'shadow_dataset_num_classes' : 10,
'train_attack_epochs' : 50,
'train_shadow_epochs' : 50,
'mode' : 'eval', # eval, test : (only for submission)
}
if task=='task3':
config = {
'task' : 'task3',
'shadow_dataset' : 'tinyimagenet',
'shadow_model' : 'mobilenetv2',
'target_model' : 'mobilenetv2',
'attack_model' : 'BasicNN_v2',
'split_ratio' : 0.5,
'shadow_dataset_num_classes' : 10,
'train_attack_epochs' : 50,
'train_shadow_epochs' : 50,
'mode' : 'eval', # eval, test : (only for submission)
}
return config