Skip to content

Commit

Permalink
Update sb3_imitation.py
Browse files Browse the repository at this point in the history
Refactor for loop
  • Loading branch information
Ivan-267 committed Jan 29, 2024
1 parent 187106c commit 02a87b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/sb3_imitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ def close_env():
with open(file_path, "r") as file:
data = json.load(file)

for i in range(0, len(data)):
for traj in data:
trajectories.append(
imitation.data.rollout.types.Trajectory(
obs=np.array(data[i][0]),
acts=np.array(data[i][1]),
obs=np.array(traj[0]),
acts=np.array(traj[1]),
infos=None,
terminal=True,
)
Expand Down

0 comments on commit 02a87b7

Please sign in to comment.