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