This is a 5th semester Computer Science project about machine intelligence.
This project was built using ML-Agents and Unity.
-
Install python 3.6.8
-
Install the mlagents package:
pip install mlagents=0.11.0
-
Update the setuptools package:
pip install -U setuptools
We have provided builds that work with our python implementation of SARSA.
To change environment and agent settings or make your own build:
- Install Unity 2019.2.11f1
- Use it to open the P5/ml-agents-0.11.0/UnitySDK folder
- Inside Unity, use the Project window to open a scene file in Assets/P5 (preferably 1x3.scene)
- From here you can run the scene or make a new build
SARSA
To run the project using our python implementation of SARSA:
-
Open a terminal and navigate to P5/ml-agents-0.11.0/project/
-
python Main.py -n [path to build]
PPO
To run the project using ml-agents' implementation of PPO:
-
Open a terminal and navigate to P5/ml-agents-0.11.0/
-
mlagents-learn config.yaml --env=[path to build] --run-id=test --train
Running with the Editor
It is possible to run the training in the Unity Editor instead of a build.
If no build is specified, python will print: Start training by pressing the Play button in the Unity Editor.
If you then press play and the Unity and Python ports match, they will connect and start training.
Our SARSA and Unity's PPO use different ports and amounts of observations.
SARSA configuration
- On the Academy object, set Communicator Port to Our Python Script
- On the Robot object
- On the RobotAgent component, disable Limited Observations
- On the Behavior Parameters component, set Observations to 92
PPO configuration
- On the Academy object, set Communicator Port to Default Training
- On the Robot object
- On the RobotAgent component, enable Limited Observations
- On the Behavior Parameters component, set Observations to 46
python Main.py -help
mlagents-learn with -help