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:
|
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 |
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