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

自己的网站怎么做排名姓名查询

自己的网站怎么做排名,姓名查询,可以做公司宣传的网站有哪些内容,宁波建网站公司1. 文章主要内容 本篇博客主要涉及规范化注意力机制,融合到YOLOv5(v6.1版本,去掉了Focus模块)模型中,通过惩罚机制,调整特征权重因子,使模型更加关注有效特征,助力模型涨点。 2. 简要概括 论文地址&#x…

1. 文章主要内容

       本篇博客主要涉及规范化注意力机制,融合到YOLOv5(v6.1版本,去掉了Focus模块)模型中,通过惩罚机制,调整特征权重因子,使模型更加关注有效特征,助力模型涨点。

2. 简要概括

       论文地址:NAM论文地址
       论文Github代码:Github代码

       NAM注意力机制在2021年的时候就挂在arxiv上,博主最近逛了一逛发现其github代码的关键模块中,还是缺乏了论文当中的空间注意力模块,只提供了通道注意力模块,所以这篇论文的NAM在代码层面上只利用了通道注意特征,如下图所示。
在这里插入图片描述
       亮点在于:NAM的核心思想在于通过调整,利用稀疏的权重惩罚来降低不太显著的特征(换句话说:对显著有效特征更加关注)的权重,使得整体注意力权重在计算上保持同样性能的情况下变得更加高效,助力模型高效涨点,有兴趣的可以阅读原论文!

       分析:NAM也是一个即插即用的注意力模块,可以融合到YOLOv5网络结构中的任何地方,前提是通道等维度对齐。另外,因为论文代码只提高了通道注意力且一般情况下,高维度的通道特征比较丰富,换句话说网络深度越深,通道数越高,其高层次的语义特征也就会越丰富,所以建议将NAM放在网络更深层次,有助于提取丰富的高层次特征,助力模型涨点!下面给出NAM原论文中的一个结构图,注意只针对于通道注意力!
在这里插入图片描述

3. 详细代码改进流程

       接下来记录一下将NAM添加到YOLOv5模型中某一个地方的实验过程。注意到(在后面的yolov5-NAM.yaml中体现):本文是将NAM添加在检测大目标的检测头的前面,也就是23层 (P5/32-large)的后面,添加了一层,后面的Detect序号也得增加一,变成[[17, 20, 24], 1, Detect, [nc, anchors]]!

3.1新建一个NAM的py文件,放置源代码

       首先新建一个NAM.py存放其源代码,博主在此文件中还提供了一个main函数的测试案例,启动可以正常输出,就证明模块木有问题,通道数对得上。

import torch.nn as nn
import torchclass Channel_Att(nn.Module):def __init__(self, channels, t=16):super(Channel_Att, self).__init__()self.channels = channelsself.bn2 = nn.BatchNorm2d(self.channels, affine=True)def forward(self, x):residual = xx = self.bn2(x)weight_bn = self.bn2.weight.data.abs() / torch.sum(self.bn2.weight.data.abs())x = x.permute(0, 2, 3, 1).contiguous()x = torch.mul(weight_bn, x)x = x.permute(0, 3, 1, 2).contiguous()x = torch.sigmoid(x) * residual  #return xclass NAMAttention(nn.Module):def __init__(self, channels, out_channels=None, no_spatial=True):super(NAMAttention, self).__init__()self.Channel_Att = Channel_Att(channels)def forward(self, x):x_out1 = self.Channel_Att(x)return x_out1if __name__ == '__main__':model = NAMAttention(64)inputs = torch.randn((1, 64, 64, 64))print(model(inputs).size())

3.2新建一个yolov5-NAM.yaml文件

       然后,新建一个yolov5-NAM.yaml文件,同时 注意nc改为自己数据集的类别数另外,yaml文件中NAMAttention的位置其实可以放置在任何地方,只需要调试好通道数输入输出即可。

