Browse Source

Readd mlagents 0.8.1

Development
Tobi 5 years ago
parent
commit
19fa5027ee
100 changed files with 154 additions and 28 deletions
  1. 68
    0
      .gitignore
  2. 4
    4
      Assets/Brains/CozmoLearningBrain.asset
  3. 1
    1
      Assets/Brains/CozmoLearningBrain.asset.meta
  4. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/TFModels/3DBallHardLearning.nn
  5. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/TFModels/3DBallLearning.nn
  6. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/BananaCollectors/TFModels/BananaLearning.nn
  7. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Bouncer/TFModels/BouncerLearning.nn
  8. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerDynamicLearning.nn
  9. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerStaticLearning.nn
  10. 0
    8
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity.meta
  11. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/GridWorld/TFModels/GridWorldLearning.nn
  12. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Hallway/TFModels/HallwayLearning.nn
  13. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockLearning.nn
  14. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Pyramids/TFModels/PyramidsLearning.nn
  15. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Reacher/TFModels/ReacherLearning.nn
  16. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Tennis/TFModels/TennisLearning.nn
  17. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/WallJump/TFModels/BigWallJumpLearning.nn
  18. BIN
      Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/WallJump/TFModels/SmallWallJumpLearning.nn
  19. 2
    2
      Assets/Scenes/CozmoTraining.unity
  20. 3
    5
      Assets/Scripts/Movemnet/CozmoMovement.cs
  21. 3
    4
      Assets/Scripts/Movemnet/CozmoMovementTester.cs
  22. 1
    1
      Assets/UnitySDK.meta
  23. 1
    1
      Assets/UnitySDK/Assets.meta
  24. 1
    1
      Assets/UnitySDK/Assets/Gizmos.meta
  25. 0
    0
      Assets/UnitySDK/Assets/Gizmos/HeuristicBrain Icon.png
  26. 0
    0
      Assets/UnitySDK/Assets/Gizmos/HeuristicBrain Icon.png.meta
  27. 0
    0
      Assets/UnitySDK/Assets/Gizmos/LearningBrain Icon.png
  28. 0
    0
      Assets/UnitySDK/Assets/Gizmos/LearningBrain Icon.png.meta
  29. 0
    0
      Assets/UnitySDK/Assets/Gizmos/PlayerBrain Icon.png
  30. 0
    0
      Assets/UnitySDK/Assets/Gizmos/PlayerBrain Icon.png.meta
  31. 0
    0
      Assets/UnitySDK/Assets/ML-Agents.meta
  32. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor.meta
  33. 29
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/AgentEditor.cs
  34. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/AgentEditor.cs.meta
  35. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/BrainEditor.cs
  36. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/BrainEditor.cs.meta
  37. 1
    1
      Assets/UnitySDK/Assets/ML-Agents/Editor/BrainParametersDrawer.cs
  38. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/BrainParametersDrawer.cs.meta
  39. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/BroadcastHubDrawer.cs
  40. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/BroadcastHubDrawer.cs.meta
  41. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/DemonstrationDrawer.cs
  42. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/DemonstrationDrawer.cs.meta
  43. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/DemonstrationImporter.cs
  44. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/DemonstrationImporter.cs.meta
  45. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/HeuristicBrainEditor.cs
  46. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/HeuristicBrainEditor.cs.meta
  47. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/LearningBrainEditor.cs
  48. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/LearningBrainEditor.cs.meta
  49. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/NNModelImporter.cs
  50. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/NNModelImporter.cs.meta
  51. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/PlayerBrainEditor.cs
  52. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/PlayerBrainEditor.cs.meta
  53. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/ResetParameterDrawer.cs
  54. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/ResetParameterDrawer.cs.meta
  55. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests.meta
  56. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/DemonstrationTests.cs
  57. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/DemonstrationTests.cs.meta
  58. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestActionMasker.cs
  59. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestActionMasker.cs.meta
  60. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorApplier.cs
  61. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorApplier.cs.meta
  62. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorGenerator.cs
  63. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorGenerator.cs.meta
  64. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs
  65. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs.meta
  66. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/MultinomialTest.cs
  67. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/MultinomialTest.cs.meta
  68. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/RandomNormalTest.cs
  69. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/RandomNormalTest.cs.meta
  70. 37
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/RayPerceptionTests.cs
  71. 3
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/RayPerceptionTests.cs.meta
  72. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/UtilitiesTests.cs
  73. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/UtilitiesTests.cs.meta
  74. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples.meta
  75. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall.meta
  76. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains.meta
  77. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardLearning.asset
  78. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardLearning.asset.meta
  79. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardPlayer.asset
  80. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardPlayer.asset.meta
  81. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHeuristic.asset
  82. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHeuristic.asset.meta
  83. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallLearning.asset
  84. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallLearning.asset.meta
  85. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallPlayer.asset
  86. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallPlayer.asset.meta
  87. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials.meta
  88. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials.meta
  89. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo1.mat
  90. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo1.mat.meta
  91. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo2.mat
  92. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo2.mat.meta
  93. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Text.mat
  94. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Text.mat.meta
  95. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/logo.png
  96. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/logo.png.meta
  97. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs.meta
  98. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/Game.prefab
  99. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/Game.prefab.meta
  100. 0
    0
      Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/GameHard.prefab

