API

输入:[ batch_size, channels, height_1, width_1 ]

Conv2d输入参数:[ channels, output, height_2, width_2 ]

输出:[ batch_size,output, height_3, width_3 ]

实例:

def torch_practice():
x = torch.randn(2,1,16,4)
conv = torch.nn.Conv2d(1, 32, (2,2))
res = conv(x)
print(res.shape) if __name__ == '__main__':
torch_practice()

输出:torch.Size([2, 32, 15, 3])

batch大小不变:2

输出通道加厚:32。由卷积核的通道数决定

卷积结果:[15,3]。计算公式,n-m+1, 16-2+1=15

torch.nn.Conv2d()使用的更多相关文章

  1. 关于torch.nn.Conv2d的笔记

    先看一下CLASS有哪些参数: torch.nn.Conv2d( in_channels, out_channels, kernel_size, stride=1, padding=0, dilati ...

  2. PyTorch官方中文文档:torch.nn

    torch.nn Parameters class torch.nn.Parameter() 艾伯特(http://www.aibbt.com/)国内第一家人工智能门户,微信公众号:aibbtcom ...

  3. pytorch中文文档-torch.nn常用函数-待添加-明天继续

    https://pytorch.org/docs/stable/nn.html 1)卷积层 class torch.nn.Conv2d(in_channels, out_channels, kerne ...

  4. PyTorch : torch.nn.xxx 和 torch.nn.functional.xxx

    PyTorch : torch.nn.xxx 和 torch.nn.functional.xxx 在写 PyTorch 代码时,我们会发现一些功能重复的操作,比如卷积.激活.池化等操作.这些操作分别可 ...

  5. nn.Conv2d 参数及输入输出详解

    Torch.nn.Conv2d(in_channels,out_channels,kernel_size,stride=1,padding=0,dilation=1,groups=1,bias=Tru ...

  6. Pytorch中nn.Conv2d的用法

    Pytorch中nn.Conv2d的用法 nn.Conv2d是二维卷积方法,相对应的还有一维卷积方法nn.Conv1d,常用于文本数据的处理,而nn.Conv2d一般用于二维图像. 先看一下接口定义: ...

  7. [pytorch笔记] torch.nn vs torch.nn.functional; model.eval() vs torch.no_grad(); nn.Sequential() vs nn.moduleList

    1. torch.nn与torch.nn.functional之间的区别和联系 https://blog.csdn.net/GZHermit/article/details/78730856 nn和n ...

  8. Pytorch本人疑问(1) torch.nn和torch.nn.functional之间的区别

    在写代码时发现我们在定义Model时,有两种定义方法: torch.nn.Conv2d()和torch.nn.functional.conv2d() 那么这两种方法到底有什么区别呢,我们通过下述代码看 ...

  9. pytorch中torch.nn构建神经网络的不同层的含义

    主要是参考这里,写的很好PyTorch 入门实战(四)--利用Torch.nn构建卷积神经网络 卷积层nn.Con2d() 常用参数 in_channels:输入通道数 out_channels:输出 ...

随机推荐

  1. 四阶幻方-蓝桥杯-DFS

    答案:416 用next_permutation()全部排列的话会超时 所以用dfs搜索,只搜索前三行就好,前三行确定之后,第四行也就确定 #include<iostream> #incl ...

  2. 【原】nginx配置文件

    一:下载nginx方式 1.yum install nginx 2.源码安装 二:学习网址 nginx documentation — DevDocs 三:配置文件信息 server { listen ...

  3. 将图片转化为base64编码字符串

    pom依赖 <dependency> <groupId>org.ops4j.base</groupId> <artifactId>ops4j-base- ...

  4. 建小程序 - 报Error: EPERM : operation not permitted, scandir mac下改变一个目录的访问权限

    问题:用微信开发者工具,建一个小程序,报错(见图1): 建小程序 - 报Error: EPERM : operation not permitted, scandir 解决: 1.打开终端 2.cd ...

  5. JDBC 操作插入表出现javax.sql.rowset.serial.SerialBlob cannot be cast to oracle.sql.BLOB

    /** * 接口方法 */ public void excuteInputDB(SynchServiceConfig synchServiceConfig) throws Exception { tr ...

  6. Firefox中有时使用window.close()脚本无法关闭当前窗口

    解决方法如下: 1.在Firefox浏览器的地址栏中输入about:config,即打开Firefox的配置页面 2.然后搜索dom.allow_scripts_to_close_windows,找到 ...

  7. c++ char* 与LPCTSTR相互转化

    ] = "wo shi ni baba"; , , ch, -, NULL, ); wchar_t *wide = new wchar_t[num]; MultiByteToWid ...

  8. HDU 5525:Product 欧拉定理

    Product  Accepts: 21  Submissions: 171  Time Limit: 6000/3000 MS (Java/Others)  Memory Limit: 131072 ...

  9. Android 自定义PopWindow完整代码

    1.布局文件的编写 <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:and ...

  10. MariaDB——数据库基础与sql语句

    数据库介绍 什么是数据库? 简单的说,数据库就是一个存放数据的仓库,这个仓库是按照一定的数据结构(数据结构是指数据的组织形式或数据之间的联系)来组织,存储的,我们可以通过数据库提供的多种方法来管理数据 ...