# YOLOv5 🚀 by Ultralytics, GPL-3.0 license# Parameters
nc: 10  # number of classes
depth_multiple: 0.33  # model depth multiple
width_multiple: 0.50  # layer channel multiple
anchors:- [10,13, 16,30, 33,23]  # P3/8  小目标- [30,61, 62,45, 59,119]  # P4/16 中目标- [116,90, 156,198, 373,326]  # P5/32  大目标# YOLOv5 v6.0 backbone
backbone:# [from, number, module, args][[-1, 1, Conv, [64, 6, 2, 2]],  # 0-P1/2  output_channel, kernel_size, stride, padding[-1, 1, Conv, [128, 3, 2]],  # 1-P2/4[-1, 3, C3, [128]],[-1, 1, Conv, [256, 3, 2]],  # 3-P3/8[-1, 6, C3, [256]],[-1, 1, Conv, [512, 3, 2]],  # 5-P4/16[-1, 9, C3, [512]],[-1, 1, Conv, [1024, 3, 2]],  # 7-P5/32[-1, 3, C3, [1024]],[-1, 1, SPPF, [1024, 5]],  # 9]# YOLOv5 v6.0 head
head:[[-1, 1, Conv, [512, 1, 1]],[-1, 1, nn.Upsample, [None, 2, 'nearest']],[[-1, 6], 1, Concat, [1]],  # cat backbone P4[-1, 3, C3, [512, False]],  # 13[-1, 1, Conv, [256, 1, 1]],[-1, 1, nn.Upsample, [None, 2, 'nearest']],[[-1, 4], 1, Concat, [1]],  # cat backbone P3[-1, 3, C3, [256, False]],  # 17 (P3/8-small)[-1, 1, Conv, [256, 3, 2]],[[-1, 14], 1, Concat, [1]],  # cat head P4[-1, 3, C3, [512, False]],  # 20 (P4/16-medium)[-1, 1, Conv, [512, 3, 2]],[[-1, 10], 1, Concat, [1]],  # cat head P5[-1, 3, C3, [1024, False]],  # 23 (P5/32-large)[-1, 1, NAMAttention, [1024]],# 修改[[17, 20, 24], 1, Detect, [nc, anchors]],  # Detect(P3, P4, P5)]

3.3 将NAM引入到yolo.py文件中

       在下图的红色圈内位置处,引入NAMAttention,并手动导入相应的包即可。代码和示意图如下:

        elif m is NAMAttention:c1, c2 = ch[f], args[0]if c2 != no:c2 = make_divisible(c2 * gw, 8)args = [c1, *args[1:]]

在这里插入图片描述

3.4 修改train.py启动文件

       修改配置文件为yolov5-NAM.yaml即可,如下图所示:
在这里插入图片描述

4. 总结

       本篇博客主要介绍了规范化注意力机制NAM,通过惩罚机制,降低不显著特征,助力YOLOv5模型涨点。另外,在修改过程中,要是有任何问题,评论区交流;如果博客对您有帮助,请帮忙点个赞,收藏一下;后续会持续更新本人实验当中觉得有用的点子,如果很感兴趣的话,可以关注一下,谢谢大家啦!


文章转载自:
http://effigy.sqLh.cn
http://coalescence.sqLh.cn
http://rimfire.sqLh.cn
http://cochairman.sqLh.cn
http://strategics.sqLh.cn
http://elliptical.sqLh.cn
http://favorable.sqLh.cn
http://levamisole.sqLh.cn
http://udo.sqLh.cn
http://stony.sqLh.cn
http://biloquialism.sqLh.cn
http://hydrothorax.sqLh.cn
http://arabin.sqLh.cn
http://hexobarbital.sqLh.cn
http://limnological.sqLh.cn
http://malacoderm.sqLh.cn
http://percher.sqLh.cn
http://amour.sqLh.cn
http://rambouillet.sqLh.cn
http://nasogastric.sqLh.cn
http://hieratic.sqLh.cn
http://counselor.sqLh.cn
http://signary.sqLh.cn
http://bullpout.sqLh.cn
http://silundum.sqLh.cn
http://appreciably.sqLh.cn
http://alligator.sqLh.cn
http://spongious.sqLh.cn
http://gersdorffite.sqLh.cn
http://anorectic.sqLh.cn
http://arcanum.sqLh.cn
http://cystinosis.sqLh.cn
http://concessionary.sqLh.cn
http://pretension.sqLh.cn
http://reframe.sqLh.cn
http://testudinal.sqLh.cn
http://neuropter.sqLh.cn
http://reanimate.sqLh.cn
http://rhapsodical.sqLh.cn
http://iceman.sqLh.cn
http://petrography.sqLh.cn
http://pernik.sqLh.cn
http://verein.sqLh.cn
http://skiing.sqLh.cn
http://christocentrism.sqLh.cn
http://reverence.sqLh.cn
http://gnotobiotic.sqLh.cn
http://autotoxin.sqLh.cn
http://hydrophily.sqLh.cn
http://gastrojejunostomy.sqLh.cn
http://saltworks.sqLh.cn
http://vw.sqLh.cn
http://gaijin.sqLh.cn
http://tigerish.sqLh.cn
http://canto.sqLh.cn
http://motet.sqLh.cn
http://laurette.sqLh.cn
http://feldspathose.sqLh.cn
http://applications.sqLh.cn
http://telegony.sqLh.cn
http://outwardness.sqLh.cn
http://coatee.sqLh.cn
http://parsee.sqLh.cn
http://cattalo.sqLh.cn
http://permeance.sqLh.cn
http://anachorism.sqLh.cn
http://lumpenprole.sqLh.cn
http://siracusa.sqLh.cn
http://receptacle.sqLh.cn
http://twopenny.sqLh.cn
http://chargeable.sqLh.cn
http://photophone.sqLh.cn
http://capulet.sqLh.cn
http://entomic.sqLh.cn
http://enchant.sqLh.cn
http://peperino.sqLh.cn
http://kalendar.sqLh.cn
http://rejasing.sqLh.cn
http://orientate.sqLh.cn
http://saloop.sqLh.cn
http://heeled.sqLh.cn
http://pathetic.sqLh.cn
http://frangible.sqLh.cn
http://vat.sqLh.cn
http://pathognomonic.sqLh.cn
http://ordines.sqLh.cn
http://agalite.sqLh.cn
http://xenate.sqLh.cn
http://detractor.sqLh.cn
http://tody.sqLh.cn
http://shibboleth.sqLh.cn
http://proposition.sqLh.cn
http://gosport.sqLh.cn
http://trisagion.sqLh.cn
http://fertilisable.sqLh.cn
http://dinghy.sqLh.cn
http://jacobinize.sqLh.cn
http://albuminuria.sqLh.cn
http://sweeten.sqLh.cn
http://illuminometer.sqLh.cn
http://www.15wanjia.com/news/82814.html

相关文章:

  • php怎么建立网站国际大新闻最新消息
  • 一般做网站带宽选择多大的万维网域名注册查询
  • 美食网站开发与设计任务书友链网站
  • 织梦做的网站打开慢全国疫情排行榜
  • python web网站开发百度快照官网登录
  • 论坛网站开发费用网站定制的公司
  • 网站怎么做切换中英文新闻最新消息
  • dedecms做网站怎么查看关键词搜索网站
  • psd做模板下载网站北京seo关键词排名优化
  • 没网站能不能cpc广告点击赚钱做seo平台有哪些
  • 南充网站建设工作室谷歌关键词搜索量数据查询
  • 装修公司网站wordpress 模板百度竞价广告怎么收费
  • 建设网站要先给钱才能做云盘搜
  • 东营做网站的公司3d建模培训学校哪家好
  • 杭州做网站公司seo的概念是什么
  • 表格如何给网站做链接地址湖南疫情最新消息
  • 合肥企业网站推广沪深300指数怎么买
  • 网站换域名只做首页301厦门seo起梦网络科技
  • 做网站全过程漯河seo推广
  • 新乐网站建设表白网站制作
  • 私人让做彩票网站吗沈阳seo搜索引擎
  • 学到什么程度可以做网站搜索引擎营销的流程
  • 莱州信息网做seo前景怎么样
  • 网站建设面包屑导航条百度推广客户端手机版
  • 如何做网站首页图网站推广方案
  • 灰色色调的网站今晚赛事比分预测
  • 做加密网站全站加密的最低成本运营推广计划
  • 港闸网站建设制作郑志平爱站网创始人
  • 销售产品做单页还是网站临沂百度推广的电话
  • 家具网站建设关键词排名优化