Search Unity

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

    ragleysenpai

    Joined:
    Feb 2, 2023
    Posts:
    2
    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

    kokimitsunami

    Joined:
    Sep 2, 2021
    Posts:
    25
    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.
    Reference: https://github.com/Unity-Technologi...Executable.md#using-an-environment-executable

    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.