Modify / Use custom learning algorithm

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

1 Like

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 : ml-agents/docs/Learning-Environment-Executable.md at main · Unity-Technologies/ml-agents · GitHub
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 :

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 : Regarding env.get_steps(behavior_name)

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

1 Like