浏览代码

A fix that prevents normal sampler returning values outside of min max (#258)

/main
GitHub 4 年前
当前提交
f62a40ad
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2
      com.unity.perception/CHANGELOG.md
  2. 2
      com.unity.perception/Runtime/Randomization/Samplers/SamplerUtility.cs

2
com.unity.perception/CHANGELOG.md


### Fixed
A bug in the Normal Sampler where it would return values less than the passed in min, or greater than the passed in max, for random values very close to 0 or 1 respectively.
## [0.8.0-preview.2] - 2021-03-15
### Upgrade Notes

2
com.unity.perception/Runtime/Randomization/Samplers/SamplerUtility.cs


return min;
var stdTruncNorm = NormalCdfInverse(c);
return stdTruncNorm * stdDev + mean;
return math.clamp(stdTruncNorm * stdDev + mean, min, max);
}
/// <summary>

正在加载...
取消
保存