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.

Question Multiple Agents with Different Behaviors

Discussion in 'ML-Agents' started by ilaydanil, Jun 7, 2020.

  1. ilaydanil

    ilaydanil

    Joined:
    May 17, 2020
    Posts:
    20
    I have problem with training multiple agnets at the same time. 4 agents have discrete behavior and 1 agent have continuous behavior. Is it possible to train multiple agents with different behaviors?
     
  2. andrewcoh_unity

    andrewcoh_unity

    Unity Technologies

    Joined:
    Sep 5, 2019
    Posts:
    162
    Yes. You can train them all simultaneously and if this seems to be unstable you can try using asymmetric self-play.
     
  3. HanAusBerlin

    HanAusBerlin

    Joined:
    Sep 13, 2017
    Posts:
    76
    How can I train simultaneously? E.g. I have an agent A that gets rewarded if it finds food and an Agent B that gets rewarded for "eating" (colliding) Agent A. Scripts are set up, but how do I set up the yaml file and start the learning process (I know how to do it when training only one agent type). Or is this a task for the teams option of ml agents?
     
  4. mbaske

    mbaske

    Joined:
    Dec 31, 2017
    Posts:
    473
    Depends on wether your two agents need different policies. If they do, you would just give them distinct behaviour names and add another section with the config params for the second behaviour to the yaml file. Then start training as usual. Models for both policies will be created and named in the form of RunID_BehaviourA, RunID_BehaviourB. Otherwise, you would use self-play if observations, actions and rewards are identical for agents A and B.
     
    fraa1197 and LohQ like this.
  5. HanAusBerlin

    HanAusBerlin

    Joined:
    Sep 13, 2017
    Posts:
    76
    Cool, that sounds pretty easy. Will try that right away. Thanks!