Search Unity

Resolved Mask Action

Discussion in 'ML-Agents' started by mateolopezareal, Jun 5, 2020.

  1. mateolopezareal

    mateolopezareal

    Joined:
    Jun 4, 2020
    Posts:
    54
    I am training a 2D project, and looking around I found the Grid world example that in Vector Action space, the action masking is turned on by default and it says: this option can be toggled using the Mask Actions checkbox within the trueAgent GameObject, the trained model file provided was generated with action masking turned on.
    What does this mean, what is this the mask action thing? Has something to do with the visual observations?
     
  2. MrWetsnow

    MrWetsnow

    Joined:
    Jan 5, 2020
    Posts:
    60
    Take a look here: https://docs.unity3d.com/Packages/com.unity.ml-agents@1.0/api/Unity.MLAgents.Agent.html

    Let's say your typical actions are: 1, 2, 3, 4. At every decision you can mask some of them. That is, prevent them from being used. So if I mask 2, then the only options the system will pick from are 1, 3, and 4. This is useful, for example, if your character is standing next to a wall, and action 2 would make them try and move into the wall.
     
  3. mateolopezareal

    mateolopezareal

    Joined:
    Jun 4, 2020
    Posts:
    54
    Thanks.
    And is it better to use this, or let the agent learn that if he is in front of a wall he should not move into the wall?

     
  4. MrWetsnow

    MrWetsnow

    Joined:
    Jan 5, 2020
    Posts:
    60
    I don't know, perhaps someone else can confirm that. I imagine that at the very least your training will go faster.