coax-dev / coax

Modular framework for Reinforcement Learning in python
https://coax.readthedocs.io
MIT License
166 stars 17 forks source link

use list for simple replay buffer #25

Closed frederikschubert closed 2 years ago

frederikschubert commented 2 years ago

When using the SimpleReplayBuffer, the sampling performance depends on the number of samples due to deque. This is caused by the slow indexed access to elements in the middle of the collection.

The simple switch to a list improves the performance significantly. An example for SAC on the Walker stand task from the DeepMind Control Suite with a buffer size of 1M is given below.

step time

return

KristianHolsheimer commented 2 years ago

Thanks Frederik!