+ 68
- 0
.gitignore View File

@@ -35,3 +35,71 @@ sysinfo.txt
*.apk
*.unitypackage
envs/


# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

Assets/Brains/CozmoLearning.asset → Assets/Brains/CozmoLearningBrain.asset View File

@@ -10,19 +10,19 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b23992c8eb17439887f5e944bf04a40, type: 3}
m_Name: CozmoLearning
m_Name: CozmoLearningBrain
m_EditorClassIdentifier:
brainParameters:
vectorObservationSize: 0
numStackedVectorObservations: 1
vectorActionSize: 0300000003000000
vectorActionSize: 0200000002000000
cameraResolutions:
- width: 84
height: 84
blackAndWhite: 1
blackAndWhite: 0
vectorActionDescriptions:
- forward
- rotate
- rotation
vectorActionSpaceType: 0
model: {fileID: 0}
inferenceDevice: 0

Assets/Brains/CozmoLearning.asset.meta → Assets/Brains/CozmoLearningBrain.asset.meta View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 94e62c225e4fe8148a7543c5fd1acfd4
guid: 0d9d5ce547064a648b466ad7f208cf3d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/TFModels/3DBallHardLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/TFModels/3DBallLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/BananaCollectors/TFModels/BananaLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Bouncer/TFModels/BouncerLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerDynamicLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerStaticLearning.nn View File


+ 0
- 8
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity.meta View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7c777442467e245108558a5155153927
timeCreated: 1502222754
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/GridWorld/TFModels/GridWorldLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Hallway/TFModels/HallwayLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlockLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Pyramids/TFModels/PyramidsLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Reacher/TFModels/ReacherLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/Tennis/TFModels/TennisLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/WallJump/TFModels/BigWallJumpLearning.nn View File


BIN
Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/WallJump/TFModels/SmallWallJumpLearning.nn View File


+ 2
- 2
Assets/Scenes/CozmoTraining.unity View File

@@ -506,7 +506,7 @@ MonoBehaviour:
agentCameras:
- {fileID: 589453882}
agentRenderTextures: []
maxStep: 1000
maxStep: 0
resetOnDone: 1
onDemandDecision: 0
numberOfActionsBetweenDecisions: 1
@@ -560,7 +560,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7570006596986120123}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4265d0764c65d26409f0f920e5293c82, type: 3}
m_Name:

+ 3
- 5
Assets/Scripts/Movemnet/CozmoMovement.cs View File

