浏览代码

[WIP] ISensor interface and use for visual observations (#2731)

* ISensor and SensorBase

* camera and rendertex first pass

* use isensors for visual obs

* Update gridworld with CameraSensors

* compressed obs for reals

* Remove AgentInfo.visualObservations

* better separation of train and inference sensor calls

* compressed obs proto - need CI to generate code

* int32

* get proto name right

* run protoc locally for new fiels

* apply generated proto patch (pyi files were weird)

* don't repeat bytes

* hook up compressedobs

* dont send BrainParameters until there's an AgentInfo

* python BrainParameters now needs an AgentInfo to create

* remove last (I hope) dependency on camerares

* remove CameraResolutions and AgentInfo.visual_observations

* update mypy-protobuf version

* cleanup todos

* python cleanup

* more unit test fixes

* more unit test fix

* camera sensors for VisualFood collector, record demo

* SensorCompon...
/develop-gpu-test
GitHub 5 年前
当前提交
0892ef2c
共有 80 个文件被更改,包括 1919 次插入2232 次删除
  1. 51
      UnitySDK/Assets/ML-Agents/Editor/AgentEditor.cs
  2. 113
      UnitySDK/Assets/ML-Agents/Editor/BrainParametersDrawer.cs
  3. 30
      UnitySDK/Assets/ML-Agents/Editor/DemonstrationDrawer.cs
  4. 2
      UnitySDK/Assets/ML-Agents/Editor/Tests/DemonstrationTests.cs
  5. 48
      UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs
  6. 5
      UnitySDK/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs
  7. 7
      UnitySDK/Assets/ML-Agents/Examples/Basic/Scripts/BasicDecision.cs
  8. 64
      UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Prefabs/VisualFoodCollectorArea.prefab
  9. 43
      UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector.unity
  10. 16
      UnitySDK/Assets/ML-Agents/Examples/GridWorld/Prefabs/Area.prefab
  11. 24
      UnitySDK/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity
  12. 20
      UnitySDK/Assets/ML-Agents/Examples/Hallway/Prefabs/VisualSymbolFinderArea.prefab
  13. 83
      UnitySDK/Assets/ML-Agents/Examples/Hallway/Scenes/VisualHallway.unity
  14. 20
      UnitySDK/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockVisualArea.prefab
  15. 63
      UnitySDK/Assets/ML-Agents/Examples/PushBlock/Scenes/VisualPushBlock.unity
  16. 20
      UnitySDK/Assets/ML-Agents/Examples/Pyramids/Prefabs/VisualAreaPyramids.prefab
  17. 83
      UnitySDK/Assets/ML-Agents/Examples/Pyramids/Scenes/VisualPyramids.unity
  18. 7
      UnitySDK/Assets/ML-Agents/Examples/Reacher/Scripts/ReacherDecision.cs
  19. 7
      UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/RandomDecision.cs
  20. 7
      UnitySDK/Assets/ML-Agents/Examples/Template/Scripts/TemplateDecision.cs
  21. 196
      UnitySDK/Assets/ML-Agents/Scripts/Agent.cs
  22. 43
      UnitySDK/Assets/ML-Agents/Scripts/Brain.cs
  23. 26
      UnitySDK/Assets/ML-Agents/Scripts/BrainParameters.cs
  24. 12
      UnitySDK/Assets/ML-Agents/Scripts/Decision.cs
  25. 69
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/AgentInfo.cs
  26. 44
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/BrainParameters.cs
  27. 9
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/SpaceType.cs
  28. 2
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/CompressedObservation.cs.meta
  29. 56
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/GrpcExtensions.cs
  30. 80
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/RpcCommunicator.cs
  31. 4
      UnitySDK/Assets/ML-Agents/Scripts/HeuristicBrain.cs
  32. 56
      UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/BarracudaModelParamLoader.cs
  33. 15
      UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/GeneratorImpl.cs
  34. 12
      UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/ModelRunner.cs
  35. 23
      UnitySDK/Assets/ML-Agents/Scripts/InferenceBrain/TensorGenerator.cs
  36. 67
      UnitySDK/Assets/ML-Agents/Scripts/Utilities.cs
  37. 24
      ml-agents-envs/mlagents/envs/brain.py
  38. 44
      ml-agents-envs/mlagents/envs/communicator_objects/agent_info_pb2.py
  39. 15
      ml-agents-envs/mlagents/envs/communicator_objects/agent_info_pb2.pyi
  40. 25
      ml-agents-envs/mlagents/envs/communicator_objects/brain_parameters_pb2.py
  41. 13
      ml-agents-envs/mlagents/envs/communicator_objects/brain_parameters_pb2.pyi
  42. 10
      ml-agents-envs/mlagents/envs/communicator_objects/space_type_pb2.py
  43. 38
      ml-agents-envs/mlagents/envs/environment.py
  44. 28
      ml-agents-envs/mlagents/envs/mock_communicator.py
  45. 7
      ml-agents/mlagents/trainers/demo_loader.py
  46. 27
      ml-agents/mlagents/trainers/tests/mock_brain.py
  47. 46
      ml-agents/mlagents/trainers/tests/test_bc.py
  48. 73
      ml-agents/mlagents/trainers/tests/test_ppo.py
  49. 75
      ml-agents/mlagents/trainers/tests/test_sac.py
  50. 1001
      ml-agents/mlagents/trainers/tests/testdcvis.demo
  51. 4
      protobuf-definitions/proto/mlagents/envs/communicator_objects/agent_info.proto
  52. 3
      protobuf-definitions/proto/mlagents/envs/communicator_objects/brain_parameters.proto
  53. 2
      protobuf-definitions/proto/mlagents/envs/communicator_objects/space_type.proto
  54. 234
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/CompressedObservation.cs
  55. 8
      UnitySDK/Assets/ML-Agents/Scripts/Sensor.meta
  56. 113
      ml-agents-envs/mlagents/envs/communicator_objects/compressed_observation_pb2.py
  57. 72
      ml-agents-envs/mlagents/envs/communicator_objects/compressed_observation_pb2.pyi
  58. 15
      protobuf-definitions/proto/mlagents/envs/communicator_objects/compressed_observation.proto
  59. 101
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensor.cs
  60. 11
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensor.cs.meta
  61. 19
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensorComponent.cs
  62. 11
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensorComponent.cs.meta
  63. 25
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/CompressedObservation.cs
  64. 11
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/CompressedObservation.cs.meta
  65. 54
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/ISensor.cs
  66. 11
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/ISensor.cs.meta
  67. 97
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensor.cs
  68. 11
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensor.cs.meta
  69. 19
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensorComponent.cs
  70. 11
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensorComponent.cs.meta
  71. 54
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/SensorBase.cs
  72. 11
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/SensorBase.cs.meta
  73. 18
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/SensorComponent.cs
  74. 11
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/SensorComponent.cs.meta
  75. 231
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/Resolution.cs
  76. 85
      ml-agents-envs/mlagents/envs/communicator_objects/resolution_pb2.py
  77. 45
      ml-agents-envs/mlagents/envs/communicator_objects/resolution_pb2.pyi
  78. 11
      protobuf-definitions/proto/mlagents/envs/communicator_objects/resolution.proto
  79. 0
      /UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/CompressedObservation.cs.meta

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


"agentParameters.resetOnDone");
var isOdd = serializedAgent.FindProperty(
"agentParameters.onDemandDecision");
var cameras = serializedAgent.FindProperty(
"agentParameters.agentCameras");
var renderTextures = serializedAgent.FindProperty(
"agentParameters.agentRenderTextures");
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 (var i = 0; i < cameras.arraySize; i++)
{
EditorGUILayout.PropertyField(
cameras.GetArrayElementAtIndex(i),
new GUIContent("Camera " + (i + 1) + ": "));
}
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Add Camera", EditorStyles.miniButton))
{
cameras.arraySize++;
}
if (GUILayout.Button("Remove Camera", EditorStyles.miniButton))
{
cameras.arraySize--;
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.LabelField("Agent RenderTextures");
for (var i = 0; i < renderTextures.arraySize; i++)
{
EditorGUILayout.PropertyField(
renderTextures.GetArrayElementAtIndex(i),
new GUIContent("RenderTexture " + (i + 1) + ": "));
}
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Add RenderTextures", EditorStyles.miniButton))
{
renderTextures.arraySize++;
}
if (GUILayout.Button("Remove RenderTextures", EditorStyles.miniButton))
{
renderTextures.arraySize--;
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.PropertyField(

113
UnitySDK/Assets/ML-Agents/Editor/BrainParametersDrawer.cs


// The height of a line in the Unity Inspectors
private const float k_LineHeight = 17f;
private const int k_VecObsNumLine = 3;
private const string k_CamResPropName = "cameraResolutions";
private const string k_CamWidthPropName = "width";
private const string k_CamHeightPropName = "height";
private const string k_CamGrayPropName = "blackAndWhite";
private const int k_DefaultCameraWidth = 84;
private const int k_DefaultCameraHeight = 84;
private const bool k_DefaultCameraGray = false;
/// <inheritdoc />
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)

return k_LineHeight +
GetHeightDrawVectorObservation() +
GetHeightDrawVisualObservation(property) +
GetHeightDrawVectorAction(property) +
GetHeightDrawVectorActionDescriptions(property);
}

DrawVectorObservation(position, property);
position.y += GetHeightDrawVectorObservation();
//Visual Observations
DrawVisualObservations(position, property);
position.y += GetHeightDrawVisualObservation(property);
// Vector Action
DrawVectorAction(position, property);
position.y += GetHeightDrawVectorAction(property);

private static float GetHeightDrawVectorObservation()
{
return k_VecObsNumLine * k_LineHeight;
}
/// <summary>
/// Draws the Visual Observations parameters for the Brain Parameters
/// </summary>
/// <param name="position">Rectangle on the screen to use for the property GUI.</param>
/// <param name="property">The SerializedProperty of the BrainParameters
/// to make the custom GUI for.</param>
private static void DrawVisualObservations(Rect position, SerializedProperty property)
{
EditorGUI.LabelField(position, "Visual Observations");
position.y += k_LineHeight;
var quarter = position.width / 4;
var resolutions = property.FindPropertyRelative(k_CamResPropName);
DrawVisualObsButtons(position, resolutions);
position.y += k_LineHeight;
// Display the labels for the columns : Index, Width, Height and Gray
var indexRect = new Rect(position.x, position.y, quarter, position.height);
var widthRect = new Rect(position.x + quarter, position.y, quarter, position.height);
var heightRect = new Rect(position.x + 2 * quarter, position.y, quarter, position.height);
var bwRect = new Rect(position.x + 3 * quarter, position.y, quarter, position.height);
EditorGUI.indentLevel++;
if (resolutions.arraySize > 0)
{
EditorGUI.LabelField(indexRect, "Index");
indexRect.y += k_LineHeight;
EditorGUI.LabelField(widthRect, "Width");
widthRect.y += k_LineHeight;
EditorGUI.LabelField(heightRect, "Height");
heightRect.y += k_LineHeight;
EditorGUI.LabelField(bwRect, "Gray");
bwRect.y += k_LineHeight;
}
// Iterate over the resolutions
for (var i = 0; i < resolutions.arraySize; i++)
{
EditorGUI.LabelField(indexRect, "Obs " + i);
indexRect.y += k_LineHeight;
var res = resolutions.GetArrayElementAtIndex(i);
var w = res.FindPropertyRelative("width");
w.intValue = EditorGUI.IntField(widthRect, w.intValue);
widthRect.y += k_LineHeight;
var h = res.FindPropertyRelative("height");
h.intValue = EditorGUI.IntField(heightRect, h.intValue);
heightRect.y += k_LineHeight;
var bw = res.FindPropertyRelative("blackAndWhite");
bw.boolValue = EditorGUI.Toggle(bwRect, bw.boolValue);
bwRect.y += k_LineHeight;
}
EditorGUI.indentLevel--;
}
/// <summary>
/// Draws the buttons to add and remove the visual observations parameters
/// </summary>
/// <param name="position">Rectangle on the screen to use for the property GUI.</param>
/// <param name="resolutions">The SerializedProperty of the resolution array
/// to make the custom GUI for.</param>
private static void DrawVisualObsButtons(Rect position, SerializedProperty resolutions)
{
var widthEighth = position.width / 8;
var addButtonRect = new Rect(position.x + widthEighth, position.y,
3 * widthEighth, position.height);
var removeButtonRect = new Rect(position.x + 4 * widthEighth, position.y,
3 * widthEighth, position.height);
if (resolutions.arraySize == 0)
{
addButtonRect.width *= 2;
}
// Display the buttons
if (GUI.Button(addButtonRect, "Add New", EditorStyles.miniButton))
{
resolutions.arraySize += 1;
var newRes = resolutions.GetArrayElementAtIndex(resolutions.arraySize - 1);
newRes.FindPropertyRelative(k_CamWidthPropName).intValue = k_DefaultCameraWidth;
newRes.FindPropertyRelative(k_CamHeightPropName).intValue = k_DefaultCameraHeight;
newRes.FindPropertyRelative(k_CamGrayPropName).boolValue = k_DefaultCameraGray;
}
if (resolutions.arraySize > 0)
{
if (GUI.Button(removeButtonRect, "Remove Last", EditorStyles.miniButton))
{
resolutions.arraySize -= 1;
}
}
}
/// <summary>
/// The Height required to draw the Visual Observations parameters
/// </summary>
/// <returns>The height of the drawer of the Visual Observations </returns>
private static float GetHeightDrawVisualObservation(SerializedProperty property)
{
var visObsSize = property.FindPropertyRelative(k_CamResPropName).arraySize + 2;
if (property.FindPropertyRelative(k_CamResPropName).arraySize > 0)
{
visObsSize += 1;
}
return k_LineHeight * visObsSize;
}
/// <summary>

30
UnitySDK/Assets/ML-Agents/Editor/DemonstrationDrawer.cs


return actionLabel.ToString();
}
/// <summary>
/// Constructs complex label for each CameraResolution object.
/// An example of this could be `[ 84 X 84 ]`
/// for a single camera with 84 pixels height and width.
/// </summary>
private static string BuildCameraResolutionLabel(SerializedProperty cameraArray)
{
var numCameras = cameraArray.arraySize;
var cameraLabel = new StringBuilder("[ ");
for (var i = 0; i < numCameras; i++)
{
var camHeightPropName =
cameraArray.GetArrayElementAtIndex(i).FindPropertyRelative("height");
cameraLabel.Append(camHeightPropName.intValue);
cameraLabel.Append(" X ");
var camWidthPropName =
cameraArray.GetArrayElementAtIndex(i).FindPropertyRelative("width");
cameraLabel.Append(camWidthPropName.intValue);
if (i < numCameras - 1)
{
cameraLabel.Append(", ");
}
}
cameraLabel.Append(" ]");
return cameraLabel.ToString();
}
/// <summary>
/// Renders Inspector UI for Brain Parameters of Demonstration.

