Search Unity

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

SoccerTwos observation shape

Discussion in 'ML-Agents' started by cabesd, Feb 6, 2020.

  1. cabesd

    cabesd

    Joined:
    Feb 4, 2020
    Posts:
    6
    Hi all,
    I have a quick question about SoccerTwos observation shape.
    I'm using MLAgents v12 where the observation shape was 112 (14 raycasts identifying 8 objects). I wonder why the observation shape was setup as [(56,), (56,)] instead of being a straight [(112,)]. I'm sure there's a specific reason but I can't understand why.

    Note that I'm noticing a recent Soccer refactor that I'll dig into soon. My question is about previous version 12 - not 13.

    Thanks in advance!
     
  2. celion_unity

    celion_unity

    Joined:
    Jun 12, 2019
    Posts:
    289
    Hi,
    In 0.12, the soccer agents use two RayPerceptionSensorComponent3D - each of those generates an observation of size 56 (I didn't double check the math but I believe you).

    Previously (0.11.0 and earlier) they used a RayPerception (similar name but different class). This produced observations that that the Agent used directly with AddVectorObs.

    I think (and hopefully you agree) that the sensor approach is easier to use, since you can adjust the parameters on the components without having to make sure that the Agent's observation size adds up correctly.
     
  3. cabesd

    cabesd

    Joined:
    Feb 4, 2020
    Posts:
    6
    That makes sense then!
    The agents for v12 had 2 RayPerception sensors (one of them with a 3D offset) and each sensor is then producing 56 observation data points.
    I see now that for v13 only 1 RayPerception sensor is used, but with a stack of 3 observations.

    Thank you!!