GitHub
6 年前
当前提交
3c9603d6
共有 57 个文件被更改,包括 4009 次插入 和 412 次删除
-
4.gitignore
-
9UnitySDK/Assets/ML-Agents/Scripts/Academy.cs
-
77UnitySDK/Assets/ML-Agents/Scripts/Agent.cs
-
152UnitySDK/Assets/ML-Agents/Scripts/Batcher.cs
-
47UnitySDK/Assets/ML-Agents/Scripts/Brain.cs
-
71UnitySDK/Assets/ML-Agents/Scripts/CoreBrainInternal.cs
-
25config/trainer_config.yaml
-
59docs/Training-Imitation-Learning.md
-
1ml-agents/mlagents/envs/communicator_objects/__init__.py
-
9ml-agents/mlagents/envs/communicator_objects/unity_to_external_pb2.py
-
18ml-agents/mlagents/envs/environment.py
-
4ml-agents/mlagents/trainers/__init__.py
-
3ml-agents/mlagents/trainers/bc/__init__.py
-
2ml-agents/mlagents/trainers/bc/policy.py
-
106ml-agents/mlagents/trainers/bc/trainer.py
-
2ml-agents/mlagents/trainers/buffer.py
-
16ml-agents/mlagents/trainers/ppo/trainer.py
-
25ml-agents/mlagents/trainers/trainer.py
-
12ml-agents/mlagents/trainers/trainer_controller.py
-
16ml-agents/tests/mock_communicator.py
-
1ml-agents/tests/trainers/test_meta_curriculum.py
-
104ml-agents/tests/trainers/test_trainer_controller.py
-
95UnitySDK/Assets/ML-Agents/Editor/DemonstrationDrawer.cs
-
11UnitySDK/Assets/ML-Agents/Editor/DemonstrationDrawer.cs.meta
-
60UnitySDK/Assets/ML-Agents/Editor/DemonstrationImporter.cs
-
11UnitySDK/Assets/ML-Agents/Editor/DemonstrationImporter.cs.meta
-
66UnitySDK/Assets/ML-Agents/Editor/Tests/DemonstrationTests.cs
-
11UnitySDK/Assets/ML-Agents/Editor/Tests/DemonstrationTests.cs.meta
-
1001UnitySDK/Assets/ML-Agents/Plugins/System.IO.Abstractions.TestingHelpers.dll
-
30UnitySDK/Assets/ML-Agents/Plugins/System.IO.Abstractions.TestingHelpers.dll.meta
-
623UnitySDK/Assets/ML-Agents/Plugins/System.IO.Abstractions.dll
-
30UnitySDK/Assets/ML-Agents/Plugins/System.IO.Abstractions.dll.meta
-
8UnitySDK/Assets/ML-Agents/Resources.meta
-
289UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/DemonstrationMetaProto.cs
-
11UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/DemonstrationMetaProto.cs.meta
-
76UnitySDK/Assets/ML-Agents/Scripts/Demonstration.cs
-
11UnitySDK/Assets/ML-Agents/Scripts/Demonstration.cs.meta
-
65UnitySDK/Assets/ML-Agents/Scripts/DemonstrationRecorder.cs
-
11UnitySDK/Assets/ML-Agents/Scripts/DemonstrationRecorder.cs.meta
-
138UnitySDK/Assets/ML-Agents/Scripts/DemonstrationStore.cs
-
3UnitySDK/Assets/ML-Agents/Scripts/DemonstrationStore.cs.meta
-
73UnitySDK/Assets/ML-Agents/Scripts/Utilities.cs
-
3UnitySDK/Assets/ML-Agents/Scripts/Utilities.cs.meta
-
55config/bc_config.yaml
-
102docs/images/demo_component.png
-
198docs/images/demo_inspector.png
-
98ml-agents/mlagents/envs/communicator_objects/demonstration_meta_proto_pb2.py
-
19ml-agents/mlagents/envs/utilities.py
-
53ml-agents/mlagents/trainers/bc/offline_trainer.py
-
116ml-agents/mlagents/trainers/bc/online_trainer.py
-
151ml-agents/mlagents/trainers/demo_loader.py
-
60ml-agents/tests/trainers/test.demo
-
14ml-agents/tests/trainers/test_demo_loader.py
-
12protobuf-definitions/proto/mlagents/envs/communicator_objects/demonstration_meta_proto.proto
-
68UnitySDK/Assets/ML-Agents/Resources/DemoIcon.png
-
86UnitySDK/Assets/ML-Agents/Resources/DemoIcon.png.meta
|
|||
from .models import * |
|||
from .trainer import * |
|||
from .online_trainer import * |
|||
from .offline_trainer import * |
|||
from .policy import * |
|
|||
using System.Text; |
|||
using MLAgents; |
|||
using UnityEditor; |
|||
|
|||
/// <summary>
|
|||
/// Renders a custom UI for Demonstration Scriptable Object.
|
|||
/// </summary>
|
|||
[CustomEditor(typeof(Demonstration))] |
|||
[CanEditMultipleObjects] |
|||
public class DemonstrationEditor : Editor |
|||
{ |
|||
SerializedProperty brainParameters; |
|||
SerializedProperty demoMetaData; |
|||
|
|||
void OnEnable() |
|||
{ |
|||
brainParameters = serializedObject.FindProperty("brainParameters"); |
|||
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; |
|||
|
|||
EditorGUILayout.LabelField(nameLabel); |
|||
EditorGUILayout.LabelField(expLabel); |
|||
EditorGUILayout.LabelField(epiLabel); |
|||
EditorGUILayout.LabelField(rewLabel); |
|||
} |
|||