浏览代码

Made Brain Parameters internal (#3545)

* Made the BrainParameters internal

* Editing the docs
/bug-failed-api-check
GitHub 5 年前
当前提交
c5dd3641
共有 6 个文件被更改,包括 12 次插入10 次删除
  1. 1
      com.unity.ml-agents/CHANGELOG.md
  2. 12
      com.unity.ml-agents/Runtime/Demonstrations/DemonstrationRecorder.cs
  3. 2
      com.unity.ml-agents/Runtime/Demonstrations/DemonstrationWriter.cs
  4. 2
      com.unity.ml-agents/Runtime/Policies/BehaviorParameters.cs
  5. 4
      com.unity.ml-agents/Runtime/Policies/BrainParameters.cs
  6. 1
      docs/Migrating.md

1
com.unity.ml-agents/CHANGELOG.md


- Multi-GPU training and the `--multi-gpu` option has been removed temporarily. (#3345)
- All Sensor related code has been moved to the namespace `MLAgents.Sensors`.
- All SideChannel related code has been moved to the namespace `MLAgents.SideChannels`.
- `BrainParameters` and `SpaceType` have been removed from the public API
### Minor Changes
- Monitor.cs was moved to Examples. (#3372)

12
com.unity.ml-agents/Runtime/Demonstrations/DemonstrationRecorder.cs


var stream = m_FileSystem.File.Create(filePath);
m_DemoWriter = new DemonstrationWriter(stream);
m_DemoWriter.Initialize(
demonstrationName,
behaviorParams.brainParameters,
behaviorParams.fullyQualifiedBehaviorName
);
AddDemonstrationWriterToAgent(m_DemoWriter);
return m_DemoWriter;

/// <param name="demoWriter"></param>
public void AddDemonstrationWriterToAgent(DemonstrationWriter demoWriter)
{
var behaviorParams = GetComponent<BehaviorParameters>();
demoWriter.Initialize(
demonstrationName,
behaviorParams.brainParameters,
behaviorParams.fullyQualifiedBehaviorName
);
m_Agent.DemonstrationWriters.Add(demoWriter);
}

2
com.unity.ml-agents/Runtime/Demonstrations/DemonstrationWriter.cs


/// <param name="demonstrationName">Base name of the demonstration file(s).</param>
/// <param name="brainName">The name of the Brain the agent is attached to.</param>
/// <param name="brainParameters">The parameters of the Brain the agent is attached to.</param>
public void Initialize(
internal void Initialize(
string demonstrationName, BrainParameters brainParameters, string brainName)
{
if (m_Writer == null)

2
com.unity.ml-agents/Runtime/Policies/BehaviorParameters.cs


/// <summary>
/// The associated <see cref="BrainParameters"/> for this behavior.
/// </summary>
public BrainParameters brainParameters
internal BrainParameters brainParameters
{
get { return m_BrainParameters; }
}

4
com.unity.ml-agents/Runtime/Policies/BrainParameters.cs


/// <summary>
/// Whether the action space is discrete or continuous.
/// </summary>
public enum SpaceType
internal enum SpaceType
{
/// <summary>
/// Discrete action space: a fixed number of options are available.

/// decision process.
/// </summary>
[Serializable]
public class BrainParameters
internal class BrainParameters
{
/// <summary>
/// If continuous : The length of the float vector that represents the state.

1
docs/Migrating.md


* The method `GetStepCount()` on the Agent class has been replaced with the property getter `StepCount`
* The `--multi-gpu` option has been removed temporarily.
* `AgentInfo.actionMasks` has been renamed to `AgentInfo.discreteActionMasks`.
* `BrainParameters` and `SpaceType` have been removed from the public API
### Steps to Migrate
* Add the `using MLAgents.Sensors;` in addition to `using MLAgents;` on top of your Agent's script.

正在加载...
取消
保存