当前位置:网站首页>【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
边栏推荐
猜你喜欢
随机推荐
Pinduoduo API interface (attach my available API)
【深度学习】什么是互信息最大化?
unable to extend table xxx by 1024 in tablespace xxxx
Production and optimization of Unity game leaderboards
【@网络工程师:用好这6款工具,让你的工作效率大翻倍!】
opencv实现数据增强(图片+标签)平移,翻转,缩放,旋转
EasyPlayer针对H.265视频不自动播放设置下,loading状态无法消失的解决办法
Amazon Get AMAZON Product Details API Return Value Description
软件测试基本流程有哪些?北京专业第三方软件检测机构安利
抖音API接口大全
How do you optimize the performance of your Unity project?
每日sql-统计各个专业人数(包括专业人数为0的)
concept noun
皮质-皮质网络的多尺度交流
【推荐系统】:协同过滤和基于内容过滤概述
语音信号处理:预处理【预加重、分帧、加窗】
unable to extend table xxx by 1024 in tablespace xxxx
Douyin API interface
How Unity handles C# under the hood
Get Pinduoduo product information operation details