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.
  2. Dismiss Notice

Delaying episode

Discussion in 'ML-Agents' started by Jin-Park, Jun 23, 2021.

  1. Jin-Park

    Jin-Park

    Joined:
    Jun 18, 2014
    Posts:
    20
    Hi, I made a humanoid animation simulator with ml-agents using ArticulationBody.
    When I reset the ArticulationBody component, it takes time to become the initial pose.
    The episode is beginning automatically and the CollectObservations function is called before the initialization, so I had to give a random array. I guess it is affecting my training badly.
    How can I delay the beginning of the episode until the initialization process is done?
     
  2. ervteng_unity

    ervteng_unity

    Unity Technologies

    Joined:
    Dec 6, 2018
    Posts:
    150
    Where are you running your initialization code? If it is in OnEpisodeBegin, it should be called before the first CollectObservations of that episode.

    You can also try disabling/enabling the DecisionRequestor component, which should stop observations from being collected.
     
  3. Jin-Park

    Jin-Park

    Joined:
    Jun 18, 2014
    Posts:
    20
    Yes, I start initializing in OnEpisodeBegin, but the initialization is finishing after the first CollectObservations. I'll try disabling the DecisionRequestor in OnEpisodeBegin and enable after the initialization.
    Thanks a lot!
     
  4. Jin-Park

    Jin-Park

    Joined:
    Jun 18, 2014
    Posts:
    20
    @ervteng_unity I did a quick test, but it doesn't prevent calling CollectObservations()... I even tried disabling it in Initialize(), but the CollectObeservations() is called immediately after the OnEpisodeBegin(). Do you have any idea why is it keep calling?
     
  5. Jin-Park

    Jin-Park

    Joined:
    Jun 18, 2014
    Posts:
    20
    Is there anybody having the same issue?
     
  6. Jin-Park

    Jin-Park

    Joined:
    Jun 18, 2014
    Posts:
    20
    Never mind, I found out how to request a decision manually without a decision requester.