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.

Question Smoother Continuous Actions

Discussion in 'ML-Agents' started by NanushTol, Dec 24, 2022.

  1. NanushTol

    NanushTol

    Joined:
    Jan 9, 2018
    Posts:
    92
    I have trained a hovercraft driver with curriculum learning, it flies really well, but its a bit jittery and twitchy,
    is there a "Best Practice" way of training it to output smoother actions?

    was thinking of stacking the previous actions as observations and rewarding for "smoothness".
    or should I just use a PID on the actions to smooth them?
    if so should I train the agent with the PID or add it later only for inference?

    any suggestions will be welcome!
     
  2. hughperkins

    hughperkins

    Joined:
    Dec 3, 2022
    Posts:
    175
  3. NanushTol

    NanushTol

    Joined:
    Jan 9, 2018
    Posts:
    92
    Thanks!
     
  4. NanushTol

    NanushTol

    Joined:
    Jan 9, 2018
    Posts:
    92
    for anyone in the future looking for a solution.
    I've ended up using ppo with a custom gaussian smoothing filter, that I apply after training when the model is running in game, works great for now :)
     
    hughperkins likes this.
  5. hughperkins

    hughperkins

    Joined:
    Dec 3, 2022
    Posts:
    175
    Great info. Thank you for sharing!
     
  6. afhorne

    afhorne

    Joined:
    May 3, 2021
    Posts:
    5
    Hi, I am only familiar with Gaussian smoothing of images, where all values are already known, since we have the entire picture. May I ask how you smooth when you only have the past actions, but don't know yet what the future actions will be? Thanks for your help!
     
  7. NanushTol

    NanushTol

    Joined:
    Jan 9, 2018
    Posts:
    92
    I record the inputs, and sample the middle point after smoothing, I have a variable to control how many samples to record and where to sample
     
    afhorne likes this.