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