评价此页

torch.nn.functional.softmin#

torch.nn.functional.softmin(input, dim=None, _stacklevel=3, dtype=None)[source]#

应用 softmin 函数。

请注意 Softmin(x)=Softmax(x)\text{Softmin}(x) = \text{Softmax}(-x)。数学公式请参阅 softmax 定义。

更多详情请参阅 Softmin

参数:
  • input (张量) – 输入

  • dim (int) – 计算 softmin 的维度(因此沿着 dim 的每个切片之和为 1)。

  • dtype (torch.dtype, 可选) – 返回张量所需的数据类型。如果指定,输入张量会在操作执行前转换为 dtype。这对于防止数据类型溢出很有用。默认值:None。

返回类型:

张量