-
1:
Init: high-level SAC , low-level SAC (NDBCNet), twin critics and , target critics , replay buffers , optimizers with LR , discounts , temperatures , Polyak factor , batch sizes , update steps
-
2:
for each episode do
-
3:
Reset env; get
-
4:
while episode not terminated do
-
5:
Sample high-level action ; set , , ,
-
6:
for to do
-
7:
Sample
-
8:
Execute a; observe , reward , done
-
9:
Store in
-
10:
; ;
-
11:
// low-level updates
-
12:
for to do
-
13:
Sample batch ; sample
-
14:
-
15:
Update towards ; update with respect to
-
16:
Soft-update
-
17:
(optional) adjust by target entropy
-
18:
end for
-
19:
;
-
20:
if done or GoalReached() or then
-
21:
break
-
22:
end if
-
23:
end for
-
24:
// aggregate and store high-level SMDP transition
-
25:
(plus success bonus/penalty)
-
26:
Store in
-
27:
if not GoalReached() then
-
28:
Hindsight Goal Relabeling (HGR)
-
29:
recompute
-
30:
Store in
-
31:
end if
-
32:
// high-level updates
-
33:
for to do
-
34:
Sample batch ; sample
-
35:
-
36:
Update towards ; update with respect to
-
37:
Soft-update
-
38:
(optional) adjust by target entropy
-
39:
end for
-
40:
end while
-
41:
end for
-
42:
return trained ,
|