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

0 commit comments

Comments
 (0)