当前位置:网站首页>Unpool(nn.MaxUnpool2d)
Unpool(nn.MaxUnpool2d)
2022-07-05 02:01:00 【hxxjxw】
Unpooling As an up sampling method , And pooling It looks like the opposite operation , We have three ways , The first is Nearest Neighbor, Is to copy the same data 4 Four times the expansion effect , The second is ”Bed of Nails”, Keep the data in the upper left corner of the corresponding position , Then fill the rest 0, As shown in the figure below .
![]()
The third way is Max Unpooling, For some network models , The structure of up sampling and down sampling is often symmetrical , We can take samples under Max Pooling Record the position of the maximum value , When sampling, restore the maximum value to its corresponding position , Then fill the rest of the positions 0, As shown in the figure below .
In this way, the information can be restored to the greatest extent .
import torch from torch import nn 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) result = unpool(output, indices) print(result) # It's fine too unpool The result of size and input Different result = unpool(output, indices, output_size=torch.Size([1, 1, 5, 5])) print(result)
边栏推荐
- Wechat applet: exclusive applet version of the whole network, independent wechat community contacts
- Visual explanation of Newton iteration method
- Application and Optimization Practice of redis in vivo push platform
- What sparks can applet container technology collide with IOT
- [understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
- Variables in postman
- Wechat applet; Gibberish generator
- Mysql database | build master-slave instances of mysql-8.0 or above based on docker
- Grpc message sending of vertx
- Huawei machine test question: longest continuous subsequence
猜你喜欢

流批一体在京东的探索与实践

力扣剑指offer——二叉树篇

Do you know the eight signs of a team becoming agile?

A tab Sina navigation bar

Win:使用 Shadow Mode 查看远程用户的桌面会话

MySQL regexp: Regular Expression Query

Nebula importer data import practice

Phpstrom setting function annotation description

Exploration and Practice of Stream Batch Integration in JD

How to build a technical team that will bring down the company?
随机推荐
Phpstrom setting function annotation description
Luo Gu Pardon prisoners of war
[swagger]-swagger learning
Blue Bridge Cup Square filling (DFS backtracking)
Great God developed the new H5 version of arXiv, saying goodbye to formula typography errors in one step, and mobile phones can also easily read literature
Binary tree traversal - middle order traversal (golang)
流批一體在京東的探索與實踐
Wechat applet: independent background with distribution function, Yuelao office blind box for making friends
如何搭建一支搞垮公司的技术团队?
A label making navigation bar
线上故障突突突?如何紧急诊断、排查与恢复
力扣剑指offer——二叉树篇
Can financial products be redeemed in advance?
[机缘参悟-38]:鬼谷子-第五飞箝篇 - 警示之一:有一种杀称为“捧杀”
Win: add general users to the local admins group
【附源码】基于知识图谱的智能推荐系统-Sylvie小兔
[technology development-26]: data security of new information and communication networks
The application and Optimization Practice of redis in vivo push platform is transferred to the end of metadata by
batchnorm. Py this file single GPU operation error solution
Numpy library introductory tutorial: basic knowledge summary

