Softmax2d ¬
- class torch.nn.Softmax2d(*args, **kwargs)[source][source] ¬
对每个空间位置的特征应用 SoftMax。
当给定一个
Channels x Height x Width
的图像时,它将对每个位置 应用 Softmax- 形状:
输入: 或 。
输出: 或 (与输入相同形状)
- 返回值:
与输入具有相同维度和大小的 Tensor,其值在[0, 1]范围内
- 返回类型:
无。
示例:
>>> m = nn.Softmax2d() >>> # you softmax over the 2nd dimension >>> input = torch.randn(2, 3, 12, 13) >>> output = m(input)