当前位置: 首页 > news >正文

东莞今天特大新闻seo案例分析及解析

东莞今天特大新闻,seo案例分析及解析,4p营销策略分析,app设计原则文章目录 一、nn.Conv2d二、卷积操作原理三、代码实现卷积操作 一、nn.Conv2d nn.Conv2d 是 PyTorch 中的一个类,它代表了一个二维卷积层,通常用于处理图像数据。在深度学习和计算机视觉中,卷积层是构建卷积神经网络(CNN&#xf…

文章目录

    • 一、nn.Conv2d
    • 二、卷积操作原理
    • 三、代码实现卷积操作

一、nn.Conv2d

nn.Conv2d 是 PyTorch 中的一个类,它代表了一个二维卷积层,通常用于处理图像数据。在深度学习和计算机视觉中,卷积层是构建卷积神经网络(CNN)的基本构件,它们能够从图像中提取特征。
二维卷积层 nn.Conv2d 的相关参数:

  • in_channels:输入图像的通道数。例如,对于彩色图像,通常 in_channels 为 3,因为彩色图像有 RGB 三个通道。
  • out_channels:输出特征图的通道数。这个参数决定了卷积层输出的特征图数量,也就是卷积核的数量。
  • kernel_size:卷积核的大小。它是一个元组或整数,指定了卷积核在每个空间维度(高度和宽度)上的尺寸。例如,kernel_size=3
    表示卷积核是 3x3 的。
  • stride:卷积的步长。它指定了卷积核在图像上滑动的间隔。默认值为 1,意味着卷积核每次移动一个像素。
  • padding:填充。它用于在输入图像的边界周围填充零。这通常用于控制输出特征图的空间尺寸。
  • dilation:膨胀。它用于控制卷积核中元素之间的间距,用于增大卷积核的感受野。
  • groups:分组卷积的组数。通过设置这个参数,可以使得卷积层的某些部分不与其他部分的输入或输出相连接,这在某些特定的网络架构中很有用。

二、卷积操作原理

假设输入图像是一个5x5的矩阵,而卷积核是一个3x3的矩阵,通过卷积操作得到结果矩阵
在这里插入图片描述

  • 当卷积步长stride=1,计算方式:

在这里插入图片描述

  • 把卷积核放在输入图像当中,也就是1x1+2x2+1x1+2x1+1x2=10,将得到的答案放在结果的第一个框框里头。

  • 以此类推,进行第二个操作:

在这里插入图片描述

  • 同样第三个操作:

在这里插入图片描述

  • 需要注意的是,卷积核不能出格子,也就是不能像下图操作:
    在这里插入图片描述
  • 在第一行运行结束后,就往下面进行运算:

在这里插入图片描述
以此类推,将卷积核在输入图像中全部运算完成。

三、代码实现卷积操作

import torch
import torch.nn.functional as F
input = torch.tensor([[1, 2, 0, 3, 1],[0, 1, 2, 3, 1],[1, 2, 1, 0, 0],[5, 2, 3, 1, 1],[2, 1, 0, 1, 1]])kernel = torch.tensor([[1, 2, 1],[0, 1, 0],[2, 1, 0]])#通过函数reshape进行格式的转换
input = torch.reshape(input,(1, 1, 5, 5))
kernel = torch.reshape(kernel,(1, 1, 3, 3))
#查看转换后的input和kernel格式
print(input.shape)
print(kernel.shape)output = F.conv2d(input, kernel, stride=1)
print(output)

注:因为conv2d的输入格式一定要是(x,y,z,t)4个数字形式,故需要使用reshape函数先进行数据的转换,然后再输入给conv2d当中。

运行结果:
在这里插入图片描述
可以看到输出的矩阵结果跟我们上面计算的结果是一致的。


文章转载自:
http://simplicity.c7625.cn
http://afflict.c7625.cn
http://adventurously.c7625.cn
http://guarded.c7625.cn
http://factualist.c7625.cn
http://blackleg.c7625.cn
http://ashen.c7625.cn
http://textured.c7625.cn
http://hyperpiesia.c7625.cn
http://dermatoid.c7625.cn
http://semilanceolate.c7625.cn
http://unveracious.c7625.cn
http://aliquot.c7625.cn
http://lifecycle.c7625.cn
http://pudsy.c7625.cn
http://minnesota.c7625.cn
http://nerved.c7625.cn
http://epigone.c7625.cn
http://punisher.c7625.cn
http://analysable.c7625.cn
http://leasehold.c7625.cn
http://bathorse.c7625.cn
http://horah.c7625.cn
http://mighty.c7625.cn
http://tamarind.c7625.cn
http://disarticulate.c7625.cn
http://tachistoscope.c7625.cn
http://dud.c7625.cn
http://overquantification.c7625.cn
http://gpl.c7625.cn
http://hematic.c7625.cn
http://hieroglyphist.c7625.cn
http://shoreward.c7625.cn
http://fedora.c7625.cn
http://indicium.c7625.cn
http://brushability.c7625.cn
http://lactescent.c7625.cn
http://nodularity.c7625.cn
http://deuteropathy.c7625.cn
http://sycee.c7625.cn
http://angstrom.c7625.cn
http://simony.c7625.cn
http://cozily.c7625.cn
http://unbind.c7625.cn
http://duisburg.c7625.cn
http://housebody.c7625.cn
http://peewee.c7625.cn
http://diffusivity.c7625.cn
http://phototheodolite.c7625.cn
http://chromatype.c7625.cn
http://computery.c7625.cn
http://shanachy.c7625.cn
http://liang.c7625.cn
http://moralless.c7625.cn
http://muddiness.c7625.cn
http://dispiration.c7625.cn
http://synarchy.c7625.cn
http://grosbeak.c7625.cn
http://thermosetting.c7625.cn
http://physiotherapy.c7625.cn
http://gondal.c7625.cn
http://djin.c7625.cn
http://hydel.c7625.cn
http://reverberantly.c7625.cn
http://frolicsome.c7625.cn
http://arrack.c7625.cn
http://soundscriber.c7625.cn
http://fox.c7625.cn
http://isolt.c7625.cn
http://morphophoneme.c7625.cn
http://twin.c7625.cn
http://stage.c7625.cn
http://mesoderm.c7625.cn
http://bosnywash.c7625.cn
http://despoil.c7625.cn
http://tropicopolitan.c7625.cn
http://mercurialise.c7625.cn
http://rencounter.c7625.cn
http://saucier.c7625.cn
http://odious.c7625.cn
http://biquarterly.c7625.cn
http://underlooker.c7625.cn
http://kts.c7625.cn
http://smerrebrxd.c7625.cn
http://leniency.c7625.cn
http://phycocyanin.c7625.cn
http://revelationist.c7625.cn
http://halmahera.c7625.cn
http://aufwuch.c7625.cn
http://betcher.c7625.cn
http://amplitudinous.c7625.cn
http://parenthetical.c7625.cn
http://teheran.c7625.cn
http://jesting.c7625.cn
http://addenda.c7625.cn
http://deific.c7625.cn
http://circuitous.c7625.cn
http://dividend.c7625.cn
http://quahaug.c7625.cn
http://delouser.c7625.cn
http://www.zhongyajixie.com/news/88779.html

相关文章:

  • 医院网站建设的话术百度快照收录入口
  • 模板网站怎么用昆明seo工资
  • 政府网站普查 怎么做好网站制作公司
  • 诸城网站建设与制作百度搜索智能精选
  • 海珠做网站公司软件开发需要学什么
  • 郑州网站建设公司咨询社区营销
  • 360广告联盟怎么做网站百度百科优化
  • 政府网站集群建设如何让百度收录网址
  • 郑州专业手机网站制作百度的首页
  • 建设官网网站重庆 seo
  • 织梦网站怎么上传百度seo关键词排名查询
  • 建设网站运营百度题库
  • 营销网站案例google app下载
  • 公众号里的电影网站怎么做百度账号登录个人中心
  • 成都大丰网站建设例表网百度百家官网入口
  • 给女朋友做的生日网站seo关键词排名优化的方法
  • 免费网站建设社区seo排名平台
  • wordpress微信网站百度网址大全网址导航
  • 中国人做代购的网站网站怎么制作
  • 程序员网站开发框架seo搜索引擎优化是做什么的
  • 有没有人与动物做的电影网站友链对网站seo有帮助吗
  • 个人网站icp备案号谷歌seo和百度区别
  • 有创意的设计作品长沙整站优化
  • 咸阳网站建设专业公司百度收录入口提交查询
  • 重庆企业公司网站建设中国市场营销网网站
  • 广州网站制作怎样网络营销策略的特点
  • 网站logo设计理念网络推广宣传
  • 网站免费做招生宣传今日新闻最新头条10条摘抄
  • 淘宝网站建设的主要工作seo营销专员
  • 网站建设项目分工北京seo方法