Replies: 1 comment 4 replies
-
Hello, I also found that changing clockspeed will have a bad impact on RL. Have you found a suitable solution to speed up training? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all, I wanted to discuss about the matter of the simulation speed when it comes to reinforcement learning. For obvious reasons, training an agent with 1 to 1 simulation clock is very inefficient, mostly because of how long every simulation takes. The most logical way to make the learning more efficient is to speed up the simulation, which I had no real success in so far. I believe it's actually quite hard for many reasons :
What really matters is the simulation step used by PhysX, which is constant throughout any simulation. The trick is to take it small enough so that simulation is accurate, but big enough so that the sim can run very fast. But there is no such parameter in AirSim, or at least I couldn't find it.
The only setting available is "ClockSpeed" in settings.JSON, but this setting doesn't make much sense for reinforcement learning, since we don't really care about having a consistent clock scale, but rather picking an optimal PhysX time step.
Working with ClockSpeed is quite tricky, here are the things I have and figured out :
Working with big clock speed will end up making simulations groundless because the PhysX time step ends up being too big for simulating real behaviour. It seems that PhysX is made for running video games at at least 30 FPS, so the intuitive thumb rule I have found is to make sure your framerate divided by the clock scale is always above 30. for example if you run AirSim at constant 60FPS, you should never pick a clock speed of more than 2.
However FPS are not consistent at all, and it's just a (poor) approximation : you may never know if the clock speed you have picked is just doubling the speed, or completely breaking physics.
By the way, the editor caps the framerate at 120 FPS, so make sure to launch the project first. You can also make the resolution very low and set all the graphic settings to low to gain even more FPS... but so far I have still not found any way to display the FPS once the project is launched, so I have no idea how high I can set the clock speed. Disabling display may also be a way to get more FPS but I have not found how.
I believe working with a constant clock scale doesn't make much sense for many applications, and it would be great to have a mode where we can fix a physically coherent PhysX time step and let the clock speed do whatever it wants and go however high the hardware can handle it.
Please, let me know your opinion on that 🙂, I am on no account a specialist and I would love to be corrected or to learn more about how all of this is working, and how you have managed to go beyond that obstacle.
Beta Was this translation helpful? Give feedback.
All reactions