|
|
|
|
|
|
|
|
|
|
### Academy |
|
|
|
|
|
|
|
The Academy object for the scene is placed on the Ball3DAcademy GameObject. When |
|
|
|
you look at an Academy component in the inspector, you can see several |
|
|
|
properties that control how the environment works. |
|
|
|
The **Training Configuration** and **Inference Configuration** properties |
|
|
|
set the graphics and timescale properties for the Unity application. |
|
|
|
The Academy uses the **Training Configuration** during training and the |
|
|
|
**Inference Configuration** when not training. (*Inference* means that the |
|
|
|
Agent is using a trained model or heuristics or direct control — in other |
|
|
|
words, whenever **not** training.) |
|
|
|
Typically, you would set a low graphics quality and timescale to greater `1.0` for the **Training |
|
|
|
Configuration** and a high graphics quality and timescale to `1.0` for the |
|
|
|
**Inference Configuration** . |
|
|
|
|
|
|
|
**Note:** if you want to observe the environment during training, you can adjust |
|
|
|
the **Training Configuration** settings to use a larger window and a timescale |
|
|
|
closer to 1:1. Be sure to set these parameters back when training in earnest; |
|
|
|
otherwise, training can take a very long time. |
|
|
|
|
|
|
|
Another aspect of an environment is the Academy implementation. Since |
|
|
|
The Academy object for the scene is placed on the Ball3DAcademy GameObject. Since |
|
|
|
the base Academy class is abstract, you must always define a subclass. There are |
|
|
|
three functions you can implement, though they are all optional: |
|
|
|
|
|
|
|
|
|
|
To summarize, go to your command line, enter the `ml-agents` directory and type: |
|
|
|
|
|
|
|
```sh |
|
|
|
mlagents-learn config/trainer_config.yaml --run-id=<run-identifier> --train |
|
|
|
mlagents-learn config/trainer_config.yaml --run-id=<run-identifier> --train --time-scale=100 |
|
|
|
``` |
|
|
|
|
|
|
|
When the message _"Start training by pressing the Play button in the Unity |
|
|
|
|
|
|
environment first. |
|
|
|
|
|
|
|
The `--train` flag tells the ML-Agents toolkit to run in training mode. |
|
|
|
The `--time-scale=100` sets the `Time.TimeScale` value in Unity. |
|
|
|
|
|
|
|
**Note**: You can train using an executable rather than the Editor. To do so, |
|
|
|
follow the instructions in |
|
|
|