Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question When training multiple instances of the same agent, do all agents have to be in view?

Discussion in 'ML-Agents' started by ragleysenpai, Apr 12, 2023.

  1. ragleysenpai


    Feb 2, 2023
    I'm creating a Foosball game with ml-agents, by which I've had some success getting it to learn properly. To speed up training I'd like to train multiple agents in the environment simultaneously. I notice a massive performance increase when lining up my foosball tables in a single line compared to arranging them in a more compact block formation. I assume this is due to the game not rendering these but I could be wrong. Are these agents still training properly? Any help is greatly appreciated.
  2. kokimitsunami


    Sep 2, 2021
    I'm not sure about the answer to your question, but there is another way to speed up training. You can use built environment executable rather than the Unity Editor. You can run the executable with headless mode, which means it doesn't render.

    You can train with an executable by something like this:
    mlagents-learn ./<trainConfig>.yaml --no-graphics --run-id=<runId> --env=<builtEnv>.exe --num-envs=5

    Hope this helps.