The deduced formulas of Conv1d and ConvTranspose1d

2023-11-10

torch.nn.Conv1d(in_channelsout_channelskernel_sizestride=1padding=0dilation=1groups=1bias=True)

In the simplest case, the output value of the layer with input size (N,Cin,L) and output (N,Cout,Lout) can be precisely described as:(N,Cout,Lout) can be precisely described as:

out(Ni,Coutj)=bias(Coutj)+Cin1k=0weight(Coutj,k)input(Ni,k)
Parameters:
  • in_channels (int) – Number of channels in the input image
  • out_channels (int) – Number of channels produced by the convolution
  • kernel_size (int or tuple) – Size of the convolving kernel
  • stride (int or tuple, optional) – Stride of the convolution
  • padding (int or tuple, optional) – Zero-padding added to both sides of the input
  • dilation (int or tuple, optional) – Spacing between kernel elements
  • groups (int, optional) – Number of blocked connections from input channels to output channels
  • bias (bool, optional) – If True, adds a learnable bias to the output
Shape:
  • Input: (N,Cin,Lin)
  • Output: (N,Cout,Lout)    where
  • Lout=floor((Lin+2paddingdilation(kernel_size1)1)/stride+1)
Variables:
  • weight (Tensor) – the learnable weights of the module of shape (out_channels, in_channels, kernel_size)
  • bias (Tensor) – the learnable bias of the module of shape (out_channels)

Examples:

>>> m = nn.Conv1d(16, 33, 3, stride=2)
>>> input = autograd.Variable(torch.randn(20, 16, 50))
>>> output = m(input)



________________________________________

torch.nn.ConvTranspose1d(in_channelsout_channelskernel_sizestride=1padding=0output_padding=0groups=1bias=Truedilation=1)

Parameters:
  • in_channels (int) – Number of channels in the input image
  • out_channels (int) – Number of channels produced by the convolution
  • kernel_size (int or tuple) – Size of the convolving kernel
  • stride (int or tuple, optional) – Stride of the convolution
  • padding (int or tuple, optional) – Zero-padding added to both sides of the input
  • output_padding (int or tuple, optional) – Zero-padding added to one side of the output
  • groups (int, optional) – Number of blocked connections from input channels to output channels
  • bias (bool, optional) – If True, adds a learnable bias to the output
Shape:
  • Input: (N,Cin,Lin)(N,Cin,Lin)
  • Output: (N,Cout,Lout) where
  • Lout=(Lin1)stride2padding+kernel_size+output_padding
Variables:
  • weight (Tensor) – the learnable weights of the module of shape (in_channels, out_channels, kernel_size[0], kernel_size[1])
  • bias (Tensor) – the learnable bias of the module of shape (out_channels)
from: http://pytorch.org/docs/0.1.12/nn.html


本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

The deduced formulas of Conv1d and ConvTranspose1d 的相关文章

