-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Documentation Update #1339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Documentation Update #1339
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5a4cb98
Documentation Update
vincentpierre d0ce35e
addressed comments
vincentpierre 9d6408a
new images for the recorder
vincentpierre ef1cd5b
Improvements to the docs
vincentpierre ba4421c
Address the comments
vincentpierre efa9a9d
Core_ML typo
vincentpierre 0f33689
Updated the links to inference repo
vincentpierre 48fd830
Put back Inference-Engine.md
vincentpierre cafac95
fix typos : brain
vincentpierre 512adbb
Readd deleted file
vincentpierre 1b9e732
fix typos
vincentpierre 34eecf6
Addressed comments
vincentpierre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,8 @@ the basic concepts of Unity. | |
|
||
## Setting up the ML-Agents Toolkit within Unity | ||
|
||
In order to use the ML-Agents toolkit within Unity, you need to change some | ||
Unity settings first. You will also need to have appropriate inference backends | ||
installed in order to run your models inside of Unity. See [here](Inference-Engine.md) | ||
for more information. | ||
In order to use the ML-Agents toolkit within Unity, you first need to change a few | ||
Unity settings. | ||
|
||
1. Launch Unity | ||
2. On the Projects dialog, choose the **Open** option at the top of the window. | ||
|
@@ -22,26 +20,43 @@ for more information. | |
4. Go to **Edit** > **Project Settings** > **Player** | ||
5. For **each** of the platforms you target (**PC, Mac and Linux Standalone**, | ||
**iOS** or **Android**): | ||
1. Option the **Other Settings** section. | ||
1. Expand the **Other Settings** section. | ||
2. Select **Scripting Runtime Version** to **Experimental (.NET 4.6 | ||
Equivalent or .NET 4.x Equivalent)** | ||
6. Go to **File** > **Save Project** | ||
|
||
## Setting up the Inference Engine | ||
|
||
We provide pre-trained models for all the agents in all our demo environments. | ||
To be able to run those models, you'll first need to set-up the Inference | ||
Engine. The Inference Engine is a general API to | ||
run neural network models in Unity that leverages existing inference libraries such | ||
as TensorFlowSharp and Apple's Core ML. Since the ML-Agents Toolkit uses TensorFlow | ||
for training neural network models, the output model format is TensorFlow and | ||
the model files include a `.tf` extension. Consequently, you need to install | ||
the TensorFlowSharp backend to be able to run these models within the Unity | ||
Editor. You can find instructions | ||
on how to install the TensorFlowSharp backend [here](Inference-Engine.md). | ||
Once the backend is installed, you will need to reimport the models : Right click | ||
on the `.tf` model and select `Reimport`. | ||
|
||
|
||
## Running a Pre-trained Model | ||
|
||
1. In the **Project** window, go to `Assets/ML-Agents/Examples/3DBall/Scenes` folder | ||
and open the `3DBall` scene file. | ||
2. In the **Project** window, go to `Assets/ML-Agents/Examples/3DBall/Prefabs` folder | ||
and select the `Game/Platform` prefab. | ||
3. In the `Ball 3D Agent` Component: Drag the **3DBallLearning** located into | ||
3. In the `Ball 3D Agent` Component: Drag the **3DBallLearning** Brain located in | ||
`Assets/ML-Agents/Examples/3DBall/Brains` into the `Brain` property of | ||
the `Ball 3D Agent`. | ||
4. Make sure that all of the Agents in the Scene now have **3DBallLearning** as `Brain`. | ||
__Note__ : You can modify multiple game objects in a scene by selecting them all at once using the search bar in the Scene Hierarchy. | ||
__Note__ : You can modify multiple game objects in a scene by selecting them all at | ||
once using the search bar in the Scene Hierarchy. | ||
5. In the **Project** window, locate the `Assets/ML-Agents/Examples/3DBall/TFModels` | ||
folder. | ||
6. Drag the `3DBall` model file from the `Assets/ML-Agents/Examples/3DBall/TFModels` | ||
folder to the **Model** field of the **3DBallLearning**. | ||
6. Drag the `3DBallLearning` model file from the `Assets/ML-Agents/Examples/3DBall/TFModels` | ||
folder to the **Model** field of the **3DBallLearning** Brain. | ||
7. Click the **Play** button and you will see the platforms balance the balls | ||
using the pretrained model. | ||
|
||
|
@@ -63,15 +78,26 @@ More information and documentation is provided in the | |
|
||
### Adding a Brain to the training session | ||
|
||
Since we are going to build this environment to conduct training, we need to add | ||
the Brain to the training session. This allows the Agents linked to that Brain | ||
to communicate with the external training process when making their decisions. | ||
|
||
1. Assign the **3DBallLearning** to the agents you would like to train and the **3DBallPlayer** Brain to the agents you want to control manually. | ||
__Note:__ You can only perform training with an `Learning Brain`. | ||
To set up the environment for training, you will need to specify which agents are contributing | ||
to the training and which Brain is being trained. You can only perform training with | ||
a `Learning Brain`. | ||
|
||
1. Assign the **3DBallLearning** Brain to the agents you would like to train. | ||
__Note:__ You can assign the same Brain to multiple agents at once : To do so, you can | ||
use the prefab system. When an agent is created from a prefab, modifying the prefab | ||
will modify the agent as well. If the agent does not synchronize with the prefab, you | ||
can hit the Revert button on top of the Inspector. | ||
Alternatively, you can select multiple agents in the scene and modify their `Brain` | ||
property all at once. | ||
2. Select the **Ball3DAcademy** GameObject and make sure the **3DBallLearning** Brain | ||
is in the Broadcast Hub. In order to train, you need to toggle the | ||
`Control` checkbox. | ||
|
||
__Note:__ Assigning a Brain to an agent (dragging a Brain into the `Brain` property of | ||
the agent) means that the Brain will be making decision for that agent. Whereas dragging | ||
a Brain into the Broadcast Hub means that the Brain will be exposed to the Python process. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe change to: Whereas dragging a Brain into the Broadcast Hub means that the Brain will be exposed to the Python process, and checking the Control toggle means the Brain will be exposed to the Python process and controlled by the Python process(so that the training happens). |
||
The `Control` checkbox means that in addition to being exposed to Python, the Brain will | ||
be controlled by the Python process (required for training). | ||
|
||
 | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also to align with the format of the Basic Guide, the steps to use Inference Engine should be described within this page instead of in another page, so that our user has a place to go through all of the steps in one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the ideal scenario maybe, but ML-Agents will not host any Inference Engine documentation. So we can only link to external docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just like how we did things with Tensorflowsharp, we were not hosting TensorFlowSharp, but we put the docs on how to use TensorFlowSharp on our own github.