Skip to content
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

[barracuda] Update Barracuda to 0.7.0-preview #3875

Merged
merged 4 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using Barracuda;
using Unity.Barracuda;
using System.IO;
using Unity.MLAgents;
using Unity.MLAgents.Policies;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections;
using UnityEngine;
using Unity.MLAgents;
using Barracuda;
using Unity.Barracuda;
using Unity.MLAgents.Sensors;

public class WallJumpAgent : Agent
Expand Down
1 change: 1 addition & 0 deletions com.unity.ml-agents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ and this project adheres to
C# style conventions. All public fields and properties now use "PascalCase"
instead of "camelCase"; for example, `Agent.maxStep` was renamed to
`Agent.MaxStep`. For a full list of changes, see the pull request. (#3828)
- Updated to Barracuda 0.7.0-preivew which has breaking namespace and assembly name changes.
#### ml-agents / ml-agents-envs / gym-unity (Python)
- The `--load` and `--train` command-line flags have been deprecated. Training
now happens by default, and use `--resume` to resume training instead. (#3705)
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Editor/BehaviorParametersEditor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Unity.MLAgents.Sensors;
using UnityEditor;
using Barracuda;
using Unity.MLAgents.Policies;
using Unity.Barracuda;
using UnityEngine;

namespace Unity.MLAgents.Editor
Expand Down
4 changes: 2 additions & 2 deletions com.unity.ml-agents/Editor/Unity.ML-Agents.Editor.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Unity.ML-Agents.Editor",
"references": [
"Unity.ML-Agents",
"Barracuda",
"Unity.Barracuda",
"Unity.ML-Agents.CommunicatorObjects"
],
"optionalUnityReferences": [],
Expand All @@ -15,4 +15,4 @@
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}
}
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/Academy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Unity.MLAgents.Inference;
using Unity.MLAgents.Policies;
using Unity.MLAgents.SideChannels;
using Barracuda;
using Unity.Barracuda;

/**
* Welcome to Unity Machine Learning Agents (ML-Agents).
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using UnityEngine;
using Barracuda;
using Unity.MLAgents.Sensors;
using Unity.MLAgents.Demonstrations;
using Unity.MLAgents.Policies;
using Unity.Barracuda;
using UnityEngine.Serialization;

namespace Unity.MLAgents
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/Inference/ApplierImpl.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Barracuda;
using Unity.MLAgents.Inference.Utils;
using Unity.Barracuda;
using UnityEngine;

namespace Unity.MLAgents.Inference
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Barracuda;
using Unity.MLAgents.Sensors;
using Unity.MLAgents.Policies;
using Unity.Barracuda;

namespace Unity.MLAgents.Inference
{
Expand Down Expand Up @@ -590,7 +590,7 @@ static IEnumerable<string> CheckOutputTensorShape(
"suggest Continuous Control.");
return failedModelChecks;
}
var tensorTester = new Dictionary<string, Func<BrainParameters, TensorShape, int, string>>();
var tensorTester = new Dictionary<string, Func<BrainParameters, TensorShape?, int, string>>();
if (brainParameters.VectorActionSpaceType == SpaceType.Continuous)
{
tensorTester[TensorNames.ActionOutput] = CheckContinuousActionOutputShape;
Expand All @@ -604,7 +604,7 @@ static IEnumerable<string> CheckOutputTensorShape(
{
if (tensorTester.ContainsKey(name))
{
var tester = tensorTester[name];
Func<BrainParameters, TensorShape?, int, string> tester = tensorTester[name];
var error = tester.Invoke(brainParameters, model.GetShapeByName(name), modelActionSize);
if (error != null)
{
Expand All @@ -631,7 +631,7 @@ static IEnumerable<string> CheckOutputTensorShape(
/// check failed. If the check passed, returns null.
/// </returns>
static string CheckDiscreteActionOutputShape(
BrainParameters brainParameters, TensorShape shape, int modelActionSize)
BrainParameters brainParameters, TensorShape? shape, int modelActionSize)
{
var bpActionSize = brainParameters.VectorActionSize.Sum();
if (modelActionSize != bpActionSize)
Expand All @@ -656,7 +656,7 @@ static string CheckDiscreteActionOutputShape(
/// <returns>If the Check failed, returns a string containing information about why the
/// check failed. If the check passed, returns null.</returns>
static string CheckContinuousActionOutputShape(
BrainParameters brainParameters, TensorShape shape, int modelActionSize)
BrainParameters brainParameters, TensorShape? shape, int modelActionSize)
{
var bpActionSize = brainParameters.VectorActionSize[0];
if (modelActionSize != bpActionSize)
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/Inference/GeneratorImpl.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System;
using Barracuda;
using Unity.MLAgents.Inference.Utils;
using Unity.Barracuda;
using UnityEngine;
using Unity.MLAgents.Sensors;

Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/Inference/ModelRunner.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Collections.Generic;
using Barracuda;
using Unity.Barracuda;
using UnityEngine.Profiling;
using Unity.MLAgents.Sensors;
using Unity.MLAgents.Policies;
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/Inference/TensorApplier.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using Barracuda;
using Unity.MLAgents.Policies;
using Unity.Barracuda;

namespace Unity.MLAgents.Inference
{
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/Inference/TensorGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using Barracuda;
using Unity.MLAgents.Sensors;
using Unity.Barracuda;

namespace Unity.MLAgents.Inference
{
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/Inference/TensorProxy.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Barracuda;
using Unity.MLAgents.Inference.Utils;
using Unity.Barracuda;

namespace Unity.MLAgents.Inference
{
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/Policies/BarracudaPolicy.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Barracuda;
using Unity.Barracuda;
using System.Collections.Generic;
using Unity.MLAgents.Inference;
using Unity.MLAgents.Sensors;
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/Policies/BehaviorParameters.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Barracuda;
using Unity.Barracuda;
using System;
using UnityEngine;
using UnityEngine.Serialization;
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/Sensors/ObservationWriter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Barracuda;
using Unity.MLAgents.Inference;
using Unity.Barracuda;

namespace Unity.MLAgents.Sensors
{
Expand Down
4 changes: 2 additions & 2 deletions com.unity.ml-agents/Runtime/Unity.ML-Agents.asmdef
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Unity.ML-Agents",
"references": [
"Barracuda",
"Unity.Barracuda",
"Unity.ML-Agents.CommunicatorObjects"
],
"optionalUnityReferences": [],
Expand All @@ -16,4 +16,4 @@
],
"autoReferenced": true,
"defineConstraints": []
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using Barracuda;
using Unity.Barracuda;
using NUnit.Framework;
using UnityEngine;
using Unity.MLAgents.Inference;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using NUnit.Framework;
using Barracuda;
using Unity.MLAgents.Inference;
using Unity.MLAgents.Policies;
using Unity.Barracuda;

namespace Unity.MLAgents.Tests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Collections.Generic;
using Barracuda;
using Unity.Barracuda;
using NUnit.Framework;
using UnityEngine;
using Unity.MLAgents.Inference;
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Tests/Editor/ModelRunnerTest.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using NUnit.Framework;
using UnityEngine;
using UnityEditor;
using Barracuda;
using Unity.MLAgents.Inference;
using Unity.MLAgents.Sensors;
using Unity.Barracuda;
using System.Linq;
using Unity.MLAgents.Policies;

Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Tests/Editor/ParameterLoaderTest.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using NUnit.Framework;
using UnityEngine;
using UnityEditor;
using Barracuda;
using Unity.MLAgents.Inference;
using Unity.MLAgents.Sensors;
using Unity.Barracuda;
using System.Linq;
using Unity.MLAgents.Policies;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using NUnit.Framework;
using Unity.MLAgents.Sensors;
using Barracuda;
using Unity.MLAgents.Inference;
using Unity.Barracuda;


namespace Unity.MLAgents.Tests
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Tests/Editor/TensorUtilsTest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using Barracuda;
using Unity.MLAgents.Inference;
using Unity.MLAgents.Inference.Utils;
using Unity.Barracuda;
using NUnit.Framework;

namespace Unity.MLAgents.Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"references": [
"Unity.ML-Agents.Editor",
"Unity.ML-Agents",
"Barracuda",
"Unity.Barracuda",
"Unity.ML-Agents.CommunicatorObjects"
],
"optionalUnityReferences": [
Expand All @@ -24,4 +24,4 @@
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Tests",
"references": [
"Unity.ML-Agents",
"Barracuda",
"Unity.Barracuda",
"Unity.ML-Agents.CommunicatorObjects",
"Unity.ML-Agents.Editor"
],
Expand Down
4 changes: 2 additions & 2 deletions com.unity.ml-agents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"unity": "2018.4",
"description": "Add interactivity to your game with Machine Learning Agents trained using Deep Reinforcement Learning.",
"dependencies": {
"com.unity.barracuda": "0.6.3-preview"
"com.unity.barracuda": "0.7.0-preview"
}
}
}