forked from YangRui2015/Sparse-Reward-Algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.py
124 lines (101 loc) · 2.6 KB
/
options.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import argparse
def parse_options():
parser = argparse.ArgumentParser()
parser.add_argument(
"--threadings",
type=int,
help="Number of threadings running one FLAGS",
default=1,
)
parser.add_argument(
"--episodes",
type=int,
help='Total episodes to run',
default=5000
)
parser.add_argument(
"--save_freq",
type=int,
help="How often to save model",
default=10,
)
parser.add_argument(
'--save_experience',
action='store_true',
help='if save experience for imitatation learning'
)
parser.add_argument(
"--layers",
type=int,
help="How many layer of the HRL",
default=1,
)
parser.add_argument(
"--her",
action='store_true',
help='if use her or not',
)
parser.add_argument(
'--imitation',
action='store_true',
help='if use imitation learning'
)
parser.add_argument(
'--imit_ratio',
type=float,
default=1.0,
help='ratio of imitation loss by actor loss'
)
parser.add_argument(
'--retrain',
action='store_true',
help='Include to reset policy'
)
parser.add_argument(
'--test',
action='store_true',
help='Include to fix current policy'
)
parser.add_argument(
'--show',
action='store_true',
help='Include to visualize training'
)
parser.add_argument(
'--verbose',
action='store_true',
help='Print summary of each transition'
)
parser.add_argument(
'--env',
type=str,
default="reach",
help='The environment to run'
)
parser.add_argument(
'--rtype',
type=str,
default="sparse",
help='sparse reward or dense reward'
)
parser.add_argument(
'--curriculum',
type=int,
default=0,
help='num of curriculums'
)
parser.add_argument(
'--curiosity',
action='store_true',
help='use curiosity driven method'
)
FLAGS, unparsed = parser.parse_known_args()
FLAGS.normalize = False
if FLAGS.threadings > 1: # otherwise there will be a bug
FLAGS.show = False
if FLAGS.test:
FLAGS.retrain = False
# print("You can check your parameters here. Press 'c' to continue.")
print(FLAGS)
# import pdb; pdb.set_trace()
return FLAGS