当前位置:网站首页>【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
边栏推荐
- 抖音关键词搜索商品-API工具
- 概念名词解释
- Douyin get douyin share password url API return value description
- 每日sql-找到每个学校gpa最低的同学(开窗)
- Douyin share password url API tool
- 从苹果、SpaceX等高科技企业的产品发布会看企业产品战略和敏捷开发的关系
- sql--Users who have purchased more than 3 times (inclusive) within 7 days (including the current day), and the purchase amount in the past 7 days exceeds 1,000
- 软件测试基本流程有哪些?北京专业第三方软件检测机构安利
- Get Pinduoduo product information operation details
- JD.com product details API call example explanation
猜你喜欢

Douyin API interface

A used in the study of EEG ultra scanning analysis process

每日sql -查询至少有5名下属的经理和选举

Attitude solution - gyroscope + Euler method

Daily sql-seek the sum of successful investments in 2016

Resolved EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo

矩阵分析——微分、积分、极限

unable to extend table xxx by 1024 in tablespace xxxx

每日sql-统计各个专业人数(包括专业人数为0的)

Edge provides label grouping functionality
随机推荐
Daily sql - judgment + aggregation
李沐d2l(十)--卷积层Ⅰ
【@网络工程师:用好这6款工具,让你的工作效率大翻倍!】
Cobbleland 博览会 基础系列 1
radix-4 FFT principle and C language code implementation
Do not add the is prefix to the variables of the boolean type in the POJO class of the Alibaba specification
ROS 话题通信理论模型
【深度学习】什么是互信息最大化?
矩阵分析——Jordan标准形
1688 product interface
语音信号处理:预处理【预加重、分帧、加窗】
淘宝API接口参考
【推荐系统】:协同过滤和基于内容过滤概述
LeetCode刷题系列 -- 46. 全排列
sql--Users who have purchased more than 3 times (inclusive) within 7 days (including the current day), and the purchase amount in the past 7 days exceeds 1,000
【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法
C语言每日一练——Day02:求最小公倍数(3种方法)
抖音API接口
Discourse's Close Topic and Reopen Topic
淘宝sku API 接口(PHP示例)