var vecObsSizeProp = property.FindPropertyRelative("vectorObservationSize");
var numStackedProp = property.FindPropertyRelative("numStackedVectorObservations");
var actSizeProperty = property.FindPropertyRelative("vectorActionSize");
var camResProp = property.FindPropertyRelative("cameraResolutions");
var actSpaceTypeProp = property.FindPropertyRelative("vectorActionSpaceType");
var vecObsSizeLabel = vecObsSizeProp.displayName + ": " + vecObsSizeProp.intValue;

var camResLabel = camResProp.displayName + ": " + BuildCameraResolutionLabel(camResProp);
var actSpaceTypeLabel = actSpaceTypeProp.displayName + ": " +
(SpaceType)actSpaceTypeProp.enumValueIndex;

EditorGUILayout.LabelField(camResLabel);
EditorGUILayout.LabelField(actSpaceTypeLabel);
}

2
UnitySDK/Assets/ML-Agents/Editor/Tests/DemonstrationTests.cs


{
vectorObservationSize = 3,
numStackedVectorObservations = 2,
cameraResolutions = new[] {new Resolution()},
vectorActionDescriptions = new[] {"TestActionA", "TestActionB"},
vectorActionSize = new[] {2, 2},
vectorActionSpaceType = SpaceType.Discrete

var agentInfo = new AgentInfo
{
reward = 1f,
visualObservations = new List<Texture2D>(),
actionMasks = new[] {false, true},
done = true,
id = 5,

48
UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs


using UnityEngine;
using NUnit.Framework;
using System.Reflection;
using MLAgents.Sensor;
using MLAgents.InferenceBrain;
namespace MLAgents.Tests
{

public override void InitializeAgent()
{
initializeAgentCalls += 1;
// Add in some custom sensors so we can confirm they get sorted as expected.
var sensor1 = new TestSensor("testsensor1");
var sensor2 = new TestSensor("testsensor2");
m_Sensors.Add(sensor2);
m_Sensors.Add(sensor1);
}
public override void CollectObservations()

}
}
public class TestSensor : ISensor
{
public string sensorName;
public TestSensor(string n)
{
sensorName = n;
}
public int[] GetFloatObservationShape() {
return new[] {1};
}
public void WriteToTensor(TensorProxy tensorProxy, int agentIndex) { }
public byte[] GetCompressedObservation()
{
return null;
}
public CompressionType GetCompressionType()
{
return CompressionType.None;
}
public string GetName()
{
return sensorName;
}
}
// This is an empty class for testing the behavior of agents and academy
// It is left empty because we are not testing any brain behavior
public class TestBrain : Brain

Assert.AreEqual(1, agent2.initializeAgentCalls);
Assert.AreEqual(0, agent1.agentActionCalls);
Assert.AreEqual(0, agent2.agentActionCalls);
// Make sure the sensors were sorted
Assert.AreEqual(agent1.m_Sensors[0].GetName(), "testsensor1");
Assert.AreEqual(agent1.m_Sensors[1].GetName(), "testsensor2");
}
}

agent2.agentParameters.onDemandDecision = true;
// agent2 will request decisions only when RequestDecision is called
brain.brainParameters.vectorObservationSize = 0;
brain.brainParameters.cameraResolutions = new Resolution[0];
agent1.GiveBrain(brain);
agent2.GiveBrain(brain);

agent2.agentParameters.onDemandDecision = true;
// agent2 will request decisions only when RequestDecision is called
brain.brainParameters.vectorObservationSize = 0;
brain.brainParameters.cameraResolutions = new Resolution[0];
agent1.GiveBrain(brain);
agent2.GiveBrain(brain);

agent1.agentParameters.resetOnDone = false;
agent2.agentParameters.resetOnDone = false;
brain.brainParameters.vectorObservationSize = 0;
brain.brainParameters.cameraResolutions = new Resolution[0];
agent1.GiveBrain(brain);
agent2.GiveBrain(brain);

// agent2 will request decisions only when RequestDecision is called
agent1.agentParameters.maxStep = 20;
brain.brainParameters.vectorObservationSize = 0;
brain.brainParameters.cameraResolutions = new Resolution[0];
agent1.GiveBrain(brain);
agent2.GiveBrain(brain);

5
UnitySDK/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs


using System.Collections.Generic;
using UnityEngine;
using MLAgents;
using MLAgents.Sensor;
public class Ball3DDecision : Decision
{

List<float> vectorObs,
List<Texture2D> visualObs,
List<ISensor> sensors,
float reward,
bool done,
List<float> memory)

public override List<float> MakeMemory(
List<float> vectorObs,
List<Texture2D> visualObs,
List<ISensor> sensors,
float reward,
bool done,
List<float> memory)

7
UnitySDK/Assets/ML-Agents/Examples/Basic/Scripts/BasicDecision.cs


using System.Collections.Generic;
using System.Collections.Generic;
using MLAgents.Sensor;
List<Texture2D> visualObs,
List<ISensor> sensors,
float reward,
bool done,
List<float> memory)

public override List<float> MakeMemory(
List<float> vectorObs,
List<Texture2D> visualObs,
List<ISensor> sensors,
float reward,
bool done,
List<float> memory)

64
UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Prefabs/VisualFoodCollectorArea.prefab


- component: {fileID: 65932430430952094}
- component: {fileID: 54338553804475180}
- component: {fileID: 114080992426104682}
- component: {fileID: 114741414993459624}
m_Layer: 0
m_Name: Agent (3)
m_TagString: agent

- component: {fileID: 65178766753981896}
- component: {fileID: 54088750604404324}
- component: {fileID: 114257846618384398}
- component: {fileID: 114708558732651708}
m_Layer: 0
m_Name: Agent
m_TagString: agent

- component: {fileID: 65441205843344002}
- component: {fileID: 54753735395303746}
- component: {fileID: 114625025344622832}
- component: {fileID: 114401766178763868}
m_Layer: 0
m_Name: Agent (1)
m_TagString: agent

- component: {fileID: 65540878552782854}
- component: {fileID: 54626777054134360}
- component: {fileID: 114855044884614820}
- component: {fileID: 114778458791730518}
m_Layer: 0
m_Name: Agent (2)
m_TagString: agent

myLaser: {fileID: 1580603984718180}
contribute: 0
useVectorObs: 0
--- !u!114 &114401766178763868
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1661627863960872}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41cb6bf4b09974bf583f5b2fef0c08a7, type: 3}
m_Name:
m_EditorClassIdentifier:
camera: {fileID: 0}
width: 84
height: 84
grayscale: 0
--- !u!114 &114552799170750468
MonoBehaviour:
m_ObjectHideFlags: 1

myLaser: {fileID: 1335947341879056}
contribute: 0
useVectorObs: 0
--- !u!114 &114708558732651708
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1443673828307814}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41cb6bf4b09974bf583f5b2fef0c08a7, type: 3}
m_Name:
m_EditorClassIdentifier:
camera: {fileID: 0}
width: 84
height: 84
grayscale: 0
--- !u!114 &114741414993459624
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1169383371125934}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41cb6bf4b09974bf583f5b2fef0c08a7, type: 3}
m_Name:
m_EditorClassIdentifier:
camera: {fileID: 0}
width: 84
height: 84
grayscale: 0
--- !u!114 &114778458791730518
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1964761937961574}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41cb6bf4b09974bf583f5b2fef0c08a7, type: 3}
m_Name:
m_EditorClassIdentifier:
camera: {fileID: 0}
width: 84
height: 84
grayscale: 0
--- !u!114 &114855044884614820
MonoBehaviour:
m_ObjectHideFlags: 1

43
UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector.unity


propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 580f2003972f64189826f085e2498080, type: 3}
- target: {fileID: 114708558732651708, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1081822021}
- target: {fileID: 114401766178763868, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1081822020}
- target: {fileID: 114778458791730518, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1081822019}
- target: {fileID: 114741414993459624, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1081822018}
--- !u!20 &1081822018 stripped
Camera:
m_PrefabParentObject: {fileID: 20825339371991526, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 2}
m_PrefabInternal: {fileID: 1081822017}
--- !u!20 &1081822019 stripped
Camera:
m_PrefabParentObject: {fileID: 20416796192002010, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 2}
m_PrefabInternal: {fileID: 1081822017}
--- !u!20 &1081822020 stripped
Camera:
m_PrefabParentObject: {fileID: 20184829288622090, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 2}
m_PrefabInternal: {fileID: 1081822017}
--- !u!20 &1081822021 stripped
Camera:
m_PrefabParentObject: {fileID: 20890573870796418, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 2}
m_PrefabInternal: {fileID: 1081822017}
--- !u!1 &1086444495
GameObject:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: 4fe57113e76a5426297487dd6faadc5b, type: 3}
m_Name:
m_EditorClassIdentifier:
broadcastHub:
brainsToControl:
- {fileID: 11400000, guid: 24e823594179d48189b2c78003c50ce0, type: 2}
m_TrainingConfiguration:
width: 500
height: 500

16
UnitySDK/Assets/ML-Agents/Examples/GridWorld/Prefabs/Area.prefab


- component: {fileID: 33823710649932060}
- component: {fileID: 65073501172061214}
- component: {fileID: 114650561397225712}
- component: {fileID: 114399612900818788}
m_Layer: 8
m_Name: Agent
m_TagString: agent

serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &114399612900818788
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1488387672112076}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 282f342c2ab144bf38be65d4d0c4e07d, type: 3}
m_Name:
m_EditorClassIdentifier:
camera: {fileID: 20743940359151984}
width: 84
height: 84
grayscale: 0
--- !u!114 &114650561397225712
MonoBehaviour:
m_ObjectHideFlags: 1

24
UnitySDK/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44971162, g: 0.49977726, b: 0.5756362, a: 1}
m_IndirectSpecularColor: {r: 0.4497121, g: 0.49977785, b: 0.57563704, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

- component: {fileID: 125487789}
- component: {fileID: 125487788}
- component: {fileID: 125487787}
- component: {fileID: 125487790}
m_Layer: 8
m_Name: Agent
m_TagString: agent

m_EditorClassIdentifier:
brain: {fileID: 11400000, guid: 2c1d51b7167874f31beda0b0cf0af468, type: 2}
agentParameters:
agentCameras: []
agentRenderTextures:
- {fileID: 8400000, guid: 114608d5384404f89bff4b6f88432958, type: 2}
m_Area: {fileID: 1795599557}
area: {fileID: 1795599557}
timeBetweenDecisionsAtInference: 0.15
renderCamera: {fileID: 797520692}
maskActions: 1

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 125487785}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!114 &125487790
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 125487785}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 132e1194facb64429b007ea1edf562d0, type: 3}
m_Name:
m_EditorClassIdentifier:
renderTexture: {fileID: 8400000, guid: 114608d5384404f89bff4b6f88432958, type: 2}
sensorName: RenderTextureSensor
width: 84
height: 84
grayscale: 0
--- !u!1 &260425459
GameObject:
m_ObjectHideFlags: 0

20
UnitySDK/Assets/ML-Agents/Examples/Hallway/Prefabs/VisualSymbolFinderArea.prefab


- component: {fileID: 65678389736547598}
- component: {fileID: 54606255118850520}
- component: {fileID: 114451776683649118}
- component: {fileID: 114516857402348526}
m_Layer: 0
m_Name: Agent
m_TagString: agent

m_EditorClassIdentifier:
brain: {fileID: 11400000, guid: a36aad05c06144991a0a5e87de40d003, type: 2}
agentParameters:
agentCameras:
- {fileID: 20961984019151212}
agentRenderTextures: []
maxStep: 3000
resetOnDone: 1
onDemandDecision: 0

symbolO: {fileID: 1945451279398622}
symbolX: {fileID: 1162012575508818}
useVectorObs: 0
--- !u!114 &114516857402348526
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1234267001558658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 282f342c2ab144bf38be65d4d0c4e07d, type: 3}
m_Name:
m_EditorClassIdentifier:
camera: {fileID: 0}
sensorName: CameraSensor
width: 84
height: 84
grayscale: 0

83
UnitySDK/Assets/ML-Agents/Examples/Hallway/Scenes/VisualHallway.unity


