-
Notifications
You must be signed in to change notification settings - Fork 4
/
arguments.py
32 lines (28 loc) · 1.64 KB
/
arguments.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
import argparse
import torch
def get_args():
parser = argparse.ArgumentParser(description='PyTorch MNIST Example')
parser.add_argument('--batch-size', type=int, default=64, metavar='N',
help='input batch size for training (default: 64)')
parser.add_argument('--test-batch-size', type=int, default=1000, metavar='N',
help='input batch size for testing (default: 1000)')
parser.add_argument('--epochs', type=int, default=5, metavar='N',
help='number of epochs to train (default: 10)')
parser.add_argument('--lr', type=float, default=0.001, metavar='LR',
help='learning rate (default: 0.001)')
parser.add_argument('--momentum', type=float, default=0.99, metavar='M',
help='SGD momentum (default: 0.99)')
parser.add_argument('--no-cuda', action='store_true', default=False,
help='disables CUDA training')
parser.add_argument('--seed', type=int, default=1, metavar='S',
help='random seed (default: 1)')
parser.add_argument('--log-interval', type=int, default=10000, metavar='N',
help='how many batches to wait before logging training status')
parser.add_argument('--dropout', action='store_true', default=False,
help='Activates dropout training!')
parser.add_argument('--origin', type=str, default='mnist',
help='Kind of training!')
parser.add_argument('--ewc', action='store_true')
args = parser.parse_args()
args.cuda = not args.no_cuda and torch.cuda.is_available()
return args