浏览代码
[MLA-488] Fix observations in demonstration drawer (#3771)
[MLA-488] Fix observations in demonstration drawer (#3771)
* WIP observation shapes * WIP observation shapes * fix Observation shape serialization * rename field, redo screenshot * docstring * changelog/develop/gym-wrapper
GitHub
5 年前
当前提交
9f43ef72
共有 27 个文件被更改,包括 253 次插入 和 325 次删除
-
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/Basic/Demos/ExpertBasic.demo.meta
-
2Project/Assets/ML-Agents/Examples/Bouncer/Demos/ExpertBouncer.demo.meta
-
2Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerDyn.demo.meta
-
2Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawlerSta.demo.meta
-
2Project/Assets/ML-Agents/Examples/FoodCollector/Demos/ExpertFood.demo.meta
-
2Project/Assets/ML-Agents/Examples/GridWorld/Demos/ExpertGrid.demo.meta
-
2Project/Assets/ML-Agents/Examples/Hallway/Demos/ExpertHallway.demo.meta
-
2Project/Assets/ML-Agents/Examples/PushBlock/Demos/ExpertPush.demo.meta
-
2Project/Assets/ML-Agents/Examples/Pyramids/Demos/ExpertPyramid.demo.meta
-
2Project/Assets/ML-Agents/Examples/Reacher/Demos/ExpertReacher.demo.meta
-
2Project/Assets/ML-Agents/Examples/Tennis/Demos/ExpertTennis.demo.meta
-
2Project/Assets/ML-Agents/Examples/Walker/Demos/ExpertWalker.demo.meta
-
2Project/ProjectSettings/ProjectVersion.txt
-
3com.unity.ml-agents/CHANGELOG.md
-
78com.unity.ml-agents/Editor/DemonstrationDrawer.cs
-
26com.unity.ml-agents/Editor/DemonstrationImporter.cs
-
68com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs
-
2com.unity.ml-agents/Runtime/Demonstrations/DemonstrationWriter.cs
-
6docs/Training-Imitation-Learning.md
-
257docs/images/demo_inspector.png
-
22com.unity.ml-agents/Runtime/Demonstrations/DemonstrationMetaData.cs
-
11com.unity.ml-agents/Runtime/Demonstrations/DemonstrationMetaData.cs.meta
-
37com.unity.ml-agents/Runtime/Demonstrations/DemonstrationSummary.cs
-
38com.unity.ml-agents/Runtime/Demonstrations/Demonstration.cs
-
0/com.unity.ml-agents/Runtime/Demonstrations/DemonstrationSummary.cs.meta
|
|||
m_EditorVersion: 2018.4.18f1 |
|||
m_EditorVersion: 2018.4.17f1 |
|
|||
using System; |
|||
using UnityEngine; |
|||
using MLAgents.Policies; |
|||
using UnityEngine.Serialization; |
|||
|
|||
namespace MLAgents.Demonstrations |
|||
{ |
|||
/// <summary>
|
|||
/// Demonstration meta-data.
|
|||
/// Kept in a struct for easy serialization and deserialization.
|
|||
/// </summary>
|
|||
[Serializable] |
|||
internal class DemonstrationMetaData |
|||
{ |
|||
[FormerlySerializedAs("numberExperiences")] |
|||
public int numberSteps; |
|||
public int numberEpisodes; |
|||
public float meanReward; |
|||
public string demonstrationName; |
|||
public const int ApiVersion = 1; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: af5f3b4258a2d4ead90e733f30cfaa7a |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using MLAgents.Policies; |
|||
|
|||
namespace MLAgents.Demonstrations |
|||
{ |
|||
/// <summary>
|
|||
/// Summary of a loaded Demonstration file. Only used for display in the Inspector.
|
|||
/// </summary>
|
|||
[Serializable] |
|||
internal class DemonstrationSummary : ScriptableObject |
|||
{ |
|||
public DemonstrationMetaData metaData; |
|||
public BrainParameters brainParameters; |
|||
public List<ObservationSummary> observationSummaries; |
|||
|
|||
public void Initialize(BrainParameters brainParams, |
|||
DemonstrationMetaData demonstrationMetaData, List<ObservationSummary> obsSummaries) |
|||
{ |
|||
brainParameters = brainParams; |
|||
metaData = demonstrationMetaData; |
|||
observationSummaries = obsSummaries; |
|||
} |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// Summary of a loaded Observation. Currently only contains the shape of the Observation.
|
|||
/// </summary>
|
|||
/// <remarks>This is necessary because serialization doesn't support nested containers or arrays.</remarks>
|
|||
[Serializable] |
|||
internal struct ObservationSummary |
|||
{ |
|||
public int[] shape; |
|||
} |
|||
} |
|
|||
using System; |
|||
using UnityEngine; |
|||
using MLAgents.Policies; |
|||
|
|||
namespace MLAgents.Demonstrations |
|||
{ |
|||
/// <summary>
|
|||
/// Demonstration Object. Contains meta-data regarding demonstration.
|
|||
/// Used for imitation learning, or other forms of learning from data.
|
|||
/// </summary>
|
|||
[Serializable] |
|||
internal class Demonstration : ScriptableObject |
|||
{ |
|||
public DemonstrationMetaData metaData; |
|||
public BrainParameters brainParameters; |
|||
|
|||
public void Initialize(BrainParameters brainParams, |
|||
DemonstrationMetaData demonstrationMetaData) |
|||
{ |
|||
brainParameters = brainParams; |
|||
metaData = demonstrationMetaData; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Demonstration meta-data.
|
|||
/// Kept in a struct for easy serialization and deserialization.
|
|||
/// </summary>
|
|||
[Serializable] |
|||
internal class DemonstrationMetaData |
|||
{ |
|||
public int numberExperiences; |
|||
public int numberEpisodes; |
|||
public float meanReward; |
|||
public string demonstrationName; |
|||
public const int ApiVersion = 1; |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue