当前位置:网站首页>【Pytorch】nn.PixelShuffle
【Pytorch】nn.PixelShuffle
2022-08-11 06:28:00 【二进制人工智能】
torch.nn.PixelShuffle(upscale_factor)
PixelShuffle是一种上采样方法,它将形状 ( ∗ , C × r 2 , H , W ) (∗, C\times r^2, H, W) (∗,C×r2,H,W)的张量重新排列转换为形状为 ( ∗ , C , H × r , W × r ) (∗, C, H\times r, W\times r) (∗,C,H×r,W×r)的张量:

图片来源:[1]
其中 r r r是upscale_factor因子。
输入输出尺寸:

例子: ( 1 , 8 , 2 , 2 ) → ( 1 , 2 , 4 , 4 ) (1, 8, 2, 2)\rightarrow (1,2,4,4) (1,8,2,2)→(1,2,4,4)
import torch
import torch.nn as nn
ps = nn.PixelShuffle(2)
input = torch.arange(0, 8 * 2 * 2).view(1, 8, 2, 2)
output = ps(input)
print('input:\n',input)
print('output:\n',output)


[1] Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network https://openaccess.thecvf.com/content_cvpr_2016/papers/Shi_Real-Time_Single_Image_CVPR_2016_paper.pdf
边栏推荐
- Unity游戏排行榜的制作与优化
- Discourse 的关闭主题(Close Topic )和重新开放主题
- 博途PLC 1200/1500PLC ModbusTcp通信梯形图优化汇总(多服务器多从站轮询)
- exness:黄金1800关口遇阻,静待美国CPI出炉
- 求过去半年内连续30天以上每天都有1000元以上成交的商铺
- 2022-08-10 Group 4 Self-cultivation class study notes (every day)
- Pinduoduo api interface application example
- mysql视图与索引
- 【sdx62】XBL设置共享内存变量,然后内核层获取变量实现
- Discourse's Close Topic and Reopen Topic
猜你喜欢

Attitude solution - gyroscope + Euler method

技能在赛题解析:交换机防环路设置

拼多多API接口(附上我的可用API)

Discourse's Close Topic and Reopen Topic

Spatial Pyramid Pooling -Spatial Pyramid Pooling (including source code)

Taobao API interface reference

Amazon API interface Daquan

radix-4 FFT 原理和C语言代码实现

Daily sql--statistics the total salary of employees in the past three months (excluding the latest month)

恒源云-Pycharm远程训练避坑指南
随机推荐
Do not add the is prefix to the variables of the boolean type in the POJO class of the Alibaba specification
How to choose professional, safe and high-performance remote control software
为什么C#中对MySQL不支持中文查询
那些事情是用Unity开发项目应该一开始规划好的?如何避免后期酿成巨坑?
buu—Re(5)
实现通用的、高性能排序和快排优化
联想集团:2022/23财年第一季度业绩
golang fork 进程的三种方式
2022-08-09 Group 4 Self-cultivation class study notes (every day)
daily sql - user retention rate for two days
抖音获取douyin分享口令url API 返回值说明
How Unity handles C# under the hood
Discourse 的关闭主题(Close Topic )和重新开放主题
抖音API接口
亚马逊API接口大全
基于FPGA的FIR滤波器的实现(4)— 串行结构FIR滤波器的FPGA代码实现
prometheus学习4Grafana监控mysql&blackbox了解
Daily sql-seek the sum of successful investments in 2016
Go语言实现Etcd服务发现(Etcd & Service Discovery & Go)
2022-08-10 第四小组 修身课 学习笔记(every day)