mirror of
https://github.com/wassname/ray.git
synced 2026-07-23 13:10:11 +08:00
[RLLib] DDPG (#1685)
This commit is contained in:
@@ -20,7 +20,7 @@ class PartialRollout(object):
|
||||
last_r (float): Value of next state. Used for bootstrapping.
|
||||
"""
|
||||
|
||||
fields = ["observations", "actions", "rewards", "terminal", "features"]
|
||||
fields = ["obs", "actions", "rewards", "new_obs", "dones", "features"]
|
||||
|
||||
def __init__(self, extra_fields=None):
|
||||
"""Initializers internals. Maintains a `last_r` field
|
||||
@@ -54,7 +54,7 @@ class PartialRollout(object):
|
||||
|
||||
Returns:
|
||||
terminal (bool): if rollout has terminated."""
|
||||
return self.data["terminal"][-1]
|
||||
return self.data["dones"][-1]
|
||||
|
||||
|
||||
CompletedRollout = namedtuple(
|
||||
@@ -232,11 +232,12 @@ def _env_runner(env, policy, num_local_steps, horizon, obs_filter):
|
||||
action = np.concatenate(action, axis=0).flatten()
|
||||
|
||||
# Collect the experience.
|
||||
rollout.add(observations=last_observation,
|
||||
rollout.add(obs=last_observation,
|
||||
actions=action,
|
||||
rewards=reward,
|
||||
terminal=terminal,
|
||||
dones=terminal,
|
||||
features=last_features,
|
||||
new_obs=observation,
|
||||
**pi_info)
|
||||
|
||||
last_observation = observation
|
||||
|
||||
Reference in New Issue
Block a user