Search Unity

Resolved Brain update() control?

Discussion in 'ML-Agents' started by Sab_Rango, Jan 22, 2021.

  1. Sab_Rango

    Sab_Rango

    Joined:
    Aug 30, 2019
    Posts:
    121
    Hey!
    I am trying to control ML agents update without touching UNITY's step time and fixed time.

    My main aim is to train physics character agent in a very extremely high resolution physics.
    So I want to simulate 1sec real-time physics in about 30sec.
    And then give observations() and get the outputs() of the brain every 30sec/60 , not every update.

    Should I call the observations() and get outputs() every 30/60 second in order to control python ml_agent brain update() ?
     
  2. Luke-Houlihan

    Luke-Houlihan

    Joined:
    Jun 26, 2007
    Posts:
    303
    Sab_Rango likes this.
  3. celion_unity

    celion_unity

    Joined:
    Jun 12, 2019
    Posts:
    289
    If you want full control over the stepping, then disabling automatic stepping and manually calling Academy.Instance.EnvironmentStep() is the best way to do this. You should call Agent.RequestDecision() on all Agents that you want to step, then call Academy.Instance.EnvironmentStep().

    You do not need to do anything else to provide the observations (the Agent's CollectObservations method will be called, along with any ISensors), and the actions will be applied in your OnActionReceived() method.
     
    Sab_Rango likes this.
  4. Sab_Rango

    Sab_Rango

    Joined:
    Aug 30, 2019
    Posts:
    121
    Thanks @everyone!!!