Skip to content

Commit e3b86a2

Browse files
Merge pull request #1764 from Unity-Technologies/release-v0.7
Release v0.7 into master
2 parents d3f9fd6 + 5f57742 commit e3b86a2

File tree

237 files changed

+13216
-1974
lines changed

Some content is hidden

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

237 files changed

+13216
-1974
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public override void OnInspectorGUI()
7171
EditorGUILayout.PropertyField(
7272
actionsPerDecision,
7373
new GUIContent(
74-
"Decision Frequency",
74+
"Decision Interval",
7575
"The agent will automatically request a decision every X" +
7676
" steps and perform an action at every step."));
7777
actionsPerDecision.intValue = Mathf.Max(1, actionsPerDecision.intValue);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace MLAgents
1414
public class LearningBrainEditor : BrainEditor
1515
{
1616
private const string ModelPropName = "model";
17+
private const string InferenceDevicePropName = "inferenceDevice";
1718
private const float TimeBetweenModelReloads = 2f;
1819
// Time since the last reload of the model
1920
private float _timeSinceModelReload;
@@ -47,6 +48,8 @@ public override void OnInspectorGUI()
4748
serializedBrain.Update();
4849
var tfGraphModel = serializedBrain.FindProperty(ModelPropName);
4950
EditorGUILayout.ObjectField(tfGraphModel);
51+
var inferenceDevice = serializedBrain.FindProperty(InferenceDevicePropName);
52+
EditorGUILayout.PropertyField(inferenceDevice);
5053
serializedBrain.ApplyModifiedProperties();
5154
if (EditorGUI.EndChangeCheck())
5255
{
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System.IO;
2+
using UnityEditor;
3+
using UnityEngine;
4+
using UnityEditor.Experimental.AssetImporters;
5+
using MLAgents.InferenceBrain;
6+
7+
namespace MLAgents
8+
{
9+
/// <summary>
10+
/// Asset Importer of barracuda models.
11+
/// </summary>
12+
[ScriptedImporter(1, new[] {"nn"})]
13+
public class NNModelImporter : ScriptedImporter {
14+
private const string IconPath = "Assets/ML-Agents/Resources/NNModelIcon.png";
15+
16+
public override void OnImportAsset(AssetImportContext ctx)
17+
{
18+
var model = File.ReadAllBytes(ctx.assetPath);
19+
var asset = ScriptableObject.CreateInstance<NNModel>();
20+
asset.Value = model;
21+
22+
Texture2D texture = (Texture2D)
23+
AssetDatabase.LoadAssetAtPath(IconPath, typeof(Texture2D));
24+
25+
ctx.AddObjectToAsset(ctx.assetPath, asset, texture);
26+
ctx.SetMainObject(asset);
27+
}
28+
}
29+
}

UnitySDK/Assets/ML-Agents/Editor/NNModelImporter.cs.meta

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

UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorGenerator.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,14 @@ public void GeneratePreviousActionInput()
113113
var inputTensor = new Tensor()
114114
{
115115
Shape = new long[] {2, 2},
116-
ValueType = Tensor.TensorType.FloatingPoint
116+
ValueType = Tensor.TensorType.Integer
117117

118118
};
119119
var batchSize = 4;
120120
var agentInfos = GetFakeAgentInfos();
121121

122122
var generator = new PreviousActionInputGenerator();
123-
Assert.Catch<NotImplementedException>(
124-
() => generator.Generate(inputTensor, batchSize, agentInfos));
125123

126-
inputTensor.ValueType = Tensor.TensorType.Integer;
127124
generator.Generate(inputTensor, batchSize, agentInfos);
128125
Assert.IsNotNull(inputTensor.Data as int[,]);
129126
Assert.AreEqual((inputTensor.Data as int[,])[0, 0], 1);

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

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

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

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

UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardLearning.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ MonoBehaviour:
2020
-
2121
-
2222
vectorActionSpaceType: 1
23-
model: {fileID: 4900000, guid: 8a2da2218425f46e9921caefda4b7813, type: 3}
23+
model: {fileID: 11400000, guid: 8be33caeca04d43498913448b5364f2b, type: 3}

UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallLearning.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ MonoBehaviour:
2020
-
2121
-
2222
vectorActionSpaceType: 1
23-
model: {fileID: 4900000, guid: 9f58800fa9d54477aa01ee258842f6b3, type: 3}
23+
model: {fileID: 11400000, guid: c282d4bbc4c8f4e78b2bb29eccd17557, type: 3}

UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/Game.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ MonoBehaviour:
312312
m_Script: {fileID: 11500000, guid: aaba48bf82bee4751aa7b89569e57f73, type: 3}
313313
m_Name:
314314
m_EditorClassIdentifier:
315-
brain: {fileID: 11400000, guid: 97d8f9d40dc8c452f932f7caa9549c7d, type: 2}
315+
brain: {fileID: 11400000, guid: 383c589e8bb76464eadc2525b5b0f2c1, type: 2}
316316
agentParameters:
317317
agentCameras: []
318318
maxStep: 5000

UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/GameHard.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ MonoBehaviour:
312312
m_Script: {fileID: 11500000, guid: edf26e11cf4ed42eaa3ffb7b91bb4676, type: 3}
313313
m_Name:
314314
m_EditorClassIdentifier:
315-
brain: {fileID: 11400000, guid: 55f48be32ac184c6ab67cf647100bac4, type: 2}
315+
brain: {fileID: 11400000, guid: 4f74e089fbb75455ebf6f0495e30be6e, type: 2}
316316
agentParameters:
317317
agentCameras: []
318318
maxStep: 5000
Binary file not shown.
Binary file not shown.

UnitySDK/Assets/ML-Agents/Examples/3DBall/TFModels/3DBallHardLearning.nn.meta

Lines changed: 7 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.

UnitySDK/Assets/ML-Agents/Examples/3DBall/TFModels/3DBallLearning.nn.meta

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

UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/Brains/BananaLearning.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ MonoBehaviour:
2222
-
2323
-
2424
vectorActionSpaceType: 0
25-
model: {fileID: 4900000, guid: 69bd818d72b944849916d2fda9fe471b, type: 3}
25+
model: {fileID: 11400000, guid: 9aed85b22394844eaa6db4d5e3c61adb, type: 3}

UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/Prefabs/RLArea.prefab

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5752,7 +5752,7 @@ MonoBehaviour:
57525752
m_Script: {fileID: 11500000, guid: 700720465a0104fa586fa4a412b044f8, type: 3}
57535753
m_Name:
57545754
m_EditorClassIdentifier:
5755-
brain: {fileID: 11400000, guid: dff7429d656234fed84c4fac2a7a683c, type: 2}
5755+
brain: {fileID: 11400000, guid: 9e7865ec29c894c2d8c1617b0fa392f9, type: 2}
57565756
agentParameters:
57575757
agentCameras: []
57585758
maxStep: 5000
@@ -5830,7 +5830,7 @@ MonoBehaviour:
58305830
m_Script: {fileID: 11500000, guid: 700720465a0104fa586fa4a412b044f8, type: 3}
58315831
m_Name:
58325832
m_EditorClassIdentifier:
5833-
brain: {fileID: 11400000, guid: dff7429d656234fed84c4fac2a7a683c, type: 2}
5833+
brain: {fileID: 11400000, guid: 9e7865ec29c894c2d8c1617b0fa392f9, type: 2}
58345834
agentParameters:
58355835
agentCameras: []
58365836
maxStep: 5000
@@ -5858,7 +5858,7 @@ MonoBehaviour:
58585858
m_Script: {fileID: 11500000, guid: 700720465a0104fa586fa4a412b044f8, type: 3}
58595859
m_Name:
58605860
m_EditorClassIdentifier:
5861-
brain: {fileID: 11400000, guid: dff7429d656234fed84c4fac2a7a683c, type: 2}
5861+
brain: {fileID: 11400000, guid: 9e7865ec29c894c2d8c1617b0fa392f9, type: 2}
58625862
agentParameters:
58635863
agentCameras: []
58645864
maxStep: 5000
@@ -5886,7 +5886,7 @@ MonoBehaviour:
58865886
m_Script: {fileID: 11500000, guid: 700720465a0104fa586fa4a412b044f8, type: 3}
58875887
m_Name:
58885888
m_EditorClassIdentifier:
5889-
brain: {fileID: 11400000, guid: dff7429d656234fed84c4fac2a7a683c, type: 2}
5889+
brain: {fileID: 11400000, guid: 9e7865ec29c894c2d8c1617b0fa392f9, type: 2}
58905890
agentParameters:
58915891
agentCameras: []
58925892
maxStep: 5000
@@ -5914,7 +5914,7 @@ MonoBehaviour:
59145914
m_Script: {fileID: 11500000, guid: 700720465a0104fa586fa4a412b044f8, type: 3}
59155915
m_Name:
59165916
m_EditorClassIdentifier:
5917-
brain: {fileID: 11400000, guid: dff7429d656234fed84c4fac2a7a683c, type: 2}
5917+
brain: {fileID: 11400000, guid: 9e7865ec29c894c2d8c1617b0fa392f9, type: 2}
59185918
agentParameters:
59195919
agentCameras: []
59205920
maxStep: 5000
Binary file not shown.
Binary file not shown.

UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/TFModels/BananaLearning.nn.meta

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

UnitySDK/Assets/ML-Agents/Examples/Basic/Brains/BasicLearning.asset

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ MonoBehaviour:
1919
vectorActionDescriptions:
2020
-
2121
vectorActionSpaceType: 0
22-
model: {fileID: 4900000, guid: 503ce1e8257904bd0b5be8f7fb4b5d28, type: 3}
22+
model: {fileID: 11400000, guid: b9b3600e7ab99422684e1f3bf597a456, type: 3}
23+
inferenceDevice: 0

UnitySDK/Assets/ML-Agents/Examples/Basic/Prefabs/Basic.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ MonoBehaviour:
282282
m_Script: {fileID: 11500000, guid: 624480a72e46148118ab2e2d89b537de, type: 3}
283283
m_Name:
284284
m_EditorClassIdentifier:
285-
brain: {fileID: 11400000, guid: 1adbe3db6a2f94bf2b1e22a29b955387, type: 2}
285+
brain: {fileID: 11400000, guid: e5cf0e35e16264ea483f8863e5115c3c, type: 2}
286286
agentParameters:
287287
agentCameras: []
288288
maxStep: 0
Binary file not shown.

UnitySDK/Assets/ML-Agents/Examples/Basic/TFModels/BasicLearning.nn.meta

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

UnitySDK/Assets/ML-Agents/Examples/Bouncer/Brains/BouncerLearning.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ MonoBehaviour:
2121
-
2222
-
2323
vectorActionSpaceType: 1
24-
model: {fileID: 4900000, guid: 760d2b8347b4b46e3a44d9b989e1304e, type: 3}
24+
model: {fileID: 11400000, guid: 055df42a4cc114162939e523d053c4d7, type: 3}

UnitySDK/Assets/ML-Agents/Examples/Bouncer/Prefabs/Environment.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ MonoBehaviour:
971971
m_Script: {fileID: 11500000, guid: 0f09741cbce2e44bc88d3e92917eea0e, type: 3}
972972
m_Name:
973973
m_EditorClassIdentifier:
974-
brain: {fileID: 11400000, guid: 5527511df7b944e8e9177dd69db5a9c1, type: 2}
974+
brain: {fileID: 11400000, guid: 573920e3a672d40038169c7ffdbdca05, type: 2}
975975
agentParameters:
976976
agentCameras: []
977977
maxStep: 0

0 commit comments

Comments
 (0)