随机推荐

  • Jmeter —— 自动录制脚本

    目录 1 Jmeter配置 1 1新增一个线程组 1 2Jmeter中添加HTTP代理 1 3配置HTTP代理服务器 2 录制脚本 2 1配置本地代理 2 2访问页面进行操作 2 3脚本处理 1 Jmeter配置 1 1新增一个线程组 1
  • TOF/结构光camera区别、TOF同时成像深度图、IR图原理?

    TOF 结构光camera区别 参考 https zhuanlan zhihu com p 51218791 TOF是通过红外光发射器发射调制后的红外光脉冲 不停地打在物体表面 经反射后被接收器接收 通过相位的变化来计算时间差 进而结合光速
  • 【Qt】串口通讯

    Qt串口通信基础及名词说明 1 串口通信 1 波特率 2 数据位 3 停止位 4 奇偶校验位 2 名词介绍简单版 1 起始位 2 数据位 3 校验位 4 停止位 5 空闲位 2 Qt串口通信模块QtSerialPort简介 1 QSeria
  • Jmeter--记录一个使用CSV Data Set Config犯的低级错误

    关于Jmeter的这个元件CSV Data Set Config网上已有大量篇幅的文章去接受 并且介绍的都挺详细 这里就不再介绍 这里主要介绍第一次使用此元件时犯的错误 当脚本完成后 点击运行 但是在察看结果树中没有发现运行结果 可以说点击
  • SpringBoot 如何保证接口安全?老鸟们都是这么玩的!

    为什么要保证接口安全 对于互联网来说 只要你系统的接口暴露在外网 就避免不了接口安全问题 如果你的接口在外网裸奔 只要让黑客知道接口的地址和参数就可以调用 那简直就是灾难 举个例子 你的网站用户注册的时候 需要填写手机号 发送手机验证码 如
  • 23年找工作的心酸历程

    前几天在脉脉上看到一个热议话题 23年找工作的心酸历程 大家都知道近几年互联网大环境不好 找工作变得越来越卷了 就算是BAT这种大厂出来的 也不见得就有多好找工作 可想而知 如果你的背景和能力不是特别强 很有可能练简历关都过不了 特别是工作
  • SpringBoot 快速整合SpringDataJPA (基础篇)

    序言 SpringDataJPA秉承大道至简的设计理念 给我们的数据层开发带来的极大的便利 诸如基于注解就可完成实体 数据库的映射关系 提供自带的通用Repo接口 接口方法约定名称即可实现数据访问等特性都是值得称赞的功能 正文 Spring
  • Flutter踩坑之 Android license status unknown 解决方案

    问题引入 Mac上搭建Flutter开发环境文章中 在使用flutter doctor查看是否需要安装其它依赖项时 检测出三个问题 Doctor found issues in 3 categories 其中有关Android平台的报错如下
  • C++ sort()函数

    C 中的sort 函数是用于对容器 如数组 向量 链表等 中的元素进行排序的标准库函数 它使用了一种称为快速排序 quicksort 的排序算法 通常具有较好的性能 sort 函数位于
  • element 表格二次封装

  • Mac office 2016 word 出现隐藏模块中出现编译错误: link

    try to remove Library Group Containers UBF8T346G9 Office User Content Startup Word linkCreation dotm or whatever in that
  • Redis单机版全面讲解

    目录 常识 什么是redis redis为什么快 redis作为实例安装在系统中 redis数据类型 redis命令 String类型相关命令 list类型相关命令 hash类型相关命令 set类型相关命令 zset类型相关命令 redis
  • LAN8720A网络模块的使用问题

    一 LAN8720A模块驱动电路 最近在调试STM32F4驱动LAN8720A网络模块 在做方案前参考是正点原子的LAN8720A的驱动电路方案 但是从网上买回来的LAN8720A模块用正点原子的例程一直驱动不起来 在windows系统下一
  • vue提示插件[vscode]

    在VSCode Marketplace 搜素Vue 出现关于语法高亮的插件有 vue vue beautify vue color VueHelper vertur等等 比较了下载数量可以了解到 vetur 是目前比较好的语法高亮插件 我们
  • Eclipse使用(Java基础)&Spring boot学习(一)

    Eclipse安装 这个很简单 搜索一下Eclipse下载即可 我是在这里下的 然后选个开发环境 C 的话我会在Visual Studio下写 所以只装了Java 一路next就好 没有什么坑 Hello World Create a Ja
  • HADOOP介绍

    1 HADOOP背景介绍 1 1 什么是HADOOP HADOOP是apache旗下的一套开源软件平台 HADOOP提供的功能 利用服务器集群 根据用户的自定义业务逻辑 对海量数据进行分布式处理 HADOOP的核心组件有 HDFS 分布式文
  • 嵌入式操作系统风云录:历史演进与物联网未来.

    嵌入式操作系统风云录 历史演进与物联网未来 何小庆 著 图书在版编目 CIP 数据 嵌入式操作系统风云录 历史演进与物联网未来 何小庆著 北京 机械工业出版社 2016 10 ISBN 978 7 111 55085 3 嵌 何 实时操作系
  • Java项目结构概述

    文章目录 前言 一 项目结构介绍 1 单模块项目结构 2 多模块项目结构 3 分层结构 4 MVC项目结构 5 插件化结构项目 6 微服务架构结构 总结 前言 构建一个良好的Java项目结构是开发高质量 可扩展和易维护应用程序的重要基础 在
  • skimage图像的读取与保存

    首先 说明用opencv与skimage io imread读取和保存图片的区别 读取和保存后的都是numpy格式 但cv2的读取和存储格式是BGR 而skimage的读取和存储格式是RGB 1 读取图片 skimage读取图片 img s
  • The deduced formulas of Conv1d and ConvTranspose1d

    torch nn Conv1d in channels out channels kernel size stride 1 padding 0 dilation 1 groups 1 bias True In the simplest ca