@@ -24,7 +24,7 @@ public class CozmoMovement : MonoBehaviour

private void OnEnable()
{
// When the tank is turned on, make sure it's not kinematic.
// When the cozmo is turned on, make sure it's not kinematic.
m_Rigidbody.isKinematic = false;

// Also reset the input values.
@@ -35,17 +35,15 @@ public class CozmoMovement : MonoBehaviour

private void OnDisable()
{
// When the tank is turned off, set it to kinematic so it stops moving.
// When the cozmo is turned off, set it to kinematic so it stops moving.
m_Rigidbody.isKinematic = true;
}


private void Start()
{
// The axes names are based on player number.
m_MovementAxisName = "Vertical";
m_TurnAxisName = "Horizontal";

}


@@ -66,7 +64,7 @@ public class CozmoMovement : MonoBehaviour

public void Move(float directionValue)
{
// Create a vector in the direction the tank is facing with a magnitude based on the input, speed and the time between frames.
// Create a vector in the direction the cozmo is facing with a magnitude based on the input, speed and the time between frames.
Vector3 movement = directionValue * transform.forward * m_Speed * Time.deltaTime;

// Apply this movement to the rigidbody's position.

+ 3
- 4
Assets/Scripts/Movemnet/CozmoMovementTester.cs View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using UnityEngine;

public enum TestStates { MovementSpeed, RotationSpeed }
public enum TestStates { MovementSpeed, RotationSpeed } // enum to determine test scenarios

[RequireComponent(typeof(CozmoMovement))]
public class CozmoMovementTester : MonoBehaviour
@@ -16,7 +16,6 @@ public class CozmoMovementTester : MonoBehaviour
private CozmoMovement movement; // Reference to the movement script of cozmo
private Vector3 startPositionCozmo; // Original position of cozmo
private float lastY; // Last Y of cozmo
private float curAngleX = 0; // Current angle in the x axis of cozmo
private Stopwatch movementWatch; // Stopwatch to measure the time for the movement usecase
private Stopwatch rotationWatch; // Stopwatch to measure the time for the rotation usecase

@@ -31,7 +30,7 @@ public class CozmoMovementTester : MonoBehaviour


startPositionCozmo = movement.transform.position; // Cache the starting position of Cozmo
lastY = movement.transform.rotation.y; // Cache the rotation Vector of Cozmo
lastY = movement.transform.rotation.y; // Cache the rotation Vector of Cozmo
}

private void FixedUpdate()
@@ -58,7 +57,7 @@ public class CozmoMovementTester : MonoBehaviour
{
rotationWatch.Stop();
UnityEngine.Debug.Log("Cozmo: " + gameObject.name +
"/nElapsed time in milliseconds (Rotation): " + rotationWatch.ElapsedMilliseconds);
"\nElapsed time in milliseconds (Rotation): " + rotationWatch.ElapsedMilliseconds);
}

return;

Assets/ML-Agents Unity SDK.meta → Assets/UnitySDK.meta View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7dc1ce4b31c63e34da34775dd888c0dc
guid: cab51972497b97040814f06bb409e7c0
folderAsset: yes
DefaultImporter:
externalObjects: {}

Assets/ML-Agents Unity SDK/Assets.meta → Assets/UnitySDK/Assets.meta View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 239a923e346c7564eab507004b9293df
guid: fa7ea7fa4ff2dea4eaf717b9f695b516
folderAsset: yes
DefaultImporter:
externalObjects: {}

Assets/ML-Agents Unity SDK/Assets/Gizmos.meta → Assets/UnitySDK/Assets/Gizmos.meta View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 48abdf8d850ee0b4890625559ec6f520
guid: a667ec11dafd88c4882174cec99ff9bd
folderAsset: yes
DefaultImporter:
externalObjects: {}

Assets/ML-Agents Unity SDK/Assets/Gizmos/HeuristicBrain Icon.png → Assets/UnitySDK/Assets/Gizmos/HeuristicBrain Icon.png View File


