Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rllib] Basic port of baselines/deepq to rllib #709

Merged
merged 27 commits into from
Jul 7, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix small bug
  • Loading branch information
ericl committed Jun 27, 2017
commit 173aac1229019e45e9f673af0ab7261894dada86
9 changes: 6 additions & 3 deletions python/ray/rllib/a3c/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,13 @@ def env_runner(env, policy, num_local_steps, summary_writer, render):
if render:
env.render()

# Collect the experience.
rollout.add(last_state, action, reward, value_, terminal, last_features)
length += 1
rewards += reward
if length >= timestep_limit:
terminal = True

# Collect the experience.
rollout.add(last_state, action, reward, value_, terminal, last_features)

last_state = state
last_features = features
Expand All @@ -145,7 +148,7 @@ def env_runner(env, policy, num_local_steps, summary_writer, render):

timestep_limit = env.spec.tags.get("wrapper_config.TimeLimit"
".max_episode_steps")
if terminal or length >= timestep_limit:
if terminal:
terminal_end = True
if length >= timestep_limit or not env.metadata.get("semantics"
".autoreset"):
Expand Down