Is there a way to determine when training starts in Learning Agents?

When using Learning Agents for training, is there a way to determine when training starts? I am conducting reinforcement learning using Learning Agents and have created a blueprint based on the ‘Learning to drive’ tutorial provided by Learning Agents. However, I feel that it is somewhat difficult and less flexible for my use case (I am redesigning the internal logic of the PPO model and plan to use multiple models simultaneously, which makes it challenging to achieve solely with Learning Agents). I aim to retain the structure of Learning Agents while performing training externally through a Python file.

In this setup, I use the Interactor to receive observation values, calculate action values in the Python file, and then pass the reward to the Python file to construct a buffer. Since the training framework itself remains based on Learning Agents, I want to trigger the Python file to start training as well when data training actually begins. However, even when using the IsTraining property of the trainer, it continuously returns true, making it impossible to detect when training starts.

I am working entirely with blueprints in version 5.3. Is there a way to determine when training starts?

1 Like

Training starts when you call “Run Training”. If you look at the code inside of “RunTraining”, you’ll see it’s composed of functions like “BeginTraining” etc.

You could add some kind of event to be able to see when Begin Training is called, or you could simply call another function after BeginTraining. I would join the Unreal GitHub and take a look at all the functions we have exposed to Blueprints on the Interactor and the Trainer etc. I think you can create what you want if you use the lower level API.

If you need to change the communications between the C++/Python, then you’ll need to upgrade to 5.5 and/or compile from source on 5.3 and add some extensions.

5.5. adds a primitive “bring your own algorithm” support which makes custom PPO extensions much more feasible.

Good luck!