You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.GeLU.rst 952 B

4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829
  1. mindspore.ops.GeLU
  2. ==================
  3. .. py:class:: mindspore.ops.GeLU()
  4. 高斯误差线性单元激活函数(Gaussian Error Linear Units activation function)。
  5. 在 `Gaussian Error Linear Units (GELUs) <https://arxiv.org/abs/1606.08415>`_ 文章中对GeLU函数进行了介绍。
  6. 此外,也可以参考 `BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding <https://arxiv.org/abs/1810.04805>`_ 。
  7. GeLU函数定义如下:
  8. .. math::
  9. GELU(x_i) = x_i*P(X < x_i)
  10. 其中 :math:`P` 是标准高斯分布的累积分布函数, :math:`x_i` 是输入的元素。
  11. **输入:**
  12. - **x** (Tensor) - 激活函数GeLU的输入,数据类型为float16或float32。
  13. **输出:**
  14. Tensor,数据类型和shape与 `x` 的相同。
  15. **异常:**
  16. - **TypeError** - `x` 不是Tensor。
  17. - **TypeError** - `x` 的数据类型既不是float16也不是float32。