cupyx.scipy.special.softmax#

cupyx.scipy.special.softmax(x, axis=None)[源代码][源代码]#

Softmax 函数。

softmax 函数通过计算每个元素的指数除以所有元素指数之和来转换集合中的每个元素。

参数:
  • x (array-like) – 输入数组

  • axis (int or tuple of ints, optional) – 要计算值的轴。默认为 None。

返回:

s – 返回一个与输入形状相同的数组。结果将沿提供的轴求和为1。

返回类型:

cupy.ndarray