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.nn.LogSigmoid.txt 920 B

1234567891011121314151617181920212223242526272829303132
  1. Class mindspore.nn.LogSigmoid
  2. Log Sigmoid激活函数。
  3. 按元素计算Log Sigmoid激活函数。
  4. Log Sigmoid定义为:
  5. .. math::
  6. \text{logsigmoid}(x_{i}) = log(\frac{1}{1 + \exp(-x_i)}),
  7. 其中,:math:`x_i` 是输入Tensor的一个元素。
  8. 输入:
  9. - **x** (Tensor):Log Sigmoid的输入,数据类型为float16或float32。shape为:math:`(N,*)`,其中:math:`*`表示任意的附加维度。
  10. 输出:
  11. Tensor,数据类型和shape与 `x` 的相同。
  12. 异常:
  13. TypeError:`x`的数据类型既不是float16也不是float32。
  14. 支持平台:
  15. ``Ascend`` ``GPU`` ``CPU``
  16. 示例:
  17. >>> net = nn.LogSigmoid()
  18. >>> x = Tensor(np.array([1.0, 2.0, 3.0]), mindspore.float32)
  19. >>> output = net(x)
  20. >>> print(output)
  21. [-0.31326166 -0.12692806 -0.04858734]