Assets/ML-Agents Unity SDK/Assets/Gizmos/HeuristicBrain Icon.png.meta → Assets/UnitySDK/Assets/Gizmos/HeuristicBrain Icon.png.meta View File


Assets/ML-Agents Unity SDK/Assets/Gizmos/LearningBrain Icon.png → Assets/UnitySDK/Assets/Gizmos/LearningBrain Icon.png View File


Assets/ML-Agents Unity SDK/Assets/Gizmos/LearningBrain Icon.png.meta → Assets/UnitySDK/Assets/Gizmos/LearningBrain Icon.png.meta View File


Assets/ML-Agents Unity SDK/Assets/Gizmos/PlayerBrain Icon.png → Assets/UnitySDK/Assets/Gizmos/PlayerBrain Icon.png View File


Assets/ML-Agents Unity SDK/Assets/Gizmos/PlayerBrain Icon.png.meta → Assets/UnitySDK/Assets/Gizmos/PlayerBrain Icon.png.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents.meta → Assets/UnitySDK/Assets/ML-Agents.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor.meta → Assets/UnitySDK/Assets/ML-Agents/Editor.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/AgentEditor.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/AgentEditor.cs View File

@@ -28,9 +28,16 @@ namespace MLAgents
"agentParameters.onDemandDecision");
SerializedProperty cameras = serializedAgent.FindProperty(
"agentParameters.agentCameras");
SerializedProperty renderTextures = serializedAgent.FindProperty(
"agentParameters.agentRenderTextures");

EditorGUILayout.PropertyField(brain);

if (cameras.arraySize > 0 && renderTextures.arraySize > 0)
{
EditorGUILayout.HelpBox("Brain visual observations created by first getting all cameras then all render textures.", MessageType.Info);
}
EditorGUILayout.LabelField("Agent Cameras");
for (int i = 0; i < cameras.arraySize; i++)
{
@@ -51,6 +58,28 @@ namespace MLAgents
}

EditorGUILayout.EndHorizontal();
EditorGUILayout.LabelField("Agent RenderTextures");
for (int i = 0; i < renderTextures.arraySize; i++)
{
EditorGUILayout.PropertyField(
renderTextures.GetArrayElementAtIndex(i),
new GUIContent("RenderTexture " + (i + 1).ToString() + ": "));
}

EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Add RenderTextures", EditorStyles.miniButton))
{
renderTextures.arraySize++;
}

if (GUILayout.Button("Remove RenderTextures", EditorStyles.miniButton))
{
renderTextures.arraySize--;
}

EditorGUILayout.EndHorizontal();


EditorGUILayout.PropertyField(
maxSteps,

Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/AgentEditor.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/AgentEditor.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/BrainEditor.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/BrainEditor.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/BrainEditor.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/BrainEditor.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/BrainParametersDrawer.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/BrainParametersDrawer.cs View File

@@ -97,7 +97,7 @@ namespace MLAgents
property.FindPropertyRelative(NumVecObsPropName),
new GUIContent("Stacked Vectors",
"Number of states that will be stacked before " +
"beeing fed to the neural network."));
"being fed to the neural network."));
position.y += LineHeight;
EditorGUI.indentLevel--;
}

Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/BrainParametersDrawer.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/BrainParametersDrawer.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/BroadcastHubDrawer.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/BroadcastHubDrawer.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/BroadcastHubDrawer.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/BroadcastHubDrawer.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/DemonstrationDrawer.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/DemonstrationDrawer.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/DemonstrationDrawer.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/DemonstrationDrawer.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/DemonstrationImporter.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/DemonstrationImporter.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/DemonstrationImporter.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/DemonstrationImporter.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/HeuristicBrainEditor.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/HeuristicBrainEditor.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/HeuristicBrainEditor.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/HeuristicBrainEditor.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/LearningBrainEditor.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/LearningBrainEditor.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/LearningBrainEditor.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/LearningBrainEditor.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/NNModelImporter.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/NNModelImporter.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/NNModelImporter.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/NNModelImporter.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/PlayerBrainEditor.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/PlayerBrainEditor.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/PlayerBrainEditor.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/PlayerBrainEditor.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/ResetParameterDrawer.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/ResetParameterDrawer.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/ResetParameterDrawer.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/ResetParameterDrawer.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/DemonstrationTests.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/DemonstrationTests.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/DemonstrationTests.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/DemonstrationTests.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/EditModeTestActionMasker.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestActionMasker.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/EditModeTestActionMasker.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestActionMasker.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorApplier.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorApplier.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorApplier.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorApplier.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorGenerator.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorGenerator.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorGenerator.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/EditModeTestInternalBrainTensorGenerator.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/MultinomialTest.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/MultinomialTest.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/MultinomialTest.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/MultinomialTest.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/RandomNormalTest.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/RandomNormalTest.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/RandomNormalTest.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/RandomNormalTest.cs.meta View File


