MAXUNPOOL使用

将包含最大值索引的输出作为输入,MaxPool2d 并计算部分逆,其中所有非最大值都设置为零。
pool = nn.MaxPool2d(2, stride=2, return_indices=True)
unpool = nn.MaxUnpool2d(2, stride=2)
input = torch.tensor([[[[ 1., 2, 3, 4],
[ 5, 6, 7, 8],
[ 9, 10, 11, 12],
[13, 14, 15, 16]]]])
output, indices = pool(input)

unpool(output, indices)
》》》tensor([[[[ 0., 0., 0.,

MAXUNPOOL使用最先出现在Python成神之路

版权声明:
作者:Zad
链接:https://www.techfm.club/p/19129.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>