Commit d042c70 1 parent edc106e commit d042c70 Copy full SHA for d042c70
File tree 10 files changed +146040
-107766
lines changed
configuration/experiments/jsp
10 files changed +146040
-107766
lines changed Original file line number Diff line number Diff line change 1
1
from typing import Dict
2
2
3
3
import tensordict
4
+ import torch
4
5
from torch .optim .swa_utils import AveragedModel , get_ema_avg_fn
5
6
6
7
from agents .utils .memory import NotReadyException
@@ -52,7 +53,9 @@ def compute_loss():
52
53
53
54
print (actions .view (- 1 ), q_values .view (- 1 ))
54
55
55
- loss_ = self .loss (actions , q_values )
56
+ weight = torch .tensor (info ['_weight' ]) if '_weight' in info .keys () else torch .ones_like (q_values )
57
+
58
+ loss_ = (self .loss (actions , q_values ) * weight ).mean ()
56
59
td_error_ = torch .square (actions - q_values )
57
60
58
61
entropy = torch .distributions .Categorical (logits = actions ).entropy ().mean ()
Load Diff Large diffs are not rendered by default.
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ dqn_1: &dqn_1
13
13
- ' configuration/mods/machine/mods'
14
14
mods :
15
15
- ' agent/dqn/ddqn.yml'
16
- # - 'agent/dqn/prioritized.yml'
16
+ - ' agent/dqn/prioritized.yml'
17
17
- *default_mods
18
18
19
19
@@ -26,7 +26,7 @@ dqn_1_local: &dqn_1_local
26
26
- ' configuration/mods/machine/mods'
27
27
mods :
28
28
- ' agent/dqn/ddqn.yml'
29
- # - 'agent/dqn/prioritized.yml'
29
+ - ' agent/dqn/prioritized.yml'
30
30
- *default_mods
31
31
32
32
# ##############################################################################################
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ dqn_1: &dqn_1
30
30
- ' configuration/mods/machine/mods'
31
31
mods :
32
32
- ' agent/dqn/ddqn.yml'
33
- # - 'agent/dqn/prioritized.yml'
33
+ - ' agent/dqn/prioritized.yml'
34
34
- *default_mods
35
35
36
36
# ##############################################################################################
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ dqn_1: &dqn_1
31
31
- ' configuration/mods/machine/mods'
32
32
mods :
33
33
- ' agent/dqn/ddqn.yml'
34
+ - ' agent/dqn/prioritized.yml'
34
35
- *default_mods
35
36
36
37
# ##############################################################################################
@@ -42,6 +43,7 @@ dqn_1_hierarchical: &dqn_1_hierarchical
42
43
- ' configuration/mods/machine/mods'
43
44
mods :
44
45
- ' agent/dqn/ddqn.yml'
46
+ - ' agent/dqn/prioritized.yml'
45
47
- *default_mods
46
48
47
49
# ##############################################################################################
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ dqn_1: &dqn_1
29
29
- ' configuration/mods/machine/mods'
30
30
mods :
31
31
- ' agent/dqn/ddqn.yml'
32
+ - ' agent/dqn/prioritized.yml'
32
33
- *default_mods
33
34
34
35
# ##############################################################################################
@@ -40,6 +41,7 @@ dqn_1_gat: &dqn_1_gat
40
41
- ' configuration/mods/machine/mods'
41
42
mods :
42
43
- ' agent/dqn/ddqn.yml'
44
+ - ' agent/dqn/prioritized.yml'
43
45
- *default_mods
44
46
45
47
# ##############################################################################################
@@ -51,6 +53,7 @@ dqn_1_gcn: &dqn_1_gcn
51
53
- ' configuration/mods/machine/mods'
52
54
mods :
53
55
- ' agent/dqn/ddqn.yml'
56
+ - ' agent/dqn/prioritized.yml'
54
57
- *default_mods
55
58
56
59
@@ -63,6 +66,7 @@ dqn_1_sage: &dqn_1_sage
63
66
- ' configuration/mods/machine/mods'
64
67
mods :
65
68
- ' agent/dqn/ddqn.yml'
69
+ - ' agent/dqn/prioritized.yml'
66
70
- *default_mods
67
71
68
72
Original file line number Diff line number Diff line change @@ -60,6 +60,8 @@ parameters:
60
60
61
61
loss :
62
62
kind : ' mse'
63
+ parameters :
64
+ reduction : ' none'
63
65
64
66
optimizer :
65
67
model :
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ parameters:
63
63
64
64
loss :
65
65
kind : ' mse'
66
+ parameters :
67
+ reduction : ' none'
66
68
67
69
optimizer :
68
70
model :
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ parameters:
62
62
63
63
loss :
64
64
kind : ' huber'
65
+ parameters :
66
+ reduction : ' none'
65
67
66
68
optimizer :
67
69
model :
You can’t perform that action at this time.
0 commit comments