-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetting.py
30 lines (25 loc) · 1.17 KB
/
setting.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
import argparse
def args_parser():
r"""
This file serves as a global enviornment for setting up a simulation.
"""
parser = argparse.ArgumentParser()
## Training parameters
parser.add_argument('--server_epochs', type=int, default=2,
help="Number of Epochs")
parser.add_argument('--server_batch', type=int, default=100,
help="Batch Size")
parser.add_argument('--server_lr', type=int, default=0.001,
help="Learning Rate")
## Attack Type
parser.add_argument('--attack', type=str, default="parameterized",
help="either 'parameterized' or 'regularized'")
## Etc.
parser.add_argument('--root_dir', type=str, default="hbcnets",
help="The root directory for saving data and results.")
parser.add_argument('--gpu', default=None,
help="When using GPU, set --gpu=0")
parser.add_argument('--device', default='cpu',
help="When using GPU, set --device='cuda'")
args = parser.parse_args()
return args