当前位置:网站首页>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)
边栏推荐
- Summary of regularization methods
- MATLB|多微电网及分布式能源交易
- [CTF] AWDP summary (WEB)
- [understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
- A label colorful navigation bar
- PHP wechat official account development
- Grpc message sending of vertx
- Wechat applet: the latest WordPress black gold wallpaper wechat applet two open repair version source code download support traffic main revenue
- MySQL REGEXP:正则表达式查询
- 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
猜你喜欢
How to build a technical team that will bring down the company?
STM32 series - serial port UART software pin internal pull-up or external resistance pull-up - cause problem search
Wechat applet: exclusive applet version of the whole network, independent wechat community contacts
Binary tree traversal - middle order traversal (golang)
Interesting practice of robot programming 16 synchronous positioning and map building (SLAM)
[source code attached] Intelligent Recommendation System Based on knowledge map -sylvie rabbit
Main window in QT application
[Digital IC hand tearing code] Verilog edge detection circuit (rising edge, falling edge, double edge) | topic | principle | design | simulation
How to safely eat apples on the edge of a cliff? Deepmind & openai gives the answer of 3D security reinforcement learning
Application and Optimization Practice of redis in vivo push platform
随机推荐
官宣!第三届云原生编程挑战赛正式启动!
Win:使用 Shadow Mode 查看远程用户的桌面会话
STL container
Vulnstack3
How to safely eat apples on the edge of a cliff? Deepmind & openai gives the answer of 3D security reinforcement learning
Tucson will lose more than $400million in the next year
179. Maximum number - sort
After reading the average code written by Microsoft God, I realized that I was still too young
Traditional chips and AI chips
Include rake tasks in Gems - including rake tasks in gems
Summary of regularization methods
MATLB|多微电网及分布式能源交易
Is there a sudden failure on the line? How to make emergency diagnosis, troubleshooting and recovery
Phpstrom setting function annotation description
小程序容器技术与物联网 IoT 可以碰撞出什么样的火花
Application and Optimization Practice of redis in vivo push platform
The MySQL team development specifications used by various factories are too detailed. It is recommended to collect them!
Huawei machine test question: longest continuous subsequence
流批一体在京东的探索与实践
Comment mettre en place une équipe technique pour détruire l'entreprise?