当前位置:网站首页>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)
边栏推荐
- 如何搭建一支搞垮公司的技术团队?
- Binary tree traversal - middle order traversal (golang)
- Li Kou Jianzhi offer -- binary tree chapter
- Win:使用组策略启用和禁用 USB 驱动器
- MySQL backup and recovery + experiment
- Application and development trend of image recognition technology
- Nebula importer data import practice
- After reading the average code written by Microsoft God, I realized that I was still too young
- Advanced learning of MySQL -- Application -- Introduction
- [understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
猜你喜欢
Exploration and practice of integration of streaming and wholesale in jd.com
Wechat applet: new independent backstage Yuelao office one yuan dating blind box
MATLB|多微电网及分布式能源交易
Logstash、Fluentd、Fluent Bit、Vector? How to choose the appropriate open source log collector
Is there a sudden failure on the line? How to make emergency diagnosis, troubleshooting and recovery
Do you know the eight signs of a team becoming agile?
Kibana installation and configuration
What sparks can applet container technology collide with IOT
Win:使用 Shadow Mode 查看远程用户的桌面会话
Win: use shadow mode to view the Desktop Session of a remote user
随机推荐
Do you know the eight signs of a team becoming agile?
Comment mettre en place une équipe technique pour détruire l'entreprise?
A label making navigation bar
[understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
Mysql database | build master-slave instances of mysql-8.0 or above based on docker
Binary tree traversal - middle order traversal (golang)
Express routing, express middleware, using express write interface
小程序容器技术与物联网 IoT 可以碰撞出什么样的火花
[swagger]-swagger learning
MATLB|多微电网及分布式能源交易
Application and Optimization Practice of redis in vivo push platform
Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
The application and Optimization Practice of redis in vivo push platform is transferred to the end of metadata by
Yyds dry inventory swagger positioning problem ⽅ formula
Es uses collapsebuilder to de duplicate and return only a certain field
Wechat applet: Xingxiu UI v1.5 WordPress system information resources blog download applet wechat QQ dual end source code support WordPress secondary classification loading animation optimization
220213c language learning diary
Outlook:总是提示输入用户密码
[OpenGL learning notes 8] texture
Yyds dry inventory jetpack hit dependency injection framework Getting Started Guide