当前位置:网站首页>Pytorch nn.functional.unfold()的简单理解与用法
Pytorch nn.functional.unfold()的简单理解与用法
2022-07-01 21:50:00 【zouxiaolv】
import torch
from torch.nn import functional as F
x =torch.arange(36).view(1,2,2,9).float()
print('x',x)
x = F.unfold(x, (2, 2))
print('x1',x)
print(x.size())x tensor([[[[ 0., 1., 2., 3., 4., 5., 6., 7., 8.],
[ 9., 10., 11., 12., 13., 14., 15., 16., 17.]],
[[18., 19., 20., 21., 22., 23., 24., 25., 26.],
[27., 28., 29., 30., 31., 32., 33., 34., 35.]]]])
x1 tensor([[[ 0., 1., 2., 3., 4., 5., 6., 7.],
[ 1., 2., 3., 4., 5., 6., 7., 8.],
[ 9., 10., 11., 12., 13., 14., 15., 16.],
[10., 11., 12., 13., 14., 15., 16., 17.],
[18., 19., 20., 21., 22., 23., 24., 25.],
[19., 20., 21., 22., 23., 24., 25., 26.],
[27., 28., 29., 30., 31., 32., 33., 34.],
[28., 29., 30., 31., 32., 33., 34., 35.]]])
torch.Size([1, 8, 8])滑动窗口是2*2
然后滑动输入的范围是2*2,比如滑动第一个是
[0., 1.,
9., 10.]输出是拉平变成
[0.,
1.,
9.,
10.]依次就变成以上的输出形式
边栏推荐
- 对象内存布局
- Object memory layout
- Slope compensation
- nn. Parameter] pytoch feature fusion adaptive weight setting (learnable weight use)
- Indicator trap: seven KPI mistakes that it leaders are prone to make
- SAP GUI 里的收藏夹事务码管理工具
- 91.(cesium篇)cesium火箭发射模拟
- Yyds dry goods inventory # solve the real problem of famous enterprises: egg twisting machine
- linux下清理系统缓存并释放内存
- IDA动态调试apk
猜你喜欢

Mysql——》索引存储模型推演

【目标跟踪】|单目标跟踪指标

黑马程序员-软件测试--06阶段2-linux和数据库-01-08第一章-linux操作系统阶段内容说明,linux命令基本格式以及常见形式的说明,操作系统的常见的分类,查看命令帮助信息方法,

H5 model trained by keras to tflite

# CutefishOS系统~

QT版本华睿相机的Demo程序实现

园区全光技术选型-中篇

性能测试计划怎么编写

SAP UI5 应用开发教程之一百零四 - SAP UI5 表格控件的支持复选(Multi-Select)以及如何用代码一次选中多个表格行项目

13th Blue Bridge Cup group B national tournament
随机推荐
Fully annotated SSM framework construction
13th Blue Bridge Cup group B national tournament
pytorch训练自己网络后可视化特征图谱的代码
Mysql5.7 set password policy (etc. three-level password transformation)
牛客月赛-分组求对数和
Yolov5.5 call local camera
SAP 智能机器人流程自动化(iRPA)解决方案分享
104. SAP UI5 表格控件的支持复选(Multi-Select)以及如何用代码一次选中多个表格行项目
使用 Three.js 实现'雪糕'地球,让地球也凉爽一夏
QT 使用FFmpeg4将argb的Qimage转换成YUV422P
plantuml介绍与使用
利用SecureCRTPortable远程连接虚拟机
The leader of the cloud native theme group of beacon Committee has a long way to go!
EasyExcel 复杂数据导出
固定资产管理子系统报表分为什么大类,包括哪些科目
详解Kubernetes网络模型
CIO's discussion and Analysis on the definition of high-performance it team
微信开放平台扫码登录[通俗易懂]
详解JMM
cvpr2022 human pose estiamtion