-
Notifications
You must be signed in to change notification settings - Fork 0
/
RIQL_config.py
108 lines (101 loc) · 3.27 KB
/
RIQL_config.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
def get_config(TrainConfig):
TrainConfig.num_critics = 5
key = TrainConfig.env_name.split('-')[0]
if TrainConfig.corruption_mode == 'random':
if TrainConfig.corrupt_obs:
TrainConfig.sigma = {
'halfcheetah': 0.1,
'walker2d': 0.1,
'hopper': 0.1,
}[key]
TrainConfig.quantile = {
'halfcheetah': 0.1,
'walker2d': 0.25,
'hopper': 0.25,
}[key]
if key == 'hopper':
TrainConfig.num_critics = 3
elif TrainConfig.corrupt_acts:
TrainConfig.sigma = {
'halfcheetah': 0.5,
'walker2d': 0.5,
'hopper': 0.1,
}[key]
TrainConfig.quantile = {
'halfcheetah': 0.25,
'walker2d': 0.1,
'hopper': 0.25,
}[key]
if key == 'halfcheetah':
TrainConfig.num_critics = 3
elif TrainConfig.corrupt_reward:
TrainConfig.sigma = {
'halfcheetah': 3.0,
'walker2d': 3.0,
'hopper': 1.0,
}[key]
TrainConfig.quantile = {
'halfcheetah': 0.25,
'walker2d': 0.1,
'hopper': 0.25,
}[key]
if key == 'hopper':
TrainConfig.num_critics = 3
elif TrainConfig.corrupt_dynamics:
TrainConfig.sigma = {
'halfcheetah': 3.0,
'walker2d': 1.0,
'hopper': 1.0,
}[key]
TrainConfig.quantile = {
'halfcheetah': 0.25,
'walker2d': 0.25,
'hopper': 0.5,
}[key]
if key == 'walker2d':
TrainConfig.num_critics = 3
elif TrainConfig.corruption_mode == 'adversarial':
if TrainConfig.corrupt_obs:
TrainConfig.sigma = {
'halfcheetah': 0.1,
'walker2d': 1.0,
'hopper': 1.0,
}[key]
TrainConfig.quantile = {
'halfcheetah': 0.1,
'walker2d': 0.25,
'hopper': 0.25,
}[key]
elif TrainConfig.corrupt_acts:
TrainConfig.sigma = {
'halfcheetah': 1.0,
'walker2d': 1.0,
'hopper': 1.0,
}[key]
TrainConfig.quantile = {
'halfcheetah': 0.1,
'walker2d': 0.1,
'hopper': 0.25,
}[key]
elif TrainConfig.corrupt_reward:
TrainConfig.sigma = {
'halfcheetah': 1.0,
'walker2d': 3.0,
'hopper': 0.1,
}[key]
TrainConfig.quantile = {
'halfcheetah': 0.1,
'walker2d': 0.1,
'hopper': 0.25,
}[key]
elif TrainConfig.corrupt_dynamics:
TrainConfig.sigma = {
'halfcheetah': 1.0,
'walker2d': 1.0,
'hopper': 1.0,
}[key]
TrainConfig.quantile = {
'halfcheetah': 0.1,
'walker2d': 0.25,
'hopper': 0.5,
}[key]