浏览代码

change default barracuda behavior (#5175)

/check-for-ModelOverriders
GitHub 4 年前
当前提交
734baf16
共有 5 个文件被更改,包括 14 次插入5 次删除
  1. 3
      com.unity.ml-agents/CHANGELOG.md
  2. 2
      com.unity.ml-agents/Runtime/Agent.cs
  3. 1
      com.unity.ml-agents/Runtime/Inference/ModelRunner.cs
  4. 11
      com.unity.ml-agents/Runtime/Policies/BarracudaPolicy.cs
  5. 2
      com.unity.ml-agents/Runtime/Policies/BehaviorParameters.cs

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


- Added ML-Agents package settings. (#5027)
- Make com.unity.modules.unityanalytics an optional dependency. (#5109)
- Make com.unity.modules.physics and com.unity.modules.physics2d optional dependencies. (#5112)
- The default `InferenceDevice` is now `InferenceDevice.Default`, which is equivalent to `InferenceDevice.Burst`. If you
depend on the previous behavior, you can explicitly set the Agent's `InferenceDevice` to `InferenceDevice.CPU`. (#5175)
#### ml-agents / ml-agents-envs / gym-unity (Python)
### Bug Fixes

2
com.unity.ml-agents/Runtime/Agent.cs


public void SetModel(
string behaviorName,
NNModel model,
InferenceDevice inferenceDevice = InferenceDevice.CPU)
InferenceDevice inferenceDevice = InferenceDevice.Default)
{
if (behaviorName == m_PolicyFactory.BehaviorName &&
model == m_PolicyFactory.Model &&

1
com.unity.ml-agents/Runtime/Inference/ModelRunner.cs


case InferenceDevice.Burst:
executionDevice = WorkerFactory.Type.CSharpBurst;
break;
case InferenceDevice.Default: // fallthrough
default:
executionDevice = WorkerFactory.Type.CSharpBurst;
break;

11
com.unity.ml-agents/Runtime/Policies/BarracudaPolicy.cs


public enum InferenceDevice
{
/// <summary>
/// CPU inference. Corresponds to in WorkerFactory.Type.CSharp Barracuda.
/// Burst is recommended instead; this is kept for legacy compatibility.
/// Default inference. This is currently the same as Burst, but may change in the future.
CPU = 0,
Default = 0,
/// <summary>
/// GPU inference. Corresponds to WorkerFactory.Type.ComputePrecompiled in Barracuda.

/// CPU inference using Burst. Corresponds to WorkerFactory.Type.CSharpBurst in Barracuda.
/// </summary>
Burst = 2,
/// <summary>
/// CPU inference. Corresponds to in WorkerFactory.Type.CSharp Barracuda.
/// Burst is recommended instead; this is kept for legacy compatibility.
/// </summary>
CPU = 3,
}
/// <summary>

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


}
[HideInInspector, SerializeField]
InferenceDevice m_InferenceDevice = InferenceDevice.Burst;
InferenceDevice m_InferenceDevice = InferenceDevice.Default;
/// <summary>
/// How inference is performed for this Agent's model.

正在加载...
取消
保存