浏览代码

Add ObservationType to analytics ObservationSpec (#5218)

/check-for-ModelOverriders
GitHub 4 年前
当前提交
60e5bbd1
共有 3 个文件被更改,包括 4 次插入0 次删除
  1. 2
      com.unity.ml-agents/Runtime/Analytics/Events.cs
  2. 1
      com.unity.ml-agents/Tests/Editor/Analytics/InferenceAnalyticsTests.cs
  3. 1
      com.unity.ml-agents/Tests/Editor/Analytics/TrainingAnalyticsTest.cs

2
com.unity.ml-agents/Runtime/Analytics/Events.cs


public string SensorName;
public string CompressionType;
public int BuiltInSensorType;
public int ObservationType;
public EventObservationDimensionInfo[] DimensionInfos;
public static EventObservationSpec FromSensor(ISensor sensor)

SensorName = sensor.GetName(),
CompressionType = sensor.GetCompressionSpec().SensorCompressionType.ToString(),
BuiltInSensorType = (int)builtInSensorType,
ObservationType = (int)obsSpec.ObservationType,
DimensionInfos = dimInfos,
};
}

1
com.unity.ml-agents/Tests/Editor/Analytics/InferenceAnalyticsTests.cs


Assert.AreEqual(2, continuousEvent.ObservationSpecs.Count);
Assert.AreEqual(3, continuousEvent.ObservationSpecs[0].DimensionInfos.Length);
Assert.AreEqual(20, continuousEvent.ObservationSpecs[0].DimensionInfos[0].Size);
Assert.AreEqual(0, continuousEvent.ObservationSpecs[0].ObservationType);
Assert.AreEqual((int)DimensionProperty.TranslationalEquivariance, continuousEvent.ObservationSpecs[0].DimensionInfos[0].Flags);
Assert.AreEqual((int)DimensionProperty.None, continuousEvent.ObservationSpecs[0].DimensionInfos[2].Flags);
Assert.AreEqual("None", continuousEvent.ObservationSpecs[0].CompressionType);

1
com.unity.ml-agents/Tests/Editor/Analytics/TrainingAnalyticsTest.cs


Assert.AreEqual(2, remotePolicyEvent.ObservationSpecs.Count);
Assert.AreEqual(3, remotePolicyEvent.ObservationSpecs[0].DimensionInfos.Length);
Assert.AreEqual(20, remotePolicyEvent.ObservationSpecs[0].DimensionInfos[0].Size);
Assert.AreEqual(0, remotePolicyEvent.ObservationSpecs[0].ObservationType);
Assert.AreEqual("None", remotePolicyEvent.ObservationSpecs[0].CompressionType);
Assert.AreEqual(Test3DSensor.k_BuiltInSensorType, remotePolicyEvent.ObservationSpecs[0].BuiltInSensorType);

正在加载...
取消
保存