Training Speed with Gym_unity

Hello there!

I am pretty new to ml-agents and everything associated with it, so excuse me if my topic is already answered or in the docs. I am trying to train agents in unity with the gym wrapper of mlagents. To train the agents I use the stable baselines repo and try to train with their algorithms on my environment. Unfortunately the training process seems much slower as when I train with mlagents directly: Everything just seems to be played in real time, rather than faster as real time when I train with ml-agents directly. Is there any option to enable the faster training speed, or am I always limited to the normal fps of the executable of unity?
Thanks in advance!

Hello,

In order to do this, you will need to create an engineconfig side channel, and set the time scale. This is done automatically with the mlagents trainer package, but needs to be done manually with gym. Here are some docs on the side channel: https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Python-API.md#engineconfigurationchannel

Thank you so much! Really appreciated. Is there any tip how great one can set the time scale parameter, before the physics behaves weird? Or just set it to 100 and check if it works and else set it lower? Because it is really hard to evaluate during the training process ( because it happens so fast of course).