forked from PaddlePaddle/PARL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain_args.py
87 lines (79 loc) · 2.73 KB
/
train_args.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
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'--cluster_address',
default='localhost:8010',
type=str,
help='cluster address of xparl.')
parser.add_argument(
'--actor_num', type=int, required=True, help='number of actors.')
parser.add_argument(
'--logdir',
type=str,
default='logdir',
help='directory to save model/tensorboard data')
parser.add_argument(
'--difficulty',
type=int,
required=True,
help=
'difficulty of L2M2019Env. difficulty=1 means Round 1 environment but target theta is always 0; difficulty=2 menas Round 1 environment; difficulty=3 means Round 2 environment.'
)
parser.add_argument(
'--vel_penalty_coeff',
type=float,
default=1.0,
help='coefficient of velocity penalty in reward shaping.')
parser.add_argument(
'--muscle_penalty_coeff',
type=float,
default=1.0,
help='coefficient of muscle penalty in reward shaping.')
parser.add_argument(
'--penalty_coeff',
type=float,
default=1.0,
help='coefficient of all penalty in reward shaping.')
parser.add_argument(
'--only_first_target',
action="store_true",
help=
'if set, will terminate the environment run after the first target finished.'
)
parser.add_argument(
'--rpm_size',
type=lambda x: int(float(x)),
default=int(2e6),
help='size of replay memory.')
parser.add_argument(
'--train_times',
type=int,
default=100,
help='training times (batches) when finishing an episode.')
parser.add_argument(
'--restore_model_path',
type=str,
help='restore model path for warm start')
parser.add_argument(
'--restore_rpm_path', type=str, help='restore rpm path for warm start')
parser.add_argument(
'--warm_start_batchs',
type=int,
default=2000,
help='collect how many batch data to warm start')
args = parser.parse_args()
return args