Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Why is 2 added to the number of detectable tags?

Discussion in 'ML-Agents' started by ThinkHims, Apr 20, 2020.

  1. ThinkHims

    ThinkHims

    Joined:
    Oct 27, 2016
    Posts:
    3

    As I'm reading the documentation, in the Learning-Environment-Design-Agents.md file, the total size of the created observations is given by this formula:

    (Observation Stacks) * (1 + 2 * Rays Per Direction) * (Num Detectable Tags + 2)

    May I know why 2 is added to the number of detectable tags?​
     
  2. celion_unity

    celion_unity

    Joined:
    Jun 12, 2019
    Posts:
    289
    There's a better explanation in the code here.

    The other two elements are:
    * Indicating whether or not the ray hit anything (either a known tag or something else).
    * The distance to the hit (if any), normalized to be between 0 and 1.