Softmax2d¶
- class torch.nn.Softmax2d(*args, **kwargs)[原始碼][原始碼]¶
將 SoftMax 應用於每個空間位置的特徵。
當給定一個
Channels x Height x Width
的影像時,它會將 Softmax 應用於每個位置- 形狀
輸入: 或 。
輸出: 或 (與輸入相同的形狀)
- 回傳
一個與輸入具有相同維度和形狀的張量,其值在 [0, 1] 範圍內
- 回傳型別
None
範例
>>> m = nn.Softmax2d() >>> # you softmax over the 2nd dimension >>> input = torch.randn(2, 3, 12, 13) >>> output = m(input)