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

Set truncated flag before callback invocation #117

Open
sidnarayanan opened this issue Oct 23, 2024 · 1 comment · Fixed by #118
Open

Set truncated flag before callback invocation #117

sidnarayanan opened this issue Oct 23, 2024 · 1 comment · Fixed by #118
Assignees

Comments

@sidnarayanan
Copy link
Collaborator

In these lines, we mark a trajectory as truncated after callback.after_transition() is invoked, so the callback cannot tell if this transition is the last of the rollout. We should flip the order:

ldp/ldp/alg/rollout.py

Lines 241 to 252 in 1bc0330

await store_step(step)
# set things up for the next iteration
agent_state = step.next_agent_state
obs = step.next_observation
if step.done:
break
if timestep + 1 == max_steps:
trajectory.steps[-1].truncated = True
break

@sidnarayanan sidnarayanan self-assigned this Oct 23, 2024
@sidnarayanan sidnarayanan changed the title Make sure to set truncated flag before callback invocation Set truncated flag before callback invocation Oct 23, 2024
@sidnarayanan sidnarayanan reopened this Oct 23, 2024
@sidnarayanan
Copy link
Collaborator Author

Note to self: #118 did not add a unit test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant