Andrew Cohen
5 年前
当前提交
573b1f6d
共有 214 个文件被更改,包括 1307 次插入 和 879 次删除
-
6.pre-commit-config.yaml
-
2Project/Assets/ML-Agents/Examples/3DBall/Demos/Expert3DBall.demo.meta
-
2Project/Assets/ML-Agents/Examples/3DBall/Demos/Expert3DBallHard.demo.meta
-
2Project/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DAgent.cs
-
2Project/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DHardAgent.cs
-
2Project/Assets/ML-Agents/Examples/Basic/Demos/ExpertBasic.demo.meta
-
53Project/Assets/ML-Agents/Examples/Basic/Scenes/Basic.unity
-
2Project/Assets/ML-Agents/Examples/Bouncer/Demos/ExpertBouncer.demo.meta
-
2Project/Assets/ML-Agents/Examples/Bouncer/Scripts/BouncerAgent.cs
-
2Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerDyn.demo.meta
-
2Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerSta.demo.meta
-
1Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs
-
2Project/Assets/ML-Agents/Examples/FoodCollector/Demos/ExpertFood.demo.meta
-
1Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs
-
2Project/Assets/ML-Agents/Examples/GridWorld/Demos/ExpertGrid.demo.meta
-
54Project/Assets/ML-Agents/Examples/GridWorld/Scripts/GridAgent.cs
-
1Project/Assets/ML-Agents/Examples/GridWorld/Scripts/GridArea.cs
-
2Project/Assets/ML-Agents/Examples/Hallway/Demos/ExpertHallway.demo.meta
-
1Project/Assets/ML-Agents/Examples/Hallway/Scripts/HallwayAgent.cs
-
2Project/Assets/ML-Agents/Examples/PushBlock/Demos/ExpertPush.demo.meta
-
2Project/Assets/ML-Agents/Examples/Pyramids/Demos/ExpertPyramid.demo.meta
-
1Project/Assets/ML-Agents/Examples/Pyramids/Scripts/PyramidAgent.cs
-
2Project/Assets/ML-Agents/Examples/Reacher/Demos/ExpertReacher.demo.meta
-
1Project/Assets/ML-Agents/Examples/Reacher/Scripts/ReacherAgent.cs
-
11Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ModelOverrider.cs
-
6Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs
-
1Project/Assets/ML-Agents/Examples/Template/Scripts/TemplateAgent.cs
-
2Project/Assets/ML-Agents/Examples/Tennis/Demos/ExpertTennis.demo.meta
-
2Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs
-
2Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalker.demo.meta
-
2Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs
-
2Project/Assets/ML-Agents/Examples/WallJump/Scripts/WallJumpAgent.cs
-
5Project/ProjectSettings/EditorBuildSettings.asset
-
3README.md
-
21com.unity.ml-agents/CHANGELOG.md
-
4com.unity.ml-agents/Editor/AgentEditor.cs
-
11com.unity.ml-agents/Editor/BehaviorParametersEditor.cs
-
3com.unity.ml-agents/Editor/BrainParametersDrawer.cs
-
153com.unity.ml-agents/Editor/DemonstrationDrawer.cs
-
3com.unity.ml-agents/Editor/DemonstrationImporter.cs
-
6com.unity.ml-agents/Editor/RayPerceptionSensorComponentBaseEditor.cs
-
982com.unity.ml-agents/Plugins/ProtoBuffer/System.Interactive.Async.dll
-
28com.unity.ml-agents/Runtime/Academy.cs
-
130com.unity.ml-agents/Runtime/Agent.cs
-
12com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs
-
23com.unity.ml-agents/Runtime/Communicator/ICommunicator.cs
-
34com.unity.ml-agents/Runtime/Communicator/RpcCommunicator.cs
-
3com.unity.ml-agents/Runtime/Demonstrations/Demonstration.cs
-
15com.unity.ml-agents/Runtime/Demonstrations/DemonstrationRecorder.cs
-
6com.unity.ml-agents/Runtime/Demonstrations/DemonstrationWriter.cs
-
74com.unity.ml-agents/Runtime/Grpc/CommunicatorObjects/UnityRlInitializationInput.cs
-
79com.unity.ml-agents/Runtime/Grpc/CommunicatorObjects/UnityRlInitializationOutput.cs
-
34com.unity.ml-agents/Runtime/Timer.cs
-
1com.unity.ml-agents/Runtime/Utilities.cs
-
2com.unity.ml-agents/Runtime/SideChannels/SideChannel.cs
-
2com.unity.ml-agents/Runtime/SideChannels/RawBytesChannel.cs
-
2com.unity.ml-agents/Runtime/SideChannels/FloatPropertiesChannel.cs
-
2com.unity.ml-agents/Runtime/SideChannels/EngineConfigurationChannel.cs
-
4com.unity.ml-agents/Runtime/Sensors/WriteAdapter.cs
-
2com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs
-
2com.unity.ml-agents/Runtime/Sensors/StackingSensor.cs
-
6com.unity.ml-agents/Runtime/Sensors/SensorShapeValidator.cs
-
2com.unity.ml-agents/Runtime/Sensors/SensorComponent.cs
-
2com.unity.ml-agents/Runtime/Sensors/SensorBase.cs
-
2com.unity.ml-agents/Runtime/Sensors/RenderTextureSensorComponent.cs
-
6com.unity.ml-agents/Runtime/Sensors/RenderTextureSensor.cs
-
4com.unity.ml-agents/Runtime/Sensors/RayPerceptionSensorComponentBase.cs
-
2com.unity.ml-agents/Runtime/Sensors/RayPerceptionSensorComponent3D.cs
-
2com.unity.ml-agents/Runtime/Sensors/RayPerceptionSensorComponent2D.cs
-
4com.unity.ml-agents/Runtime/Sensors/RayPerceptionSensor.cs
-
3com.unity.ml-agents/Runtime/Sensors/Observation.cs
-
2com.unity.ml-agents/Runtime/Sensors/ISensor.cs
-
2com.unity.ml-agents/Runtime/Sensors/CameraSensorComponent.cs
-
20com.unity.ml-agents/Runtime/Sensors/CameraSensor.cs
-
3com.unity.ml-agents/Runtime/Policies/RemotePolicy.cs
-
3com.unity.ml-agents/Runtime/Policies/IPolicy.cs
-
92com.unity.ml-agents/Runtime/Policies/HeuristicPolicy.cs
-
6com.unity.ml-agents/Runtime/Policies/BrainParameters.cs
-
21com.unity.ml-agents/Runtime/Policies/BehaviorParameters.cs
-
7com.unity.ml-agents/Runtime/Policies/BarracudaPolicy.cs
-
2com.unity.ml-agents/Runtime/Inference/Utils/RandomNormal.cs
-
2com.unity.ml-agents/Runtime/Inference/Utils/Multinomial.cs
-
4com.unity.ml-agents/Runtime/Inference/TensorProxy.cs
-
4com.unity.ml-agents/Runtime/Inference/TensorNames.cs
-
5com.unity.ml-agents/Runtime/Inference/TensorGenerator.cs
-
4com.unity.ml-agents/Runtime/Inference/TensorApplier.cs
-
5com.unity.ml-agents/Runtime/Inference/ModelRunner.cs
-
7com.unity.ml-agents/Runtime/Inference/GeneratorImpl.cs
-
9com.unity.ml-agents/Runtime/Inference/BarracudaModelParamLoader.cs
-
4com.unity.ml-agents/Runtime/Inference/ApplierImpl.cs
-
5com.unity.ml-agents/Tests/Editor/DemonstrationTests.cs
-
4com.unity.ml-agents/Tests/Editor/DiscreteActionOutputApplierTest.cs
-
41com.unity.ml-agents/Tests/Editor/EditModeTestActionMasker.cs
-
5com.unity.ml-agents/Tests/Editor/EditModeTestInternalBrainTensorApplier.cs
-
8com.unity.ml-agents/Tests/Editor/EditModeTestInternalBrainTensorGenerator.cs
-
58com.unity.ml-agents/Tests/Editor/MLAgentsEditModeTest.cs
-
2com.unity.ml-agents/Tests/Editor/MultinomialTest.cs
-
2com.unity.ml-agents/Tests/Editor/RandomNormalTest.cs
-
2com.unity.ml-agents/Tests/Editor/Sensor/FloatVisualSensorTests.cs
-
1com.unity.ml-agents/Tests/Editor/Sensor/RayPerceptionSensorTests.cs
|
|||
using System.Text; |
|||
using MLAgents; |
|||
|
|||
/// <summary>
|
|||
/// Renders a custom UI for Demonstration Scriptable Object.
|
|||
/// </summary>
|
|||
[CustomEditor(typeof(Demonstration))] |
|||
[CanEditMultipleObjects] |
|||
internal class DemonstrationEditor : Editor |
|||
{ |
|||
SerializedProperty m_BrainParameters; |
|||
SerializedProperty m_DemoMetaData; |
|||
using MLAgents.Demonstrations; |
|||
using MLAgents.Policies; |
|||
void OnEnable() |
|||
{ |
|||
m_BrainParameters = serializedObject.FindProperty("brainParameters"); |
|||
m_DemoMetaData = serializedObject.FindProperty("metaData"); |
|||
} |
|||
namespace MLAgents.Editor |
|||
{ |
|||
/// Renders Inspector UI for Demonstration metadata.
|
|||
/// Renders a custom UI for Demonstration Scriptable Object.
|
|||
void MakeMetaDataProperty(SerializedProperty property) |
|||
[CustomEditor(typeof(Demonstration))] |
|||
[CanEditMultipleObjects] |
|||
internal class DemonstrationEditor : UnityEditor.Editor |
|||
var nameProp = property.FindPropertyRelative("demonstrationName"); |
|||
var expProp = property.FindPropertyRelative("numberExperiences"); |
|||
var epiProp = property.FindPropertyRelative("numberEpisodes"); |
|||
var rewProp = property.FindPropertyRelative("meanReward"); |
|||
SerializedProperty m_BrainParameters; |
|||
SerializedProperty m_DemoMetaData; |
|||
|
|||
void OnEnable() |
|||
{ |
|||
m_BrainParameters = serializedObject.FindProperty("brainParameters"); |
|||
m_DemoMetaData = serializedObject.FindProperty("metaData"); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Renders Inspector UI for Demonstration metadata.
|
|||
/// </summary>
|
|||
void MakeMetaDataProperty(SerializedProperty property) |
|||
{ |
|||
var nameProp = property.FindPropertyRelative("demonstrationName"); |
|||
var expProp = property.FindPropertyRelative("numberExperiences"); |
|||
var epiProp = property.FindPropertyRelative("numberEpisodes"); |
|||
var rewProp = property.FindPropertyRelative("meanReward"); |
|||
var nameLabel = nameProp.displayName + ": " + nameProp.stringValue; |
|||
var expLabel = expProp.displayName + ": " + expProp.intValue; |
|||
var epiLabel = epiProp.displayName + ": " + epiProp.intValue; |
|||
var rewLabel = rewProp.displayName + ": " + rewProp.floatValue; |
|||
var nameLabel = nameProp.displayName + ": " + nameProp.stringValue; |
|||
var expLabel = expProp.displayName + ": " + expProp.intValue; |
|||
var epiLabel = epiProp.displayName + ": " + epiProp.intValue; |
|||
var rewLabel = rewProp.displayName + ": " + rewProp.floatValue; |
|||
EditorGUILayout.LabelField(nameLabel); |
|||
EditorGUILayout.LabelField(expLabel); |
|||
EditorGUILayout.LabelField(epiLabel); |
|||
EditorGUILayout.LabelField(rewLabel); |
|||
} |
|||
EditorGUILayout.LabelField(nameLabel); |
|||
EditorGUILayout.LabelField(expLabel); |
|||
EditorGUILayout.LabelField(epiLabel); |
|||
EditorGUILayout.LabelField(rewLabel); |
|||
} |
|||
/// <summary>
|
|||
/// Constructs label for action size array.
|
|||
/// </summary>
|
|||
static string BuildActionArrayLabel(SerializedProperty actionSizeProperty) |
|||
{ |
|||
var actionSize = actionSizeProperty.arraySize; |
|||
var actionLabel = new StringBuilder("[ "); |
|||
for (var i = 0; i < actionSize; i++) |
|||
/// <summary>
|
|||
/// Constructs label for action size array.
|
|||
/// </summary>
|
|||
static string BuildActionArrayLabel(SerializedProperty actionSizeProperty) |
|||
actionLabel.Append(actionSizeProperty.GetArrayElementAtIndex(i).intValue); |
|||
if (i < actionSize - 1) |
|||
var actionSize = actionSizeProperty.arraySize; |
|||
var actionLabel = new StringBuilder("[ "); |
|||
for (var i = 0; i < actionSize; i++) |
|||
actionLabel.Append(", "); |
|||
actionLabel.Append(actionSizeProperty.GetArrayElementAtIndex(i).intValue); |
|||
if (i < actionSize - 1) |
|||
{ |
|||
actionLabel.Append(", "); |
|||
} |
|||
|
|||
actionLabel.Append(" ]"); |
|||
return actionLabel.ToString(); |
|||
actionLabel.Append(" ]"); |
|||
return actionLabel.ToString(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Renders Inspector UI for Brain Parameters of Demonstration.
|
|||
/// </summary>
|
|||
void MakeBrainParametersProperty(SerializedProperty property) |
|||
{ |
|||
var vecObsSizeProp = property.FindPropertyRelative("vectorObservationSize"); |
|||
var numStackedProp = property.FindPropertyRelative("numStackedVectorObservations"); |
|||
var actSizeProperty = property.FindPropertyRelative("vectorActionSize"); |
|||
var actSpaceTypeProp = property.FindPropertyRelative("vectorActionSpaceType"); |
|||
/// <summary>
|
|||
/// Renders Inspector UI for Brain Parameters of Demonstration.
|
|||
/// </summary>
|
|||
void MakeBrainParametersProperty(SerializedProperty property) |
|||
{ |
|||
var vecObsSizeProp = property.FindPropertyRelative("vectorObservationSize"); |
|||
var numStackedProp = property.FindPropertyRelative("numStackedVectorObservations"); |
|||
var actSizeProperty = property.FindPropertyRelative("vectorActionSize"); |
|||
var actSpaceTypeProp = property.FindPropertyRelative("vectorActionSpaceType"); |
|||
var vecObsSizeLabel = vecObsSizeProp.displayName + ": " + vecObsSizeProp.intValue; |
|||
var numStackedLabel = numStackedProp.displayName + ": " + numStackedProp.intValue; |
|||
var vecActSizeLabel = |
|||
actSizeProperty.displayName + ": " + BuildActionArrayLabel(actSizeProperty); |
|||
var actSpaceTypeLabel = actSpaceTypeProp.displayName + ": " + |
|||
(SpaceType)actSpaceTypeProp.enumValueIndex; |
|||
var vecObsSizeLabel = vecObsSizeProp.displayName + ": " + vecObsSizeProp.intValue; |
|||
var numStackedLabel = numStackedProp.displayName + ": " + numStackedProp.intValue; |
|||
var vecActSizeLabel = |
|||
actSizeProperty.displayName + ": " + BuildActionArrayLabel(actSizeProperty); |
|||
var actSpaceTypeLabel = actSpaceTypeProp.displayName + ": " + |
|||
(SpaceType)actSpaceTypeProp.enumValueIndex; |
|||
EditorGUILayout.LabelField(vecObsSizeLabel); |
|||
EditorGUILayout.LabelField(numStackedLabel); |
|||
EditorGUILayout.LabelField(vecActSizeLabel); |
|||
EditorGUILayout.LabelField(actSpaceTypeLabel); |
|||
} |
|||
EditorGUILayout.LabelField(vecObsSizeLabel); |
|||
EditorGUILayout.LabelField(numStackedLabel); |
|||
EditorGUILayout.LabelField(vecActSizeLabel); |
|||
EditorGUILayout.LabelField(actSpaceTypeLabel); |
|||
} |
|||
public override void OnInspectorGUI() |
|||
{ |
|||
serializedObject.Update(); |
|||
EditorGUILayout.LabelField("Meta Data", EditorStyles.boldLabel); |
|||
MakeMetaDataProperty(m_DemoMetaData); |
|||
EditorGUILayout.LabelField("Brain Parameters", EditorStyles.boldLabel); |
|||
MakeBrainParametersProperty(m_BrainParameters); |
|||
serializedObject.ApplyModifiedProperties(); |
|||
public override void OnInspectorGUI() |
|||
{ |
|||
serializedObject.Update(); |
|||
EditorGUILayout.LabelField("Meta Data", EditorStyles.boldLabel); |
|||
MakeMetaDataProperty(m_DemoMetaData); |
|||
EditorGUILayout.LabelField("Brain Parameters", EditorStyles.boldLabel); |
|||
MakeBrainParametersProperty(m_BrainParameters); |
|||
serializedObject.ApplyModifiedProperties(); |
|||
} |
|||
} |
|||
} |
982
com.unity.ml-agents/Plugins/ProtoBuffer/System.Interactive.Async.dll
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue