当前位置:网站首页>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)
边栏推荐
- PHP 基础篇 - PHP 中 DES 加解密详解
- Yyds dry inventory jetpack hit dependency injection framework Getting Started Guide
- Using druid to connect to MySQL database reports the wrong type
- [understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
- Win: enable and disable USB drives using group policy
- C语音常用的位运算技巧
- Pgadmin 4 V6.5 release, PostgreSQL open source graphical management tool
- [illumination du destin - 38]: Ghost Valley - chapitre 5 Flying clamp - one of the Warnings: There is a kind of killing called "hold Kill"
- 线上故障突突突?如何紧急诊断、排查与恢复
- What sparks can applet container technology collide with IOT
猜你喜欢

Mysql database | build master-slave instances of mysql-8.0 or above based on docker

Traditional chips and AI chips

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

One plus six brushes into Kali nethunter

Kibana installation and configuration

One plus six brushes into Kali nethunter

Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool

Main window in QT application

"2022" is a must know web security interview question for job hopping

MATLB | multi micro grid and distributed energy trading
随机推荐
Video display and hiding of imitation tudou.com
Yolov5 model training and detection
Practice of tdengine in TCL air conditioning energy management platform
Official announcement! The third cloud native programming challenge is officially launched!
Win:使用组策略启用和禁用 USB 驱动器
I use these six code comparison tools
Yyds dry inventory swagger positioning problem ⽅ formula
力扣剑指offer——二叉树篇
Application and Optimization Practice of redis in vivo push platform
One click generation and conversion of markdown directory to word format
Richview trvunits image display units
[source code attached] Intelligent Recommendation System Based on knowledge map -sylvie rabbit
Some query constructors in laravel (2)
A label colorful navigation bar
Using openpyxl module to write the binary list into excel file
179. Maximum number - sort
Pytorch fine tuning (Fortune): hollowed out design or cheating
Wechat applet: exclusive applet version of the whole network, independent wechat community contacts
PHP Joseph Ring problem
[illumination du destin - 38]: Ghost Valley - chapitre 5 Flying clamp - one of the Warnings: There is a kind of killing called "hold Kill"

