kzl / decision-transformer

Official codebase for Decision Transformer: Reinforcement Learning via Sequence Modeling.
MIT License
2.33k stars 440 forks source link

Minor bug that removes best performing trajectory in gym experiments #33

Closed micahcarroll closed 2 years ago

micahcarroll commented 2 years ago

I believe that this line should have a <= rather than a < in order for the code to not cut out the best performing trajectory even when using pct_traj = 1.

https://github.com/kzl/decision-transformer/blob/f04280e3668a992c41b38bdfb6b6181d61b4dc52/gym/experiment.py#L109

To replicate, use a dataset with 2 trajectories and use pct_traj = 1. and the resulting num_trajectories will just be 1 rather than 2.

kzl commented 2 years ago

Thanks for catching this! I think you're right.