Search Unity

Question Setting Observation space at runtime

Discussion in 'ML-Agents' started by seboz123, Sep 26, 2020.

  1. seboz123

    seboz123

    Joined:
    Mar 7, 2020
    Posts:
    24
    Hello,

    I am creating a maze environment and want to create an array of visited cells which serve as an vector input for the agent. As I want to be able to modify the maze size at runtime, I need a way to change the obeservation size at runtime.
    I tried something like:
    Code (CSharp):
    1. GetComponent<BehaviorParameters>().BrainParameters.VectorObservationSize += maze_rows * maze_cols;
    but I still get the Error that more observations have been made than the observation size.
    Any ideas?
     
  2. ruoping_unity

    ruoping_unity

    Unity Technologies

    Joined:
    Jul 10, 2020
    Posts:
    134
    Currently changing observation size at run time is not supported. In your case you could probably try sending observation with a fixed size of the size of your maze and change the state of each cell in the maze representation.

    If you have a specific case that requires changing the observation size during run time, you can make a feature request on ML-Agents GitHub page.
     
  3. seboz123

    seboz123

    Joined:
    Mar 7, 2020
    Posts:
    24
    Thanks I will use that for now!