value:
objectReference: {fileID: 11400000, guid: fe56dd72ed38a4c2fb5419aba1e2d5f2,
type: 2}
- target: {fileID: 114516857402348526, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 32612447}
--- !u!20 &32612447 stripped
Camera:
m_PrefabParentObject: {fileID: 20309822448307506, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
m_PrefabInternal: {fileID: 32612446}
--- !u!1 &255077123
GameObject:
m_ObjectHideFlags: 0

value:
objectReference: {fileID: 11400000, guid: fe56dd72ed38a4c2fb5419aba1e2d5f2,
type: 2}
- target: {fileID: 114516857402348526, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 341018563}
--- !u!20 &341018563 stripped
Camera:
m_PrefabParentObject: {fileID: 20309822448307506, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
m_PrefabInternal: {fileID: 341018562}
--- !u!1 &365376270
GameObject:
m_ObjectHideFlags: 0

value:
objectReference: {fileID: 11400000, guid: fe56dd72ed38a4c2fb5419aba1e2d5f2,
type: 2}
- target: {fileID: 114516857402348526, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 721234460}
--- !u!20 &721234460 stripped
Camera:
m_PrefabParentObject: {fileID: 20309822448307506, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
m_PrefabInternal: {fileID: 721234459}
--- !u!1001 &977960505
Prefab:
m_ObjectHideFlags: 0

value:
objectReference: {fileID: 11400000, guid: fe56dd72ed38a4c2fb5419aba1e2d5f2,
type: 2}
- target: {fileID: 114516857402348526, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 977960506}
--- !u!20 &977960506 stripped
Camera:
m_PrefabParentObject: {fileID: 20309822448307506, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
m_PrefabInternal: {fileID: 977960505}
--- !u!1 &1257687048
GameObject:
m_ObjectHideFlags: 0

value:
objectReference: {fileID: 11400000, guid: fe56dd72ed38a4c2fb5419aba1e2d5f2,
type: 2}
- target: {fileID: 114516857402348526, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1353330548}
--- !u!20 &1353330548 stripped
Camera:
m_PrefabParentObject: {fileID: 20309822448307506, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
m_PrefabInternal: {fileID: 1353330547}
--- !u!1001 &1388008248
Prefab:
m_ObjectHideFlags: 0

value:
objectReference: {fileID: 11400000, guid: fe56dd72ed38a4c2fb5419aba1e2d5f2,
type: 2}
- target: {fileID: 114516857402348526, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1388008249}
--- !u!20 &1388008249 stripped
Camera:
m_PrefabParentObject: {fileID: 20309822448307506, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
m_PrefabInternal: {fileID: 1388008248}
--- !u!1001 &1436760868
Prefab:
m_ObjectHideFlags: 0

value:
objectReference: {fileID: 11400000, guid: fe56dd72ed38a4c2fb5419aba1e2d5f2,
type: 2}
- target: {fileID: 114516857402348526, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1436760869}
--- !u!20 &1436760869 stripped
Camera:
m_PrefabParentObject: {fileID: 20309822448307506, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
m_PrefabInternal: {fileID: 1436760868}
--- !u!1 &1574236047
GameObject:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: 40db664a3061b46a0a0628f90b2264f7, type: 3}
m_Name:
m_EditorClassIdentifier:
broadcastHub:
brainsToControl:
- {fileID: 11400000, guid: fe56dd72ed38a4c2fb5419aba1e2d5f2, type: 2}
m_TrainingConfiguration:
width: 128
height: 128

value:
objectReference: {fileID: 11400000, guid: fe56dd72ed38a4c2fb5419aba1e2d5f2,
type: 2}
- target: {fileID: 114516857402348526, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1746153507}
--- !u!20 &1746153507 stripped
Camera:
m_PrefabParentObject: {fileID: 20309822448307506, guid: f2281a3adc3e640b490f89407c2e12d1,
type: 2}
m_PrefabInternal: {fileID: 1746153506}
--- !u!1001 &2025898844
Prefab:
m_ObjectHideFlags: 0

20
UnitySDK/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockVisualArea.prefab


- component: {fileID: 114812843792483960}
- component: {fileID: 114650520402303970}
- component: {fileID: 65891831092422300}
- component: {fileID: 114024228081418500}
m_Layer: 0
m_Name: Agent
m_TagString: agent

serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &114024228081418500
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1626010291821672}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 282f342c2ab144bf38be65d4d0c4e07d, type: 3}
m_Name:
m_EditorClassIdentifier:
camera: {fileID: 0}
sensorName: CameraSensor
width: 84
height: 84
grayscale: 0
--- !u!114 &114650520402303970
MonoBehaviour:
m_ObjectHideFlags: 1

m_EditorClassIdentifier:
brain: {fileID: 11400000, guid: cc62140bff6494e0399caaed0b56020d, type: 2}
agentParameters:
agentCameras:
- {fileID: 20961401228419460}
agentRenderTextures: []
maxStep: 5000
resetOnDone: 1
onDemandDecision: 0

63
UnitySDK/Assets/ML-Agents/Examples/PushBlock/Scenes/VisualPushBlock.unity


value:
objectReference: {fileID: 11400000, guid: d359d2290a825421e930c94284994e3f,
type: 2}
- target: {fileID: 114024228081418500, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 116640260}
--- !u!20 &116640260 stripped
Camera:
m_PrefabParentObject: {fileID: 20961401228419460, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
m_PrefabInternal: {fileID: 116640259}
--- !u!1 &255077123
GameObject:
m_ObjectHideFlags: 0

value:
objectReference: {fileID: 11400000, guid: d359d2290a825421e930c94284994e3f,
type: 2}
- target: {fileID: 114024228081418500, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 731659952}
--- !u!20 &731659952 stripped
Camera:
m_PrefabParentObject: {fileID: 20961401228419460, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
m_PrefabInternal: {fileID: 731659951}
--- !u!1 &762086410
GameObject:
m_ObjectHideFlags: 0

value:
objectReference: {fileID: 11400000, guid: d359d2290a825421e930c94284994e3f,
type: 2}
- target: {fileID: 114024228081418500, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 912811241}
--- !u!20 &912811241 stripped
Camera:
m_PrefabParentObject: {fileID: 20961401228419460, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
m_PrefabInternal: {fileID: 912811240}
--- !u!1 &1009000883
GameObject:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: a2ca406dad5ec4ede8184998f4f9067d, type: 3}
m_Name:
m_EditorClassIdentifier:
broadcastHub:
brainsToControl:
- {fileID: 11400000, guid: d359d2290a825421e930c94284994e3f, type: 2}
m_TrainingConfiguration:
width: 1280
height: 720

value:
objectReference: {fileID: 11400000, guid: d359d2290a825421e930c94284994e3f,
type: 2}
- target: {fileID: 114024228081418500, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1878756100}
--- !u!20 &1878756100 stripped
Camera:
m_PrefabParentObject: {fileID: 20961401228419460, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
m_PrefabInternal: {fileID: 1878756099}
--- !u!1001 &1942601654
Prefab:
m_ObjectHideFlags: 0

value:
objectReference: {fileID: 11400000, guid: d359d2290a825421e930c94284994e3f,
type: 2}
- target: {fileID: 114024228081418500, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1942601655}
--- !u!20 &1942601655 stripped
Camera:
m_PrefabParentObject: {fileID: 20961401228419460, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
m_PrefabInternal: {fileID: 1942601654}
--- !u!1001 &1954420364
Prefab:
m_ObjectHideFlags: 0

value:
objectReference: {fileID: 11400000, guid: d359d2290a825421e930c94284994e3f,
type: 2}
- target: {fileID: 114024228081418500, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1954420365}
--- !u!20 &1954420365 stripped
Camera:
m_PrefabParentObject: {fileID: 20961401228419460, guid: 9d9b85a2a80e74e5294bdfb248825335,
type: 2}
m_PrefabInternal: {fileID: 1954420364}
--- !u!1001 &1969300026
Prefab:
m_ObjectHideFlags: 0

20
UnitySDK/Assets/ML-Agents/Examples/Pyramids/Prefabs/VisualAreaPyramids.prefab


- component: {fileID: 114741503533626942}
- component: {fileID: 114027965503222182}
- component: {fileID: 65882754134362954}
- component: {fileID: 114538851081060382}
m_Layer: 0
m_Name: Agent
m_TagString: agent

onMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}
offMaterial: {fileID: 2100000, guid: 5c59bd36def9a4684be49a21cf201a2d, type: 2}
myButton: {fileID: 1756074776765382}
--- !u!114 &114538851081060382
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1736680821577442}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 282f342c2ab144bf38be65d4d0c4e07d, type: 3}
m_Name:
m_EditorClassIdentifier:
camera: {fileID: 0}
sensorName: CameraSensor
width: 84
height: 84
grayscale: 0
--- !u!114 &114659265491970150
MonoBehaviour:
m_ObjectHideFlags: 1

m_EditorClassIdentifier:
brain: {fileID: 11400000, guid: 60f0ffcd08c3b43a6bdc746cfc0c4059, type: 2}
agentParameters:
agentCameras:
- {fileID: 20712684238256298}
agentRenderTextures: []
maxStep: 5000
resetOnDone: 1
onDemandDecision: 0

83
UnitySDK/Assets/ML-Agents/Examples/Pyramids/Scenes/VisualPyramids.unity


propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: 114538851081060382, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 133343957}
--- !u!20 &133343957 stripped
Camera:
m_PrefabParentObject: {fileID: 20712684238256298, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
m_PrefabInternal: {fileID: 133343956}
--- !u!20 &177604012 stripped
Camera:
m_PrefabParentObject: {fileID: 20712684238256298, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
m_PrefabInternal: {fileID: 309299717}
--- !u!1001 &281839921
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114538851081060382, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 973199703}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 0567215293abe487b932aec366b57c8e, type: 2}
m_IsPrefabParent: 0

propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114538851081060382, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 177604012}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 0567215293abe487b932aec366b57c8e, type: 2}
m_IsPrefabParent: 0

propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114538851081060382, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1529303581}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 0567215293abe487b932aec366b57c8e, type: 2}
m_IsPrefabParent: 0

propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114538851081060382, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 816767823}
--- !u!20 &816767823 stripped
Camera:
m_PrefabParentObject: {fileID: 20712684238256298, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
m_PrefabInternal: {fileID: 816767822}
--- !u!20 &828837071 stripped
Camera:
m_PrefabParentObject: {fileID: 20712684238256298, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
m_PrefabInternal: {fileID: 1728325040}
--- !u!20 &973199703 stripped
Camera:
m_PrefabParentObject: {fileID: 20712684238256298, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
m_PrefabInternal: {fileID: 281839921}
--- !u!1 &1009000883
GameObject:
m_ObjectHideFlags: 0

m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!20 &1074152210 stripped
Camera:
m_PrefabParentObject: {fileID: 20712684238256298, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
m_PrefabInternal: {fileID: 1818326666}
--- !u!1001 &1155497957
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114538851081060382, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1194295937}
--- !u!20 &1194295937 stripped
Camera:
m_PrefabParentObject: {fileID: 20712684238256298, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
m_PrefabInternal: {fileID: 1155497957}
--- !u!20 &1529303581 stripped
Camera:
m_PrefabParentObject: {fileID: 20712684238256298, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
m_PrefabInternal: {fileID: 714012435}
--- !u!1 &1574236047
GameObject:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: dba8df9c8b16946dc88d331a301d0ab3, type: 3}
m_Name:
m_EditorClassIdentifier:
broadcastHub:
brainsToControl:
- {fileID: 11400000, guid: 60f0ffcd08c3b43a6bdc746cfc0c4059, type: 2}
m_TrainingConfiguration:
width: 80
height: 80

propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114538851081060382, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 828837071}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 0567215293abe487b932aec366b57c8e, type: 2}
m_IsPrefabParent: 0

propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114538851081060382, guid: 0567215293abe487b932aec366b57c8e,
type: 2}
propertyPath: camera
value:
objectReference: {fileID: 1074152210}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 0567215293abe487b932aec366b57c8e, type: 2}
m_IsPrefabParent: 0

7
UnitySDK/Assets/ML-Agents/Examples/Reacher/Scripts/ReacherDecision.cs


