当前位置:网站首页>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)
边栏推荐
- Interpretation of mask RCNN paper
- 增量备份 ?db full
- phpstrom设置函数注释说明
- A label colorful navigation bar
- Huawei machine test question: longest continuous subsequence
- The application and Optimization Practice of redis in vivo push platform is transferred to the end of metadata by
- Win:使用组策略启用和禁用 USB 驱动器
- [understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
- PHP 基础篇 - PHP 中 DES 加解密详解
- Win: enable and disable USB drives using group policy
猜你喜欢
What sparks can applet container technology collide with IOT
【附源码】基于知识图谱的智能推荐系统-Sylvie小兔
One plus six brushes into Kali nethunter
Comment mettre en place une équipe technique pour détruire l'entreprise?
MySQL REGEXP:正则表达式查询
Interesting practice of robot programming 14 robot 3D simulation (gazebo+turtlebot3)
Kibana installation and configuration
Wechat applet: wechat applet source code download new community system optimized version support agent member system function super high income
A label making navigation bar
Win: use PowerShell to check the strength of wireless signal
随机推荐
Exploration and practice of integration of streaming and wholesale in jd.com
Timescaledb 2.5.2 release, time series database based on PostgreSQL
Application and Optimization Practice of redis in vivo push platform
JVM - when multiple threads initialize the same class, only one thread is allowed to initialize
Li Kou Jianzhi offer -- binary tree chapter
He was laid off.. 39 year old Ali P9, saved 150million
Process scheduling and termination
Tucson will lose more than $400million in the next year
One plus six brushes into Kali nethunter
[OpenGL learning notes 8] texture
Advanced conditional statements of common SQL operations
Talk about the things that must be paid attention to when interviewing programmers
187. Repeated DNA sequence - with unordered_ Map basic content
[swagger]-swagger learning
batchnorm. Py this file single GPU operation error solution
Tla+ through examples (XI) -- propositional logic and examples
PowerShell:在代理服务器后面使用 PowerShell
es使用collapseBuilder去重和只返回某个字段
Win: add general users to the local admins group
One plus six brushes into Kali nethunter