Skip to content

Commit 1bdf8be

Browse files
Documentation Update (Unity-Technologies#1339)
* Documentation Update * addressed comments * new images for the recorder * Improvements to the docs * Address the comments * Core_ML typo * Updated the links to inference repo * Put back Inference-Engine.md * fix typos : brain * Readd deleted file * fix typos * Addressed comments
1 parent 86b0e34 commit 1bdf8be

20 files changed

+124
-72
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ developer communities.
3838
* For more information, in addition to installation and usage instructions, see
3939
our [documentation home](docs/Readme.md).
4040
* If you are a researcher interested in a discussion of Unity as an AI platform, see a pre-print of our [reference paper on Unity and the ML-Agents Toolkit](https://arxiv.org/abs/1809.02627). Also, see below for instructions on citing this paper.
41-
* If you have used a version of the ML-Agents toolkit prior to v0.6, we strongly
41+
* If you have used an earlier version of the ML-Agents toolkit, we strongly
4242
recommend our [guide on migrating from earlier versions](docs/Migrating.md).
4343

4444
## Additional Resources

docs/Basic-Guide.md

+41-15
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ the basic concepts of Unity.
1010

1111
## Setting up the ML-Agents Toolkit within Unity
1212

13-
In order to use the ML-Agents toolkit within Unity, you need to change some
14-
Unity settings first. You will also need to have appropriate inference backends
15-
installed in order to run your models inside of Unity. See [here](Inference-Engine.md)
16-
for more information.
13+
In order to use the ML-Agents toolkit within Unity, you first need to change a few
14+
Unity settings.
1715

1816
1. Launch Unity
1917
2. On the Projects dialog, choose the **Open** option at the top of the window.
@@ -22,26 +20,43 @@ for more information.
2220
4. Go to **Edit** > **Project Settings** > **Player**
2321
5. For **each** of the platforms you target (**PC, Mac and Linux Standalone**,
2422
**iOS** or **Android**):
25-
1. Option the **Other Settings** section.
23+
1. Expand the **Other Settings** section.
2624
2. Select **Scripting Runtime Version** to **Experimental (.NET 4.6
2725
Equivalent or .NET 4.x Equivalent)**
2826
6. Go to **File** > **Save Project**
2927

28+
## Setting up the Inference Engine
29+
30+
We provide pre-trained models for all the agents in all our demo environments.
31+
To be able to run those models, you'll first need to set-up the Inference
32+
Engine. The Inference Engine is a general API to
33+
run neural network models in Unity that leverages existing inference libraries such
34+
as TensorFlowSharp and Apple's Core ML. Since the ML-Agents Toolkit uses TensorFlow
35+
for training neural network models, the output model format is TensorFlow and
36+
the model files include a `.tf` extension. Consequently, you need to install
37+
the TensorFlowSharp backend to be able to run these models within the Unity
38+
Editor. You can find instructions
39+
on how to install the TensorFlowSharp backend [here](Inference-Engine.md).
40+
Once the backend is installed, you will need to reimport the models : Right click
41+
on the `.tf` model and select `Reimport`.
42+
43+
3044
## Running a Pre-trained Model
3145

3246
1. In the **Project** window, go to `Assets/ML-Agents/Examples/3DBall/Scenes` folder
3347
and open the `3DBall` scene file.
3448
2. In the **Project** window, go to `Assets/ML-Agents/Examples/3DBall/Prefabs` folder
3549
and select the `Game/Platform` prefab.
36-
3. In the `Ball 3D Agent` Component: Drag the **3DBallLearning** located into
50+
3. In the `Ball 3D Agent` Component: Drag the **3DBallLearning** Brain located in
3751
`Assets/ML-Agents/Examples/3DBall/Brains` into the `Brain` property of
3852
the `Ball 3D Agent`.
3953
4. Make sure that all of the Agents in the Scene now have **3DBallLearning** as `Brain`.
40-
__Note__ : You can modify multiple game objects in a scene by selecting them all at once using the search bar in the Scene Hierarchy.
54+
__Note__ : You can modify multiple game objects in a scene by selecting them all at
55+
once using the search bar in the Scene Hierarchy.
4156
5. In the **Project** window, locate the `Assets/ML-Agents/Examples/3DBall/TFModels`
4257
folder.
43-
6. Drag the `3DBall` model file from the `Assets/ML-Agents/Examples/3DBall/TFModels`
44-
folder to the **Model** field of the **3DBallLearning**.
58+
6. Drag the `3DBallLearning` model file from the `Assets/ML-Agents/Examples/3DBall/TFModels`
59+
folder to the **Model** field of the **3DBallLearning** Brain.
4560
7. Click the **Play** button and you will see the platforms balance the balls
4661
using the pretrained model.
4762

@@ -63,15 +78,26 @@ More information and documentation is provided in the
6378

6479
### Adding a Brain to the training session
6580

66-
Since we are going to build this environment to conduct training, we need to add
67-
the Brain to the training session. This allows the Agents linked to that Brain
68-
to communicate with the external training process when making their decisions.
69-
70-
1. Assign the **3DBallLearning** to the agents you would like to train and the **3DBallPlayer** Brain to the agents you want to control manually.
71-
__Note:__ You can only perform training with an `Learning Brain`.
81+
To set up the environment for training, you will need to specify which agents are contributing
82+
to the training and which Brain is being trained. You can only perform training with
83+
a `Learning Brain`.
84+
85+
1. Assign the **3DBallLearning** Brain to the agents you would like to train.
86+
__Note:__ You can assign the same Brain to multiple agents at once : To do so, you can
87+
use the prefab system. When an agent is created from a prefab, modifying the prefab
88+
will modify the agent as well. If the agent does not synchronize with the prefab, you
89+
can hit the Revert button on top of the Inspector.
90+
Alternatively, you can select multiple agents in the scene and modify their `Brain`
91+
property all at once.
7292
2. Select the **Ball3DAcademy** GameObject and make sure the **3DBallLearning** Brain
7393
is in the Broadcast Hub. In order to train, you need to toggle the
7494
`Control` checkbox.
95+
96+
__Note:__ Assigning a Brain to an agent (dragging a Brain into the `Brain` property of
97+
the agent) means that the Brain will be making decision for that agent. Whereas dragging
98+
a Brain into the Broadcast Hub means that the Brain will be exposed to the Python process.
99+
The `Control` checkbox means that in addition to being exposed to Python, the Brain will
100+
be controlled by the Python process (required for training).
75101

76102
![Set Brain to External](images/mlagents-SetBrainToTrain.png)
77103

docs/FAQ.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Unity](Installation.md#setting-up-ml-agent-within-unity) for solution.
1515

1616
## Cannot drag Model into Learning Brain
1717

18-
You migh not have the appropriate backend required to import the model. Refer to the
18+
You might not have the appropriate backend required to import the model. Refer to the
1919
[Inference Engine](Inference-Engine.md) for more information on how to import backends
2020
and reimport the asset.
2121

docs/Getting-Started-with-Balance-Ball.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ to speed up training since all twelve agents contribute to training in parallel.
5353
The Academy object for the scene is placed on the Ball3DAcademy GameObject. When
5454
you look at an Academy component in the inspector, you can see several
5555
properties that control how the environment works.
56-
The **Broadcast Hub** keeps track of which brains will send data during training,
57-
If a brain is added to the hub, his data will be sent to the external training
56+
The **Broadcast Hub** keeps track of which Brains will send data during training,
57+
If a Brain is added to the hub, his data will be sent to the external training
5858
process. If the `Control` checkbox is checked, the training process will be able to
59-
control the agents linked to the brain to train them.
59+
control the agents linked to the Brain to train them.
6060
The **Training** and **Inference Configuration** properties
6161
set the graphics and timescale properties for the Unity application.
6262
The Academy uses the **Training Configuration** during training and the
@@ -89,16 +89,16 @@ environment around the Agents.
8989
### Brain
9090

9191
Brains are assets that exist in your project folder. The Ball3DAgents are connected
92-
to a brain, for example : the **3DBallLearning**.
92+
to a Brain, for example : the **3DBallLearning**.
9393
A Brain doesn't store any information about an Agent, it just
9494
routes the Agent's collected observations to the decision making process and
9595
returns the chosen action to the Agent. Thus, all Agents can share the same
9696
Brain, but act independently. The Brain settings tell you quite a bit about how
9797
an Agent works.
9898

99-
You can create brain objects by selecting `Assets ->
100-
Create -> ML-Agents -> Brain`. There are 3 kinds of brains :
101-
The **Learning Brain** is a brain that uses a Neural Network to take decisions.
99+
You can create Brain objects by selecting `Assets ->
100+
Create -> ML-Agents -> Brain`. There are 3 kinds of Brains :
101+
The **Learning Brain** is a Brain that uses a Neural Network to take decisions.
102102
When the Brain is checked as `Control` in the Academy **Broadcast Hub**, the
103103
external process will be taking decisions for the agents
104104
and generate a neural network when the training is over. You can also use the
@@ -225,7 +225,7 @@ environment first.
225225
The `--train` flag tells the ML-Agents toolkit to run in training mode.
226226

227227
**Note**: You can train using an executable rather than the Editor. To do so,
228-
follow the intructions in
228+
follow the instructions in
229229
[Using an Executable](Learning-Environment-Executable.md).
230230

231231
### Observing Training Progress

docs/Learning-Environment-Best-Practices.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## General
44

55
* It is often helpful to start with the simplest version of the problem, to
6-
ensure the agent can learn it. From there increase complexity over time. This
6+
ensure the agent can learn it. From there, increase complexity over time. This
77
can either be done manually, or via Curriculum Learning, where a set of
88
lessons which progressively increase in difficulty are presented to the agent
99
([learn more here](Training-Curriculum-Learning.md)).

docs/Learning-Environment-Create-New.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ in the Inspector window.
158158
## Add Brains
159159

160160
The Brain object encapsulates the decision making process. An Agent sends its
161-
observations to its Brain and expects a decision in return. The type of the brain
161+
observations to its Brain and expects a decision in return. The type of the Brain
162162
(Learning, Heuristic or player) determines how the Brain makes decisions.
163163
To create the Brain:
164164

165-
1. Go to `Assets -> Create -> ML-Agents` and select the type of brain you want to
165+
1. Go to `Assets -> Create -> ML-Agents` and select the type of Brain you want to
166166
create. In this tutorial, we will create a **Learning Brain** and
167167
a **Player Brain**.
168168
2. Name them `RollerBallBrain` and `RollerBallPlayer` respectively.
@@ -467,7 +467,7 @@ Brain asset to the Agent, changing some of the Agent Components properties, and
467467
setting the Brain properties so that they are compatible with our Agent code.
468468

469469
1. In the Academy Inspector, add the `RollerBallBrain` and `RollerBallPlayer`
470-
brains to the **Broadcast Hub**.
470+
Brains to the **Broadcast Hub**.
471471
2. Select the RollerAgent GameObject to show its properties in the Inspector
472472
window.
473473
3. Drag the Brain `RollerBallPlayer` from the Project window to the
@@ -479,7 +479,7 @@ setting the Brain properties so that they are compatible with our Agent code.
479479
Also, drag the Target GameObject from the Hierarchy window to the RollerAgent
480480
Target field.
481481

482-
Finally, select the the `RollerBallBrain` and `RollerBallPlayer` brains assets
482+
Finally, select the the `RollerBallBrain` and `RollerBallPlayer` Brain assets
483483
so that you can edit their properties in the Inspector window. Set the following
484484
properties on both of them:
485485

@@ -492,16 +492,16 @@ Now you are ready to test the environment before training.
492492
## Testing the Environment
493493

494494
It is always a good idea to test your environment manually before embarking on
495-
an extended training run. The reason we have created the `RollerBallPlayer` brain
495+
an extended training run. The reason we have created the `RollerBallPlayer` Brain
496496
is so that we can control the Agent using direct keyboard
497497
control. But first, you need to define the keyboard to action mapping. Although
498498
the RollerAgent only has an `Action Size` of two, we will use one key to specify
499499
positive values and one to specify negative values for each action, for a total
500500
of four keys.
501501

502-
1. Select the `RollerBallPlayer` brain to view its properties in the Inspector.
502+
1. Select the `RollerBallPlayer` Brain to view its properties in the Inspector.
503503
2. Expand the **Continuous Player Actions** dictionary (only visible when using
504-
a player brain).
504+
a **PlayerBrain**).
505505
3. Set **Size** to 4.
506506
4. Set the following mappings:
507507

docs/Learning-Environment-Design-Academy.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ logic for creating them in the `AcademyStep()` function.
5050
## Academy Properties
5151

5252
![Academy Inspector](images/academy.png)
53-
* `Broadcast Hub` - Gathers the brains that will communicate with the external
54-
process. Any brain added to the Broadcast Hub will be visible from the external
55-
process. In addition, if the checkbox `Control` is checked, the brain will be
53+
* `Broadcast Hub` - Gathers the Brains that will communicate with the external
54+
process. Any Brain added to the Broadcast Hub will be visible from the external
55+
process. In addition, if the checkbox `Control` is checked, the Brain will be
5656
controllable from the external process and will thus be trainable.
5757
* `Max Steps` - Total number of steps per-episode. `0` corresponds to episodes
5858
without a maximum number of steps. Once the step counter reaches maximum, the

docs/Learning-Environment-Design-Agents.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The Brain class abstracts out the decision making logic from the Agent itself so
1919
that you can use the same Brain in multiple Agents. How a Brain makes its
2020
decisions depends on the kind of Brain it is. A Player Brain allows you
2121
to directly control the agent. A Heuristic Brain allows you to create a
22-
decision script to control the agent with a set of rules. These two brains
22+
decision script to control the agent with a set of rules. These two Brains
2323
do not involve neural networks but they can be useful for debugging. The
2424
Learning Brain allows you to train and use neural network models for
2525
your Agents. See [Brains](Learning-Environment-Design-Brains.md).

docs/Learning-Environment-Design-Brains.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ assigned a Brain, but you can use the same Brain with more than one Agent. You
55
can also create several Brains, attach each of the Brain to one or more than one
66
Agent.
77

8-
There are 3 kinds of brains you can use:
8+
There are 3 kinds of Brains you can use:
99

10-
* [Learning](Learning-Environment-Learning-Brains.md) – Use a
10+
* [Learning](Learning-Environment-Design-Learning-Brains.md) – Use a
1111
**LearningBrain** to make use of a trained model or train a new model.
1212
* [Heuristic](Learning-Environment-Design-Heuristic-Brains.md) – Use a
1313
**HeuristicBrain** to hand-code the Agent's logic by extending the Decision class.
@@ -55,7 +55,7 @@ to a Brain component:
5555
* `Action Descriptions` - A list of strings used to name the available
5656
actions for the Brain.
5757

58-
The other properties of the brain depend on the type of Brain you are using.
58+
The other properties of the Brain depend on the type of Brain you are using.
5959

6060
## Using the Broadcast Feature
6161

docs/Learning-Environment-Design.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ information.
7272

7373
To train and use the ML-Agents toolkit in a Unity scene, the scene must contain
7474
a single Academy subclass and as many Agent subclasses
75-
as you need. The brain assets are present in the project and should be grouped
75+
as you need. The Brain assets are present in the project and should be grouped
7676
together and named according to the type of agents they are compatible with.
7777
Agent instances should be attached to the GameObject representing that Agent.
7878

@@ -114,18 +114,18 @@ the Academy properties and their uses.
114114

115115
The Brain encapsulates the decision making process. Every Agent must be
116116
assigned a Brain, but you can use the same Brain with more than one Agent.
117-
__Note__:You can assign the same brain to multiple agents by using prefabs
118-
or by selecting all the agents you want to attach the brain to using the
117+
__Note__:You can assign the same Brain to multiple agents by using prefabs
118+
or by selecting all the agents you want to attach the Brain to using the
119119
search bar on top of the Scene Hierarchy window.
120120

121121
To Create a Brain, go to `Assets -> Create -> Ml-Agents` and select the
122-
type of brain you want to use. During training, use a **Learning Brain**
122+
type of Brain you want to use. During training, use a **Learning Brain**
123123
and drag it into the Academy's `Broadcast Hub` with the `Control` checkbox checked.
124124
When you want to use the trained model, import the model file into the Unity
125125
project, add it to the **Model** property of the **Learning Brain** and uncheck
126126
the `Control` checkbox of the `Broadcast Hub`. See
127127
[Brains](Learning-Environment-Design-Brains.md) for details on using the
128-
different types of Brains. You can create new kinds of brains if the three
128+
different types of Brains. You can create new kinds of Brains if the three
129129
built-in don't do what you need.
130130

131131
The Brain class has several important properties that you can set using the

docs/Learning-Environment-Examples.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ If you would like to contribute environments, please see our
115115

116116
* Set-up: A platforming environment where the agent can push a block around.
117117
* Goal: The agent must push the block to the goal.
118-
* Agents: The environment contains one agent linked to a single brain.
118+
* Agents: The environment contains one agent linked to a single Brain.
119119
* Agent Reward Function:
120120
* -0.0025 for every step.
121121
* +1.0 if the block touches the goal.
122-
* Brains: One brain with the following observation/action space.
122+
* Brains: One Brain with the following observation/action space.
123123
* Vector Observation space: (Continuous) 70 variables corresponding to 14
124124
ray-casts each detecting one of three possible objects (wall, goal, or
125125
block).
@@ -161,7 +161,7 @@ If you would like to contribute environments, please see our
161161
![Reacher](images/reacher.png)
162162

163163
* Set-up: Double-jointed arm which can move to target locations.
164-
* Goal: The agents must move it's hand to the goal location, and keep it there.
164+
* Goal: The agents must move its hand to the goal location, and keep it there.
165165
* Agents: The environment contains 10 agent linked to a single Brain.
166166
* Agent Reward Function (independent):
167167
* +0.1 Each step agent's hand is in goal location.

docs/Learning-Environment-Executable.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ environment:
2828
![3DBall Scene](images/mlagents-Open3DBall.png)
2929

3030
Make sure the Brains in the scene have the right type. For example, if you want
31-
to be able to control your agents from Python, you will need to put the brain
31+
to be able to control your agents from Python, you will need to put the Brain
3232
controlling the Agents to be a **Learning Brain** and drag it into the
3333
Academy's `Broadcast Hub` with the `Control` checkbox checked.
3434

docs/ML-Agents-Overview.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ inference can proceed.
224224

225225
As mentioned previously, the ML-Agents toolkit ships with several
226226
implementations of state-of-the-art algorithms for training intelligent agents.
227-
In this mode, the only brain used is a **Learning Brain**. More
227+
In this mode, the only Brain used is a **Learning Brain**. More
228228
specifically, during training, all the medics in the
229229
scene send their observations to the Python API through the External
230230
Communicator (this is the behavior with an External Brain). The Python API
@@ -409,7 +409,7 @@ training process.
409409
observations for all its Agents to the Python API when dragged into the
410410
Academy's `Broadcast Hub` with the `Control` checkbox checked. This is helpful
411411
for training and later inference. Broadcasting is a feature which can be
412-
enabled all types of brains (Player, Learning, Heuristic) where the Agent
412+
enabled all types of Brains (Player, Learning, Heuristic) where the Agent
413413
observations and actions are also sent to the Python API (despite the fact
414414
that the Agent is **not** controlled by the Python API). This feature is
415415
leveraged by Imitation Learning, where the observations and actions for a

0 commit comments

Comments
 (0)