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.

Resolved On masking actions

Discussion in 'ML-Agents' started by Rany_AN, May 26, 2021.

  1. Rany_AN

    Rany_AN

    Joined:
    Apr 24, 2021
    Posts:
    33
    Is it better to mask an action to prevent an agent from doing it or teach it not do it through negative rewards?
     
  2. vincentpierre

    vincentpierre

    Unity Technologies

    Joined:
    May 5, 2017
    Posts:
    160
    I usually depends on the situation. Sometimes a move is just impossible (for example in a match 3 environment). Attempting a wrong move will bring the agent back to the same state again at it will usually try the same wrong move again (since it is starting from the same state). In this case, I recommend masking that action.
    Using penalties is tricky because the agent might become too scared to use the move after some training, so you will need to find the "ideal" penalty amount. Penalties are useful in locomotion tasks for example, because they introduce energy constraints and can force the agent "not to move too much".
     
    Rany_AN likes this.
  3. Rany_AN

    Rany_AN

    Joined:
    Apr 24, 2021
    Posts:
    33