当前位置:网站首页>【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
边栏推荐
猜你喜欢
JD.com product details API call example explanation
《Generative Adversarial Networks》
exness:黄金1800关口遇阻,静待美国CPI出炉
抖音API接口大全
京东商品详情API调用实例讲解
矩阵分析——微分、积分、极限
抖音API接口
unable to extend table xxx by 1024 in tablespace xxxx
抖音API接口
已解决EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
随机推荐
Douyin API interface
每日sql:求好友申请通过率
Coordinate system in navigation and positioning
golang fork 进程的三种方式
亚马逊API接口大全
详述MIMIC 的ICU患者检测时间信息表(十六)
Daily SQL - find each of the students school gpa minimum (window)
mmdetection的安装和训练、测试didi数据集的步骤(含结果)
SQL sliding window
How Unity programmers can improve their abilities
STM32CUBEIDE(11)----输出PWM及修改PWM频率与占空比
Get Pinduoduo product information operation details
梅科尔工作室——BP神经网络
ROS 服务通信理论模型
Redis源码-String:Redis String命令、Redis String存储原理、Redis字符串三种编码类型、Redis String SDS源码解析、Redis String应用场景
Multiscale communication in cortical-cortical networks
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
Redis测试
空间金字塔池化 -Spatial Pyramid Pooling(含源码)
强烈推荐一款好用的API接口