forked from mindspore-Ecosystem/mindspore
!39064 fix doc for logit
Merge pull request !39064 from 高攀/code_docs_logit_fix
This commit is contained in:
commit
4a7c924c6e
|
@ -1005,13 +1005,15 @@ mindspore.Tensor
|
|||
`x` 指的当前 Tensor。
|
||||
|
||||
.. math::
|
||||
y_{i} = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} < \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} > 1 - \text{eps}
|
||||
\begin{align}
|
||||
y_{i} & = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} & = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} \lt \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} \gt 1 - \text{eps}
|
||||
\end{cases}
|
||||
\end{align}
|
||||
|
||||
参数:
|
||||
- **eps** (float) - epsilon值。输入的数值界限被定义[eps, 1-eps]。 默认值:None。
|
||||
|
|
|
@ -6,12 +6,14 @@ mindspore.ops.Logit
|
|||
逐元素计算张量的logit值。 `x` 中的元素被截断到范围[eps, 1-eps]内。
|
||||
|
||||
.. math::
|
||||
y_{i} = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} < \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} > 1 - \text{eps}
|
||||
\begin{align}
|
||||
y_{i} & = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} & = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} \lt \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} \gt 1 - \text{eps}
|
||||
\end{cases}
|
||||
\end{align}
|
||||
|
||||
更多参考详见 :func:`mindspore.ops.logit`。
|
||||
|
|
|
@ -7,13 +7,15 @@ mindspore.ops.logit
|
|||
当 eps 为 None 时,输入 `x` 不进行数值截断。
|
||||
|
||||
.. math::
|
||||
y_{i} = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} < \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} > 1 - \text{eps}
|
||||
\begin{align}
|
||||
y_{i} & = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} & = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} \lt \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} \gt 1 - \text{eps}
|
||||
\end{cases}
|
||||
\end{align}
|
||||
|
||||
参数:
|
||||
- **x** (Tensor) - 张量输入。
|
||||
|
|
|
@ -2230,13 +2230,15 @@ def logit(x, eps=None):
|
|||
`x` refer to self tensor.
|
||||
|
||||
.. math::
|
||||
y_{i} = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} < \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} > 1 - \text{eps}
|
||||
\begin{align}
|
||||
y_{i} & = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} & = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} \lt \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} \gt 1 - \text{eps}
|
||||
\end{cases}
|
||||
\end{align}
|
||||
"""
|
||||
|
||||
if eps is None:
|
||||
|
|
|
@ -1349,13 +1349,15 @@ class Tensor(Tensor_):
|
|||
`x` refer to self tensor.
|
||||
|
||||
.. math::
|
||||
y_{i} = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} < \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} > 1 - \text{eps}
|
||||
\begin{align}
|
||||
y_{i} & = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} & = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} \lt \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} \gt 1 - \text{eps}
|
||||
\end{cases}
|
||||
\end{align}
|
||||
|
||||
Args:
|
||||
eps (float, optional): The epsilon. The input clamp bound is defined as [eps, 1-eps]. Default: None.
|
||||
|
|
|
@ -2380,13 +2380,15 @@ def logit(x, eps=None):
|
|||
When eps is None, input 'x' is not clamped.
|
||||
|
||||
.. math::
|
||||
y_{i} = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} < \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} > 1 - \text{eps}
|
||||
\begin{align}
|
||||
y_{i} & = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} & = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} \lt \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} \gt 1 - \text{eps}
|
||||
\end{cases}
|
||||
\end{align}
|
||||
|
||||
Args:
|
||||
x (Tensor): The input tensor.
|
||||
|
|
|
@ -2325,13 +2325,15 @@ class Logit(Primitive):
|
|||
Calculate the logit of a tensor element-wise. Element in `x` is clamped to [eps, 1-eps].
|
||||
|
||||
.. math::
|
||||
y_{i} = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} < \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} > 1 - \text{eps}
|
||||
\begin{align}
|
||||
y_{i} & = \ln(\frac{z_{i}}{1 - z_{i}}) \\
|
||||
z_{i} & = \begin{cases}
|
||||
x_{i} & \text{if eps is None} \\
|
||||
\text{eps} & \text{if } x_{i} \lt \text{eps} \\
|
||||
x_{i} & \text{if } \text{eps} \leq x_{i} \leq 1 - \text{eps} \\
|
||||
1 - \text{eps} & \text{if } x_{i} \gt 1 - \text{eps}
|
||||
\end{cases}
|
||||
\end{align}
|
||||
|
||||
Refer to :func:`mindspore.ops.logit` for more detail.
|
||||
|
||||
|
|
Loading…
Reference in New Issue