Shortcuts

torch.nn.functional.softmin

torch.nn.functional.softmin(input, dim=None, _stacklevel=3, dtype=None)[源代码]

应用一个软最小值函数。

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

有关更多详细信息,请参阅 Softmin

Parameters
  • 输入 (张量) – 输入

  • dim (int) – 一个将计算softmin的维度(因此沿该维度的每个切片将总和为1)。

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

Return type

张量

优云智算