当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python mxnet.ndarray.softmin用法及代码示例


用法:

mxnet.ndarray.softmin(data=None, axis=_Null, temperature=_Null, dtype=_Null, use_length=_Null, out=None, name=None, **kwargs)

参数

  • data(NDArray) - 输入数组。
  • axis(int, optional, default='-1') - 计算 softmax 的轴。
  • temperature(double or None, optional, default=None) - softmax 中的温度参数
  • dtype({None, 'float16', 'float32', 'float64'},optional, default='None') - 输出的 DType,以防无法推断。如果未定义(dtype=None),则默认与输入的 dtype 相同。
  • use_length(boolean or None, optional, default=0) - 是否使用长度输入作为数据输入的掩码。
  • out(NDArray, optional) - 输出 NDArray 来保存结果。

返回

out- 此函数的输出。

返回类型

NDArray 或 NDArray 列表

应用 softmin 函数。

结果数组包含范围 (0,1) 中的元素,并且沿给定轴的元素总和为 1。

对于

t 是 softmax 函数中的温度参数。默认情况下,t 等于 1.0

例子:

x = [[ 1.  2.  3.]
     [ 3.  2.  1.]]

softmin(x,axis=0) = [[ 0.88079703,  0.5,  0.11920292],
                     [ 0.11920292,  0.5,  0.88079703]]

softmin(x,axis=1) = [[ 0.66524094,  0.24472848,  0.09003057],
                     [ 0.09003057,  0.24472848,  0.66524094]]

相关用法


注:本文由纯净天空筛选整理自apache.org大神的英文原创作品 mxnet.ndarray.softmin。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。