+ 37
- 0
Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/RayPerceptionTests.cs View File

@@ -0,0 +1,37 @@
using UnityEngine;
using NUnit.Framework;


namespace MLAgents.Tests
{
public class RayPerceptionTests : MonoBehaviour
{
[Test]
public void TestPerception3D()
{
var angles = new[] {0f, 90f, 180f};
var tags = new[] {"test", "test_1"};
var go = new GameObject("MyGameObject");
RayPerception3D rayPer3D = go.AddComponent<RayPerception3D>();
var result = rayPer3D.Perceive(1f, angles ,
tags, 0f, 0f);
Debug.Log(result.Count);
Assert.IsTrue(result.Count == angles.Length * (tags.Length + 2));
}

[Test]
public void TestPerception2D()
{
var angles = new[] {0f, 90f, 180f};
var tags = new[] {"test", "test_1"};
var go = new GameObject("MyGameObject");
RayPerception2D rayPer2D = go.AddComponent<RayPerception2D>();
var result = rayPer2D.Perceive(1f, angles,
tags);
Debug.Log(result.Count);
Assert.IsTrue(result.Count == angles.Length * (tags.Length + 2));
}
}
}

+ 3
- 0
Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/RayPerceptionTests.cs.meta View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 29010426d01b4569830a85795f4f345b
timeCreated: 1552498773

Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/UtilitiesTests.cs → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/UtilitiesTests.cs View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Editor/Tests/UtilitiesTests.cs.meta → Assets/UnitySDK/Assets/ML-Agents/Editor/Tests/UtilitiesTests.cs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples.meta → Assets/UnitySDK/Assets/ML-Agents/Examples.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Brains.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardLearning.asset → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardLearning.asset View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardLearning.asset.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardLearning.asset.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardPlayer.asset → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardPlayer.asset View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardPlayer.asset.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHardPlayer.asset.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHeuristic.asset → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHeuristic.asset View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHeuristic.asset.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallHeuristic.asset.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallLearning.asset → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallLearning.asset View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallLearning.asset.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallLearning.asset.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallPlayer.asset → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallPlayer.asset View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallPlayer.asset.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Brains/3DBallPlayer.asset.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Materials.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo1.mat → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo1.mat View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo1.mat.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo1.mat.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo2.mat → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo2.mat View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo2.mat.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Materials/logo2.mat.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Materials/Text.mat → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Text.mat View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Materials/Text.mat.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/Text.mat.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Materials/logo.png → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/logo.png View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Materials/logo.png.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Materials/logo.png.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Prefabs.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Prefabs/Game.prefab → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/Game.prefab View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Prefabs/Game.prefab.meta → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/Game.prefab.meta View File


Assets/ML-Agents Unity SDK/Assets/ML-Agents/Examples/3DBall/Prefabs/GameHard.prefab → Assets/UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/GameHard.prefab View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save