評價此頁

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。

返回型別

張量