using System.Collections.Generic;
using System.Collections.Generic;
using MLAgents.Sensor;
public override float[] Decide(List<float> state, List<Texture2D> observation, float reward, bool done, List<float> memory)
public override float[] Decide(List<float> state, List<ISensor> sensors, float reward, bool done, List<float> memory)
{
var action = new float[4];
for (var i = 0; i < 4; i++)

return action;
}
public override List<float> MakeMemory(List<float> state, List<Texture2D> observation, float reward, bool done, List<float> memory)
public override List<float> MakeMemory(List<float> state, List<ISensor> sensors, float reward, bool done, List<float> memory)
{
return new List<float>();
}

7
UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/RandomDecision.cs


using System.Collections.Generic;
using System.Collections.Generic;
using MLAgents.Sensor;
using UnityEngine;
namespace MLAgents

public override float[] Decide(
List<float> vectorObs,
List<Texture2D> visualObs,
List<ISensor> sensors,
float reward,
bool done,
List<float> memory)

public override List<float> MakeMemory(
List<float> vectorObs,
List<Texture2D> visualObs,
List<ISensor> sensors,
float reward,
bool done,
List<float> memory)

7
UnitySDK/Assets/ML-Agents/Examples/Template/Scripts/TemplateDecision.cs


using System.Collections.Generic;
using System.Collections.Generic;
using MLAgents.Sensor;
List<Texture2D> visualObs,
List<ISensor> sensors,
float reward,
bool done,
List<float> memory)

public override List<float> MakeMemory(
List<float> vectorObs,
List<Texture2D> visualObs,
List<ISensor> sensors,
float reward,
bool done,
List<float> memory)

196
UnitySDK/Assets/ML-Agents/Scripts/Agent.cs


using System.Collections.Generic;
using UnityEngine;
using MLAgents.Sensor;
namespace MLAgents

public List<float> stackedVectorObservation;
/// <summary>
/// Most recent agent camera (i.e. texture) observation.
/// Most recent compressed observations.
public List<Texture2D> visualObservations;
public List<CompressedObservation> compressedObservations;
/// <summary>
/// Most recent text observation.

/// TODO(cgoy): All references to protobuf objects should be removed.
/// </summary>
public CommunicatorObjects.CustomObservationProto customObservation;
/// <summary>
/// Remove the visual observations from memory. Call at each timestep
/// to avoid memory leaks.
/// </summary>
public void ClearVisualObs()
{
foreach (var obs in visualObservations)
{
Object.Destroy(obs);
}
visualObservations.Clear();
}
}
/// <summary>

public class AgentParameters
{
/// <summary>
/// The list of the Camera GameObjects the agent uses for visual
/// observations.
/// </summary>
public List<Camera> agentCameras = new List<Camera>();
/// <summary>
/// The list of the RenderTextures the agent uses for visual
/// observations.
/// </summary>
public List<RenderTexture> agentRenderTextures = new List<RenderTexture>();
/// <summary>
/// The maximum number of steps the agent takes before being done.
/// </summary>
/// <remarks>

/// </summary>
private DemonstrationRecorder m_Recorder;
public List<ISensor> m_Sensors;
/// Monobehavior function that is called when the attached GameObject
/// becomes enabled or active.
void OnEnable()

{
m_Info = new AgentInfo();
m_Action = new AgentAction();
m_Sensors = new List<ISensor>();
if (academy == null)
{

}
InitializeAgent();
InitializeSensors();
}
/// Monobehavior function that is called when the attached GameObject

new float[param.vectorObservationSize
* param.numStackedVectorObservations]);
m_Info.visualObservations = new List<Texture2D>();
m_Info.compressedObservations = new List<CompressedObservation>();
m_Info.customObservation = null;
}

}
/// <summary>
/// Set up the list of ISensors on the Agent. By default, this will select any
/// SensorBase's attached to the Agent.
/// </summary>
public void InitializeSensors()
{
var attachedSensorComponents = GetComponents<SensorComponent>();
m_Sensors.Capacity += attachedSensorComponents.Length;
foreach (var component in attachedSensorComponents)
{
m_Sensors.Add(component.CreateSensor());
}
// Sort the sensors by name to ensure determinism
m_Sensors.Sort((x, y) => x.GetName().CompareTo(y.GetName()));
#if DEBUG
// Make sure the names are actually unique
for (var i = 0; i < m_Sensors.Count - 1; i++)
{
Debug.Assert(!m_Sensors[i].GetName().Equals(m_Sensors[i+1].GetName()), "Sensor names must be unique.");
}
#endif
}
/// <summary>
/// Sends the Agent info to the linked Brain.
/// </summary>
void SendInfoToBrain()

m_Info.storedVectorActions = m_Action.vectorActions;
m_Info.storedTextActions = m_Action.textActions;
m_Info.vectorObservation.Clear();
m_Info.compressedObservations.Clear();
m_ActionMasker.ResetMask();
using (TimerStack.Instance.Scoped("CollectObservations"))
{

Utilities.ReplaceRange(m_Info.stackedVectorObservation, m_Info.vectorObservation,
m_Info.stackedVectorObservation.Count - m_Info.vectorObservation.Count);
m_Info.visualObservations.Clear();
var visualObservationCount = agentParameters.agentCameras.Count + agentParameters.agentRenderTextures.Count;
if (param.cameraResolutions.Length > visualObservationCount)
{
throw new UnityAgentsException(string.Format(
"Not enough cameras/renderTextures for agent {0} : Brain {1} expecting at " +
"least {2} cameras/renderTextures but only {3} were present.",
gameObject.name, brain.name,
brain.brainParameters.cameraResolutions.Length,
visualObservationCount));
}
//First add all cameras
for (var i = 0; i < agentParameters.agentCameras.Count; i++)
{
var obsTexture = ObservationToTexture(
agentParameters.agentCameras[i],
param.cameraResolutions[i].width,
param.cameraResolutions[i].height);