Skip to content

Commit 2cccc2c

Browse files
authored
Merge pull request #1931 from Unity-Technologies/release-v0.8
Release v0.8
2 parents e3b86a2 + ad97e16 commit 2cccc2c

File tree

164 files changed

+3380
-855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+3380
-855
lines changed

.circleci/config.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,27 @@ jobs:
2020
command: |
2121
python3 -m venv venv
2222
. venv/bin/activate
23-
cd ml-agents && pip install -e .
23+
cd ml-agents-envs && pip install -e .
24+
cd ../ml-agents && pip install -e .
25+
pip install pytest-cov==2.6.1 codacy-coverage==1.3.11
26+
cd ../gym-unity && pip install -e .
2427
2528
- save_cache:
2629
paths:
2730
- ./venv
2831
key: v1-dependencies-{{ checksum "ml-agents/setup.py" }}
2932

3033
- run:
31-
name: Run Tests
34+
name: Run Tests for ml-agents and gym_unity
3235
command: |
3336
. venv/bin/activate
34-
cd ml-agents/ && pytest tests/
3537
mkdir test-reports
36-
pytest --junitxml=test-reports/junit.xml
38+
pytest --cov=mlagents --cov-report xml --junitxml=test-reports/junit.xml -p no:warnings
39+
python-codacy-coverage -r coverage.xml
3740
3841
- store_test_results:
39-
path: ml-agents/test-reports
42+
path: test-reports
4043

4144
- store_artifacts:
42-
path: ml-agents/test-reports
43-
destination: ml-agents/test-reports
45+
path: test-reports
46+
destination: test-reports

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959
/UnitySDK/Assets/ML-Agents/Plugins/System.Numerics*
6060
/UnitySDK/Assets/ML-Agents/Plugins/System.ValueTuple*
6161

62+
# Plugins
63+
/UnitySDK/Assets/ML-Agents/VideoRecorder*
64+
6265
# Generated doc folders
6366
/docs/html
6467

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,15 @@ RUN apt-get update && apt-get -y upgrade
122122
# xvfb is used to do CPU based rendering of Unity
123123
RUN apt-get install -y xvfb
124124

125+
# Install ml-agents-envs package locally
126+
COPY ml-agents-envs /ml-agents-envs
127+
WORKDIR /ml-agents-envs
128+
RUN pip install -e .
129+
130+
# Install ml-agents package next
125131
COPY ml-agents /ml-agents
126132
WORKDIR /ml-agents
127-
RUN pip install .
133+
RUN pip install -e .
128134

129135
# port 5005 is the port used in in Editor training.
130136
EXPOSE 5005

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<img src="docs/images/image-banner.png" align="middle" width="3000"/>
44

55
# Unity ML-Agents Toolkit (Beta)
6+
[![docs badge](https://img.shields.io/badge/docs-reference-blue.svg)](docs/Readme.md)
7+
[![license badge](https://img.shields.io/badge/license-Apache--2.0-green.svg)](LICENSE)
68

79
**The Unity Machine Learning Agents Toolkit** (ML-Agents) is an open-source
810
Unity plugin that enables games and simulations to serve as environments for
@@ -32,6 +34,8 @@ developer communities.
3234
* Visualizing network outputs within the environment
3335
* Simplified set-up with Docker
3436
* Wrap learning environments as a gym
37+
* Utilizes the Unity Inference Engine
38+
* Train using concurrent Unity environment instances
3539

3640
## Documentation
3741

UnitySDK/Assets/ML-Agents/Editor/AgentEditor.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ public override void OnInspectorGUI()
2828
"agentParameters.onDemandDecision");
2929
SerializedProperty cameras = serializedAgent.FindProperty(
3030
"agentParameters.agentCameras");
31+
SerializedProperty renderTextures = serializedAgent.FindProperty(
32+
"agentParameters.agentRenderTextures");
3133

3234
EditorGUILayout.PropertyField(brain);
3335

36+
if (cameras.arraySize > 0 && renderTextures.arraySize > 0)
37+
{
38+
EditorGUILayout.HelpBox("Brain visual observations created by first getting all cameras then all render textures.", MessageType.Info);
39+
}
40+
3441
EditorGUILayout.LabelField("Agent Cameras");
3542
for (int i = 0; i < cameras.arraySize; i++)
3643
{
@@ -51,6 +58,28 @@ public override void OnInspectorGUI()
5158
}
5259

5360
EditorGUILayout.EndHorizontal();
61+
62+
EditorGUILayout.LabelField("Agent RenderTextures");
63+
for (int i = 0; i < renderTextures.arraySize; i++)
64+
{
65+
EditorGUILayout.PropertyField(
66+
renderTextures.GetArrayElementAtIndex(i),
67+
new GUIContent("RenderTexture " + (i + 1).ToString() + ": "));
68+
}
69+
70+
EditorGUILayout.BeginHorizontal();
71+
if (GUILayout.Button("Add RenderTextures", EditorStyles.miniButton))
72+
{
73+
renderTextures.arraySize++;
74+
}
75+
76+
if (GUILayout.Button("Remove RenderTextures", EditorStyles.miniButton))
77+
{
78+
renderTextures.arraySize--;
79+
}
80+
81+
EditorGUILayout.EndHorizontal();
82+
5483

5584
EditorGUILayout.PropertyField(
5685
maxSteps,

UnitySDK/Assets/ML-Agents/Editor/BrainParametersDrawer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private static void DrawVectorObservation(Rect position, SerializedProperty prop
9797
property.FindPropertyRelative(NumVecObsPropName),
9898
new GUIContent("Stacked Vectors",
9999
"Number of states that will be stacked before " +
100-
"beeing fed to the neural network."));
100+
"being fed to the neural network."));
101101
position.y += LineHeight;
102102
EditorGUI.indentLevel--;
103103
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using UnityEngine;
2+
using NUnit.Framework;
3+
4+
5+
namespace MLAgents.Tests
6+
{
7+
public class RayPerceptionTests : MonoBehaviour
8+
{
9+
[Test]
10+
public void TestPerception3D()
11+
{
12+
var angles = new[] {0f, 90f, 180f};
13+
var tags = new[] {"test", "test_1"};
14+
15+
var go = new GameObject("MyGameObject");
16+
RayPerception3D rayPer3D = go.AddComponent<RayPerception3D>();
17+
var result = rayPer3D.Perceive(1f, angles ,
18+
tags, 0f, 0f);
19+
Debug.Log(result.Count);
20+
Assert.IsTrue(result.Count == angles.Length * (tags.Length + 2));
21+
}
22+
23+
[Test]
24+
public void TestPerception2D()
25+
{
26+
var angles = new[] {0f, 90f, 180f};
27+
var tags = new[] {"test", "test_1"};
28+
29+
var go = new GameObject("MyGameObject");
30+
RayPerception2D rayPer2D = go.AddComponent<RayPerception2D>();
31+
var result = rayPer2D.Perceive(1f, angles,
32+
tags);
33+
Debug.Log(result.Count);
34+
Assert.IsTrue(result.Count == angles.Length * (tags.Length + 2));
35+
}
36+
}
37+
}

UnitySDK/Assets/ML-Agents/Editor/Tests/RayPerceptionTests.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)