Skip to content

Commit 5a7a5c9

Browse files
Update training_phase1.py
1 parent e43a843 commit 5a7a5c9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

novel_phases/phase1/training_phase1.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ def collect_trajectories(env_name: str, state_dim: int, act_dim: int, act_type:
207207
if current_steps % (offline_steps // 10) == 0 and offline_steps > 0: # Log progress
208208
print(f" Collected {current_steps}/{offline_steps} steps...")
209209

210+
# After the loop, add any remaining trajectory in the buffer
211+
if len(buf) > 0:
212+
trajectories.append(buf.get_trajectory())
213+
print(f" Added final partial trajectory of length {len(buf)}.")
214+
buf.reset()
215+
210216
env.close()
211217
print(f"Finished collecting {len(trajectories)} trajectories ({current_steps} total steps).")
212218
return trajectories

0 commit comments

Comments
 (0)