mindspore/docs/api/api_python/ops/mindspore.ops.func_laplace.rst

26 lines
843 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.laplace
======================
.. py:function:: mindspore.ops.laplace(shape, mean, lambda_param, seed=None)
根据拉普拉斯分布生成随机数。
支持广播。
.. math::
\text{f}(x;μ,λ) = \frac{1}{2λ}\exp(-\frac{|x-μ|}{λ}),
其中 :math:`μ` 为均值,代表了 `mean` :math:`λ` 为尺度,代表了 `lambda_param`
.. warning::
Ascend后端不支持随机数重现功能 `seed` 参数不起作用。
参数:
- **shape** (tuple) - 生成随机数的shape。
- **mean** (Tensor) - 分布的均值。
- **lambda_param** (Tensor) - 控制分布方差。拉普拉斯分布的方差等于 `lambda_param` 平方的两倍。
- **seed** (int可选) - 随机种子。默认 ``None`` 表示使用0。
返回:
Tensor