浏览代码
Barracuda integration into ML-Agents (#1557)
Barracuda integration into ML-Agents (#1557)
* Switched default Mac GFX API to Metal * Added Barracuda pre-0.1.5 * Added basic integration with Barracuda Inference Engine * Use predefined outputs the same way as for TF engine * Fixed discrete action + LSTM support * Switch Unity Mac Editor to Metal GFX API * Fixed null model handling * All examples converted to support Barracuda * Added model conversion from Tensorflow to Barracuda copied the barracuda.py file to ml-agents/mlagents/trainers copied the tensorflow_to_barracuda.py file to ml-agents/mlagents/trainers modified the tensorflow_to_barracuda.py file so it could be called from mlagents modified ml-agents/mlagents/trainers/policy.py to convert the tf models to barracuda compatible .bytes file * Added missing iOS BLAS plugin * Added forgotten prefab changes * Removed GLCore GFX backend for Mac, because it doesn't support Compute shaders * Exposed GPU support for LearningBrain inference .../develop-generalizationTraining-TrainerController
Vincent-Pierre BERGES
6 年前
当前提交
4a6ae4e0
共有 210 个文件被更改,包括 15338 次插入 和 137 次删除
-
3UnitySDK/Assets/ML-Agents/Editor/LearningBrainEditor.cs
-
5UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorGenerator.cs
-
2UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/Game.prefab
-
2UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/GameHard.prefab
-
2UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/Brains/BananaLearning.asset
-
10UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/Prefabs/RLArea.prefab
-
2UnitySDK/Assets/ML-Agents/Examples/Basic/Brains/BasicLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/Basic/Prefabs/Basic.prefab
-
2UnitySDK/Assets/ML-Agents/Examples/Bouncer/Brains/BouncerLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/Bouncer/Prefabs/Environment.prefab
-
2UnitySDK/Assets/ML-Agents/Examples/Crawler/Brains/CrawlerDynamicLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/Crawler/Brains/CrawlerStaticLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/GridWorld/Brains/GridWorldLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity
-
2UnitySDK/Assets/ML-Agents/Examples/Hallway/Brains/HallwayLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/Hallway/Prefabs/HallwayArea.prefab
-
2UnitySDK/Assets/ML-Agents/Examples/PushBlock/Brains/PushBlockLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockArea.prefab
-
2UnitySDK/Assets/ML-Agents/Examples/Pyramids/Brains/PyramidsLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/Pyramids/Prefabs/AreaPB.prefab
-
2UnitySDK/Assets/ML-Agents/Examples/Reacher/Brains/ReacherLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/Soccer/Brains/GoalieLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/Soccer/Brains/StrikerLearning.asset
-
8UnitySDK/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab
-
2UnitySDK/Assets/ML-Agents/Examples/Tennis/Brains/TennisLearning.asset
-
4UnitySDK/Assets/ML-Agents/Examples/Tennis/Prefabs/TennisArea.prefab
-
2UnitySDK/Assets/ML-Agents/Examples/Walker/Brains/WalkerLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/WallJump/Brains/BigWallJumpLearning.asset
-
2UnitySDK/Assets/ML-Agents/Examples/WallJump/Brains/SmallWallJumpLearning.asset
-
26UnitySDK/Assets/ML-Agents/Scripts/Academy.cs
-
5UnitySDK/Assets/ML-Agents/Scripts/Agent.cs
-
40UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/ApplierImpl.cs
-
61UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/GeneratorImpl.cs
-
3UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/TensorApplier.cs
-
4UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/TensorGenerator.cs
-
4UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/TensorNames.cs
-
124UnitySDK/Assets/ML-Agents/Scripts/LearningBrain.cs
-
4UnitySDK/ProjectSettings/ProjectSettings.asset
-
17docs/Background-TensorFlow.md
-
40docs/Basic-Guide.md
-
12docs/Getting-Started-with-Balance-Ball.md
-
8docs/Learning-Environment-Design-Learning-Brains.md
-
4docs/Learning-Environment-Executable.md
-
4docs/ML-Agents-Overview.md
-
3docs/Readme.md
-
2docs/Training-Imitation-Learning.md
-
2docs/Training-ML-Agents.md
-
10ml-agents/mlagents/trainers/policy.py
-
2ml-agents/mlagents/trainers/trainer_controller.py
-
29UnitySDK/Assets/ML-Agents/Editor/NNModelImporter.cs
-
11UnitySDK/Assets/ML-Agents/Editor/NNModelImporter.cs.meta
-
286UnitySDK/Assets/ML-Agents/Examples/3DBall/TFModels/3DBallHardLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/3DBall/TFModels/3DBallHardLearning.nn.meta
-
258UnitySDK/Assets/ML-Agents/Examples/3DBall/TFModels/3DBallLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/3DBall/TFModels/3DBallLearning.nn.meta
-
340UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/TFModels/BananaLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/TFModels/BananaLearning.nn.meta
-
14UnitySDK/Assets/ML-Agents/Examples/Basic/TFModels/BasicLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/Basic/TFModels/BasicLearning.nn.meta
-
87UnitySDK/Assets/ML-Agents/Examples/Bouncer/TFModels/BouncerLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/Bouncer/TFModels/BouncerLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerDynamicLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerDynamicLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerStaticLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerStaticLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/GridWorld/TFModels/GridWorldLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/GridWorld/TFModels/GridWorldLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/Hallway/TFModels/HallwayLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/Hallway/TFModels/HallwayLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/Pyramids/TFModels/PyramidsLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/Pyramids/TFModels/PyramidsLearning.nn.meta
-
284UnitySDK/Assets/ML-Agents/Examples/Reacher/TFModels/ReacherLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/Reacher/TFModels/ReacherLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/Soccer/TFModels/GoalieLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/Soccer/TFModels/GoalieLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/Soccer/TFModels/StrikerLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/Soccer/TFModels/StrikerLearning.nn.meta
-
276UnitySDK/Assets/ML-Agents/Examples/Tennis/TFModels/TennisLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/Tennis/TFModels/TennisLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/Walker/TFModels/WalkerLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/Walker/TFModels/WalkerLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/WallJump/TFModels/BigWallJumpLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/WallJump/TFModels/BigWallJumpLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/WallJump/TFModels/SmallWallJumpLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/WallJump/TFModels/SmallWallJumpLearning.nn.meta
-
8UnitySDK/Assets/ML-Agents/Plugins/Barracuda.Core.meta
-
23UnitySDK/Assets/ML-Agents/Resources/NNModelIcon.png
-
106UnitySDK/Assets/ML-Agents/Resources/NNModelIcon.png.meta
-
615UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/BarracudaModelParamLoader.cs
-
3UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/BarracudaModelParamLoader.cs.meta
-
10UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/NNModel.cs
-
11UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/NNModel.cs.meta
-
28docs/Unity-Inference-Engine.md
-
491ml-agents/mlagents/trainers/barracuda.py
-
1001ml-agents/mlagents/trainers/tensorflow_to_barracuda.py
|
|||
using System.IO; |
|||
using UnityEditor; |
|||
using UnityEngine; |
|||
using UnityEditor.Experimental.AssetImporters; |
|||
using MLAgents.InferenceBrain; |
|||
|
|||
namespace MLAgents |
|||
{ |
|||
/// <summary>
|
|||
/// Asset Importer of barracuda models.
|
|||
/// </summary>
|
|||
[ScriptedImporter(1, new[] {"nn"})] |
|||
public class NNModelImporter : ScriptedImporter { |
|||
private const string IconPath = "Assets/ML-Agents/Resources/NNModelIcon.png"; |
|||
|
|||
public override void OnImportAsset(AssetImportContext ctx) |
|||
{ |
|||
var model = File.ReadAllBytes(ctx.assetPath); |
|||
var asset = ScriptableObject.CreateInstance<NNModel>(); |
|||
asset.Value = model; |
|||
|
|||
Texture2D texture = (Texture2D) |
|||
AssetDatabase.LoadAssetAtPath(IconPath, typeof(Texture2D)); |
|||
|
|||
ctx.AddObjectToAsset(ctx.assetPath, asset, texture); |
|||
ctx.SetMainObject(asset); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 83221ad3db87f4b3b91b041047cb2bc5 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
vector_observation ���� - epsilon ���� action & |