Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Can the timescale be used for an training acceleration?

Discussion in 'ML-Agents' started by autoli, Jun 24, 2020.

  1. autoli

    autoli

    Joined:
    May 25, 2020
    Posts:
    9
    Can the mlagent be trained correctly when I change the timescale in Unity for an acceleration? Because I use the ML to 2D game which contains too much trigger and initialization by scripts. As a layman, it's hard for me to modify the scripts to use multiple training areas within the same scene or launch scenes asynchronously by dragging. So it trains slowly and I try for increasing timescale that really makes the game speed up. it seems that I have to change the decision request period. I don't know clearly whether this method can work! Maybe I have to change some setting about the ML or there exsits other methods for this situation.
     
  2. ervteng_unity

    ervteng_unity

    Unity Technologies

    Joined:
    Dec 6, 2018
    Posts:
    150
    Increasing timescale generally does speed up training - this is what we do with our example environments. A warning, though - if your game uses physics/collisions, increasing timescale increases the time between physics updates/collision checks, so you may get undesired behavior (e.g. stuff tunnelling through walls) if you increase it too much.

    Since your game seems fairly lightweight, another way to speed it up could be compiling it as a build and using
    ---num-envs=X
    to run multiple games at once. This is equivalent to having multiple training areas in one scene from the RL perspective.