Skip to content

Commit

Permalink
fix: value padding with [0]
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriCat committed Jan 24, 2024
1 parent 403ae35 commit 248ef2a
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 248ef2a

Please sign in to comment.