Search Unity

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

Modify / Use custom learning algorithm

Discussion in 'ML-Agents' started by evan-duf, Oct 19, 2020.

  1. evan-duf

    evan-duf

    Joined:
    Oct 12, 2020
    Posts:
    4
    Hi all,

    I've chosen to work with ml-agents as part a master project on reinforcement learning. However I would need to manually program my learning algorithm instead of using already implemented PPO and SAC. My work involves the study of a multi-agent game, so gym-wrapper isn't compatible.

    I'm thus currently looking at the Low API documentation, can you confirm it's the most straightforward way to achieve my goal ?
    Also from the documentation I'm not sure to understand where I should compile my game to make it accessible through :
    """
    from mlagents_envs.environment import UnityEnvironment
    env = UnityEnvironment(file_name=<env_name>)
    """

    I'm using Release 8

    Thank you for your help
     
    ademord likes this.
  2. vincentpierre

    vincentpierre

    Joined:
    May 5, 2017
    Posts:
    160
    Hi,

    If you are trying to use the Low level API, I would be very happy to have your feedback on it. We know there is room for improvements.

    If you want to train within the Unity Editor, you can do
    ```
    env = UnityEnvironment()
    ```
    and press play in the Editor to start interacting.

    If you want to use an executable, you will first need to build it : https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Learning-Environment-Executable.md
    This should create an executable, the path to this executable is the argument <env_name>. The executable file can be where-ever you want on your machine, but it must have correct permissions.

    Alternatively, if you only need one of our environments, you can use them through the registry. There are some colab tutorials a=on how to use it here :
    https://github.com/Unity-Technologies/ml-agents/tree/master/docs#python-tutorial-with-google-colab

    The concept of terminal steps and decision steps might be confusing at first, but there are some posts and issues on the forum and github that can help like this one : https://forum.unity.com/threads/regarding-env-get_steps-behavior_name.988298/
     
  3. evan-duf

    evan-duf

    Joined:
    Oct 12, 2020
    Posts:
    4
    Thank you for your quick reply ! The google colabs are just what I needed to really get started. I'll take the time to make a feedback
     
    ademord likes this.