Skip to content

Commit 42a2214

Browse files
Merge pull request #1488 from Unity-Technologies/release-v0.6-doc-jeff
Documentation Updates
2 parents 48a9ca9 + b106e22 commit 42a2214

9 files changed

+64
-59
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ If you run into any problems using the ML-Agents toolkit,
7373
[submit an issue](https://github.com/Unity-Technologies/ml-agents/issues) and
7474
make sure to include as much detail as possible.
7575

76+
Your opinion matters a great deal to us. Only by hearing your thoughts on the Unity ML-Agents Toolkit can we continue to improve and grow. Please take a few minutes to [let us know about it](https://github.com/Unity-Technologies/ml-agents/issues/1454).
77+
7678
For any other questions or feedback, connect directly with the ML-Agents
7779
7880

docs/Background-Unity.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ with the ML-Agents toolkit:
1717
* [Physics](https://docs.unity3d.com/Manual/PhysicsSection.html)
1818
* [Ordering of event functions](https://docs.unity3d.com/Manual/ExecutionOrder.html)
1919
(e.g. FixedUpdate, Update)
20+
* [Prefabs](https://docs.unity3d.com/Manual/Prefabs.html)
21+

docs/Basic-Guide.md

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Basic Guide
22

33
This guide will show you how to use a pre-trained model in an example Unity
4-
environment, and show you how to train the model yourself.
4+
environment (3D Ball) and show you how to train the model yourself.
55

66
If you are not familiar with the [Unity Engine](https://unity3d.com/unity), we
77
highly recommend the [Roll-a-ball
@@ -42,33 +42,42 @@ TensorFlow files in the Project window under **Assets** > **ML-Agents** >
4242
to the `Scripting Define Symbols` for each type of device you want to use
4343
(**`PC, Mac and Linux Standalone`**, **`iOS`** or **`Android`**).
4444

45-
![Project Settings](images/project-settings.png)
45+
![Project Settings](images/project-settings.png)
4646

47-
**Note**: If you don't see anything under **Assets**, drag the
48-
`UnitySDK/Assets/ML-Agents` folder under **Assets** within Project window.
47+
**Note**: If you don't see anything under **Assets**, drag the
48+
`UnitySDK/Assets/ML-Agents` folder under **Assets** within Project window.
4949

50-
![Imported TensorFlowsharp](images/imported-tensorflowsharp.png)
50+
![Imported TensorFlowsharp](images/imported-tensorflowsharp.png)
5151

5252
## Running a Pre-trained Model
53+
We've included pre-trained models for the 3D Ball example.
5354

54-
1. In the **Project** window, go to `Assets/ML-Agents/Examples/3DBall/Scenes` folder
55+
1. In the **Project** window, go to the `Assets/ML-Agents/Examples/3DBall/Scenes` folder
5556
and open the `3DBall` scene file.
56-
2. In the **Project** window, go to `Assets/ML-Agents/Examples/3DBall/Prefabs` folder
57-
and select the `Game/Platform` prefab.
58-
3. In the `Ball 3D Agent` Component: Drag the **3DBallLearning** Brain located in
59-
`Assets/ML-Agents/Examples/3DBall/Brains` into the `Brain` property of
60-
the `Ball 3D Agent`.
61-
4. Make sure that all of the Agents in the Scene now have **3DBallLearning** as `Brain`.
62-
__Note__ : You can modify multiple game objects in a scene by selecting them all at
57+
2. In the **Project** window, go to the `Assets/ML-Agents/Examples/3DBall/Prefabs` folder.
58+
Expand `Game` and click on the `Platform` prefab. You should see the `Platform` prefab in the **Inspector** window.
59+
60+
**Note**: The platforms in the `3DBall` scene were created using the `Platform` prefab. Instead of updating all 12 platforms individually, you can update the `Platform` prefab instead.
61+
62+
![Platform Prefab](images/platform_prefab.png)
63+
64+
3. In the **Project** window, drag the **3DBallLearning** Brain located in
65+
`Assets/ML-Agents/Examples/3DBall/Brains` into the `Brain` property under `Ball 3D Agent (Script)` component in the **Inspector** window.
66+
67+
![3dball learning brain](images/3dball_learning_brain.png)
68+
69+
4. You should notice that each `Platform` under each `Game` in the **Hierarchy** windows now contains **3DBallLearning** as `Brain`. __Note__ : You can modify multiple game objects in a scene by selecting them all at
6370
once using the search bar in the Scene Hierarchy.
64-
5. In the **Project** window, locate the `Assets/ML-Agents/Examples/3DBall/TFModels`
71+
5. In the **Project** window, click on the **3DBallLearning** Brain located in
72+
`Assets/ML-Agents/Examples/3DBall/Brains`. You should see the properties in the **Inspector** window.
73+
6. In the **Project** window, open the `Assets/ML-Agents/Examples/3DBall/TFModels`
6574
folder.
66-
6. Drag the `3DBallLearning` model file from the `Assets/ML-Agents/Examples/3DBall/TFModels`
67-
folder to the **Model** field of the **3DBallLearning** Brain.
68-
7. Click the **Play** button and you will see the platforms balance the balls
75+
7. Drag the `3DBallLearning` model file from the `Assets/ML-Agents/Examples/3DBall/TFModels`
76+
folder to the **Model** field of the **3DBallLearning** Brain in the **Inspector** window. __Note__ : All of the brains should now have `3DBallLearning` as the TensorFlow model in the `Model` property
77+
8. Click the **Play** button and you will see the platforms balance the balls
6978
using the pretrained model.
7079

71-
![Running a pretrained model](images/running-a-pretrained-model.gif)
80+
![Running a pretrained model](images/running-a-pretrained-model.gif)
7281

7382
## Using the Basics Jupyter Notebook
7483

@@ -84,30 +93,26 @@ More information and documentation is provided in the
8493

8594
## Training the Brain with Reinforcement Learning
8695

87-
### Adding a Brain to the training session
96+
### Setting up the enviornment for training
8897

8998
To set up the environment for training, you will need to specify which agents are contributing
9099
to the training and which Brain is being trained. You can only perform training with
91100
a `Learning Brain`.
92101

93-
1. Assign the **3DBallLearning** Brain to the agents you would like to train.
94-
__Note:__ You can assign the same Brain to multiple agents at once : To do so, you can
95-
use the prefab system. When an agent is created from a prefab, modifying the prefab
96-
will modify the agent as well. If the agent does not synchronize with the prefab, you
97-
can hit the Revert button on top of the Inspector.
98-
Alternatively, you can select multiple agents in the scene and modify their `Brain`
99-
property all at once.
100-
2. Select the **Ball3DAcademy** GameObject and make sure the **3DBallLearning** Brain
101-
is in the Broadcast Hub. In order to train, you need to toggle the
102-
`Control` checkbox.
103-
104-
__Note:__ Assigning a Brain to an agent (dragging a Brain into the `Brain` property of
102+
1. Each platform agent needs an assigned `Learning Brain`. In this example, each platform agent was created using a prefab. To update all of the brains in each platform agent at once, you only need to update the platform agent prefab. In the **Project** window, go to the `Assets/ML-Agents/Examples/3DBall/Prefabs` folder. Expand `Game` and click on the `Platform` prefab. You should see the `Platform` prefab in the **Inspector** window. In the **Project** window, drag the **3DBallLearning** Brain located in `Assets/ML-Agents/Examples/3DBall/Brains` into the `Brain` property under `Ball 3D Agent (Script)` component in the **Inspector** window.
103+
104+
**Note**: The Unity prefab system will modify all instances of the agent properties in your scene. If the agent does not synchronize automatically with the prefab, you can hit the Revert button in the top of the **Inspector** window.
105+
106+
2. In the **Hierarchy** window, select `Ball3DAcademy`.
107+
3. In the **Project** window, go to `Assets/ML-Agents/Examples/3DBall/Brains` folder and drag the **3DBallLearning** Brain to the `Brains` property under `Braodcast Hub` in the `Ball3DAcademy` object in the **Inspector** window. In order to train, make sure the `Control` checkbox is selected.
108+
109+
**Note:** Assigning a Brain to an agent (dragging a Brain into the `Brain` property of
105110
the agent) means that the Brain will be making decision for that agent. Whereas dragging
106111
a Brain into the Broadcast Hub means that the Brain will be exposed to the Python process.
107112
The `Control` checkbox means that in addition to being exposed to Python, the Brain will
108113
be controlled by the Python process (required for training).
109114

110-
![Set Brain to External](images/mlagents-SetBrainToTrain.png)
115+
![Set Brain to External](images/mlagents-SetBrainToTrain.png)
111116

112117
### Training the environment
113118

@@ -134,7 +139,7 @@ be controlled by the Python process (required for training).
134139
Editor"_ is displayed on the screen, you can press the :arrow_forward: button
135140
in Unity to start training in the Editor.
136141

137-
**Note**: Alternatively, you can use an executable rather than the Editor to
142+
**Note**: Alternatively, you can use an executable rather than the Editor to
138143
perform training. Please refer to [this
139144
page](Learning-Environment-Executable.md) for instructions on how to build and
140145
use an executable.

docs/FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ There may be a number of possible causes:
7171
_Solution_: Look into the [log
7272
files](https://docs.unity3d.com/Manual/LogFiles.html) generated by the Unity
7373
Environment to figure what error happened.
74-
# _Cause_: You have assigned HTTP_PROXY and HTTPS_PROXY values in your
74+
* _Cause_: You have assigned HTTP_PROXY and HTTPS_PROXY values in your
7575
environment variables. _Solution_: Remove these values and try again.
7676

7777
## Communication port {} still in use

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

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Let's get started!
2828
In order to install and set up the ML-Agents toolkit, the Python dependencies
2929
and Unity, see the [installation instructions](Installation.md).
3030

31-
## Understanding a Unity Environment (3D Balance Ball)
31+
## Understanding the Unity Environment (3D Balance Ball)
3232

3333
An agent is an autonomous actor that observes and interacts with an
3434
_environment_. In the context of Unity, an environment is a scene containing an
@@ -53,26 +53,26 @@ 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, the data from this Brain 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.
60-
The **Training** and **Inference Configuration** properties
59+
control and train the agents linked to the Brain.
60+
The **Training Configuration** 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
6363
**Inference Configuration** when not training. (*Inference* means that the
6464
Agent is using a trained model or heuristics or direct control — in other
6565
words, whenever **not** training.)
66-
Typically, you set low graphics quality and a high time scale for the **Training
67-
configuration** and a high graphics quality and the timescale to `1.0` for the
66+
Typically, you would set a low graphics quality and timescale to greater `1.0` for the **Training
67+
Configuration** and a high graphics quality and timescale to `1.0` for the
6868
**Inference Configuration** .
6969

7070
**Note:** if you want to observe the environment during training, you can adjust
7171
the **Training Configuration** settings to use a larger window and a timescale
7272
closer to 1:1. Be sure to set these parameters back when training in earnest;
7373
otherwise, training can take a very long time.
7474

75-
Another aspect of an environment to look at is the Academy implementation. Since
75+
Another aspect of an environment is the Academy implementation. Since
7676
the base Academy class is abstract, you must always define a subclass. There are
7777
three functions you can implement, though they are all optional:
7878

@@ -88,28 +88,24 @@ environment around the Agents.
8888

8989
### Brain
9090

91-
Brains are assets that exist in your project folder. The Ball3DAgents are connected
92-
to a Brain, for example : the **3DBallLearning**.
93-
A Brain doesn't store any information about an Agent, it just
91+
As of v0.6, a Brain is a Unity asset and exists within the `UnitySDK` folder. These brains (ex. **3DBallLearning.asset**) are loaded into each Agent object (ex. **Ball3DAgents**). A Brain doesn't store any information about an Agent, it just
9492
routes the Agent's collected observations to the decision making process and
95-
returns the chosen action to the Agent. Thus, all Agents can share the same
96-
Brain, but act independently. The Brain settings tell you quite a bit about how
93+
returns the chosen action to the Agent. All Agents can share the same
94+
Brain, but would act independently. The Brain settings tell you quite a bit about how
9795
an Agent works.
9896

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.
102-
When the Brain is checked as `Control` in the Academy **Broadcast Hub**, the
103-
external process will be taking decisions for the agents
104-
and generate a neural network when the training is over. You can also use the
97+
You can create new Brain assets by selecting `Assets ->
98+
Create -> ML-Agents -> Brain`. There are 3 types of Brains.
99+
The **Learning Brain** is a Brain that uses a trained neural network to make decisions.
100+
When the `Control` box is checked in the Brains property under the **Broadcast Hub** in the Academy, the external process that is training the neural network will take over decision making for the agents
101+
and ultimately generate a trained neural network. You can also use the
105102
**Learning Brain** with a pre-trained model.
106-
The **Heuristic** Brain allows you to hand-code the Agent's logic by extending
103+
The **Heuristic** Brain allows you to hand-code the Agent logic by extending
107104
the Decision class.
108105
Finally, the **Player** Brain lets you map keyboard commands to actions, which
109-
can be useful when testing your agents and environment. If none of these types
110-
of Brains do what you need, you can implement your own Brain.
106+
can be useful when testing your agents and environment. You can also implement your own type of Brain.
111107

112-
In this tutorial, you will use a **Learning Brain** for training.
108+
In this tutorial, you will use the **Learning Brain** for training.
113109

114110
#### Vector Observation Space
115111

docs/Glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* **Agent** - Unity Component which produces observations and takes actions in
88
the environment. Agents actions are determined by decisions produced by a
99
linked Brain.
10-
* **Brain** - Unity Component which makes decisions for the agents linked to it.
10+
* **Brain** - Unity Asset which makes decisions for the agents linked to it.
1111
* **Decision** - The specification produced by a Brain for an action to be
1212
carried out given an observation.
1313
* **Editor** - The Unity Editor, which may include any pane (e.g. Hierarchy,

docs/Training-Imitation-Learning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ It is often more intuitive to simply demonstrate the behavior we want an agent
44
to perform, rather than attempting to have it learn via trial-and-error methods.
55
Consider our
66
[running example](ML-Agents-Overview.md#running-example-training-npc-behaviors)
7-
of training a medic NPC : instead of indirectly training a medic with the help
7+
of training a medic NPC. Instead of indirectly training a medic with the help
88
of a reward function, we can give the medic real world examples of observations
99
from the game and actions from a game controller to guide the medic's behavior.
1010
Imitation Learning uses pairs of observations and actions from

docs/images/3dball_learning_brain.png

46.8 KB
Loading

docs/images/platform_prefab.png

63.8 KB
Loading

0 commit comments

Comments
 (0)