-
Notifications
You must be signed in to change notification settings - Fork 6
/
option_trans.py
executable file
·64 lines (44 loc) · 2.58 KB
/
option_trans.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
60
61
62
63
64
import argparse
import os
class Options():
def __init__(self):
# Training settings
parser = argparse.ArgumentParser(description='Tank Shot')
parser.add_argument('--dataset', default='CUB1', type=str,
help='dataset to be processed')
# parser.add_argument('--batchSize', default=25,type=int,
# help='Batch Size')
# parser.add_argument('--lr', default=1e-3, type=float,
# help='learning rate')
parser.add_argument('--step_size', default=200, type=int,
help='decay step')
parser.add_argument('--gamma', default=0.5, type=float,
help='decay rate')
parser.add_argument('--num_epochs', default=500, type=int,
help='epoch number')
parser.add_argument('--nthreads', default=8,type=int,
help='threads num to load data')
parser.add_argument('--ways', default=32,type=int,
help='number of class for one test')
parser.add_argument('--shots', default=4,type=int,
help='number of pictures of each class to support')
parser.add_argument('--lr', default=1e-5,type=float,
help='learning rate')
parser.add_argument('--weight_model', default='weightnet',type=str,
help='weight model name after finetuning')
parser.add_argument('--hidden_dim', default=1600,type=int,
help='hidden dimension')
parser.add_argument('--opt_decay', default=1e-3,type=float,
help='decay rate for optimizer')
parser.add_argument("--log_to_file", type=bool, default=True)
parser.add_argument("--log_file", type=str, default='temp.log')
parser.add_argument("--trans_model_name", type=str, default='trans_model.pt')
parser.add_argument("--loss_q", type=float, default=0.5)
parser.add_argument("--ep_int", type=int, default=10)
parser.add_argument("--wt_model", type=str, default='weight_gen_model.pt')
parser.add_argument("--test_shots", default=4, type=int, help='test shots')
parser.add_argument("--test_ways", default=32, type=int, help='test ways')
# parser.add_argument("--wt_model", type=int, default=10)
self.parser = parser
def parse(self):
return self.parser.parse_args()