Skip to content

Commit

Permalink
Merge pull request #351 from YuriCat/fix/value_padding
Browse files Browse the repository at this point in the history
fix: value padding with [0]
  • Loading branch information
YuriCat authored Jan 24, 2024
2 parents 403ae35 + 248ef2a commit 812485f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handyrl/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def replace_none(a, b):
obs = bimap_r(obs_zeros, obs, lambda _, o: np.array(o))

# datum that is not changed by training configuration
v = np.array([[replace_none(m['value'][player], 0) for player in players] for m in moments], dtype=np.float32).reshape(len(moments), len(players), -1)
v = np.array([[replace_none(m['value'][player], [0]) for player in players] for m in moments], dtype=np.float32).reshape(len(moments), len(players), -1)
rew = np.array([[replace_none(m['reward'][player], 0) for player in players] for m in moments], dtype=np.float32).reshape(len(moments), len(players), -1)
ret = np.array([[replace_none(m['return'][player], 0) for player in players] for m in moments], dtype=np.float32).reshape(len(moments), len(players), -1)
oc = np.array([ep['outcome'][player] for player in players], dtype=np.float32).reshape(1, len(players), -1)
Expand Down

0 comments on commit 812485f

Please sign in to comment.