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

Question Force epsilon to lower values than 0.1

Discussion in 'ML-Agents' started by TulioMMo, Mar 10, 2022.

  1. TulioMMo

    TulioMMo

    Joined:
    Dec 30, 2020
    Posts:
    29
    Last edited: Mar 10, 2022
  2. ChillX

    ChillX

    Joined:
    Jun 16, 2016
    Posts:
    145
    install ML Agents for local Debug / Modification

    https://github.com/Unity-Technologi...advanced-local-installation-for-development-1

    Then edit line 55 of ml-agents/ml-agents/mlagents/trainers/ppo/optimizer_torch.py

    Code (CSharp):
    1.  self.decay_epsilon = ModelUtils.DecayedValue(
    2.             self.hyperparameters.epsilon_schedule,
    3.             self.hyperparameters.epsilon,
    4.            0.1,
    5.             self.trainer_settings.max_steps,
    6.         )
    7.  
    And change the 0.1 to whatever you want

    Next reinstall your now modified ML Agents from the base directory where its installed

    pip3 install -e ./ml-agents-envs
    pip3 install -e ./ml-agents

    Now you have a modified version with epsilon decay set to whatever you want it to be.

    Note: there may be a good reason why Epsilon decay is clamped to 0.1
    This I have no idea but you can always modify it. Test it out and then if it does not work as expected revert the changes in your local copy and reinstall it.
     
    TulioMMo likes this.
  3. TulioMMo

    TulioMMo

    Joined:
    Dec 30, 2020
    Posts:
    29
    Thank you very much for the reply! I'll try it out.