评价此页

torch.nn.functional.softmin#

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

应用 softmin 函数。

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

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

参数
  • input (张量) – 输入

  • dim (int) – softmin 将在其上计算的维度(因此沿 dim 的每个切片将求和为 1)。

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

返回类型

张量