mirror of
https://github.com/wassname/ray.git
synced 2026-07-27 11:26:41 +08:00
[rllib] Fix edge case in n-step calculation and non-apex replay prioritization (#2929)
* fix * lint
This commit is contained in:
@@ -92,13 +92,13 @@ class SyncReplayOptimizer(PolicyOptimizer):
|
||||
|
||||
for policy_id, s in batch.policy_batches.items():
|
||||
for row in s.rows():
|
||||
if "weights" not in row:
|
||||
row["weights"] = np.ones_like(row["rewards"])
|
||||
self.replay_buffers[policy_id].add(
|
||||
pack_if_needed(row["obs"]),
|
||||
row["actions"], row["rewards"],
|
||||
pack_if_needed(row["new_obs"]), row["dones"],
|
||||
row["weights"])
|
||||
row["actions"],
|
||||
row["rewards"],
|
||||
pack_if_needed(row["new_obs"]),
|
||||
row["dones"],
|
||||
weight=None)
|
||||
|
||||
if self.num_steps_sampled >= self.replay_starts:
|
||||
self._optimize()
|
||||
|
||||
Reference in New Issue
Block a user