当前位置:网站首页>在网络中添加SE通道注意力模块
在网络中添加SE通道注意力模块
2022-07-24 05:20:00 【河海CV小菜鸡】
第一步:首先在网络构造的py中添加SELayer这个类
class SELayer(nn.Module):
def __init__(self, channel, reduction=16):
super(SELayer, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.fc = nn.Sequential(
nn.Linear(channel, channel // reduction, bias=False),
nn.ReLU(inplace=True),
nn.Linear(channel // reduction, channel, bias=False),
nn.Sigmoid()
)
def forward(self, x):
b, c, _, _ = x.size()
y = self.avg_pool(x).view(b, c)
y = self.fc(y).view(b, c, 1, 1)
return x * y.expand_as(x)第二步:

在网络的body类中添加SE模块的属性。
注意:这个75是要修改的数字,比如我这里用的yolov3,使用的是voc数据集,所以这里应该是3*(4+1+20)=75.如果是两个类别就要改成3*(4+1+2)=21.
第三步:

在网络最后的output地方使用SE模块。
效果:


voc数据集使用一次后map提升了0.86.


自己一个很简单的数据集map也能够得到提升。
边栏推荐
- Wechat applet reports an error request:fail -2:net:: err_ FAILED
- MySQL和Oracle的语法差异
- Two architectures of data integration: ELT and ETL
- 数据集成的两种架构:ELT和ETL
- The method of using bat command to quickly create system restore point
- 【mycat】mycat相关概念
- Zotero Quick Start Guide
- 【activiti】个人任务
- Problems in SSM project configuration, various dependencies, etc. (for personal use)
- Small operation of statistical signal processing -- detection of deterministic DC signal in Rayleigh distributed noise
猜你喜欢

Vulnhub solidstate: 1 target penetration test

plsql查询数据乱码

Oracle数据库的逻辑结构

Flink format series (1) -json

The SaaS mall system of likeshop single merchant is built, and the code is open source without encryption.

【mycat】mycat相关概念

多商户商城系统功能拆解05讲-平台端商家主营类目

《统计学习方法(第2版)》李航 第22章 无监督学习方法总结 思维导图笔记

【数据挖掘】聚类分析的简要介绍

多商户商城系统功能拆解11讲-平台端商品栏目
随机推荐
Problems in SSM project configuration, various dependencies, etc. (for personal use)
多商户商城系统功能拆解08讲-平台端商品分类
Insanity:1 (insanity hosting) target penetration vulnhub
Are you still trying to limit MySQL paging?
The method of using bat command to quickly create system restore point
【vsphere高可用】主机出现故障或隔离后的处理
SSM项目配置中问题,各种依赖等(个人使用)
达梦数据库_LENGTH_IN_CHAR和CHARSET的影响情况
Likeshop100% open source encryption free B2B2C multi merchant mall system
Flink sql-client.sh使用
Sunset: noontide target penetration vulnhub
Too many database connections
数据库连接数过大
Vulnhub funbox: rookie (funbox2) target penetration
《统计学习方法(第2版)》李航 第22章 无监督学习方法总结 思维导图笔记
Multi merchant mall system function disassembly lecture 12 - platform side commodity evaluation
国内外知名源码商城系统盘点
ThreadLocal存储当前登录用户信息
达梦数据库_常用初始化参数
多商户商城系统功能拆解04讲-平台端商家入驻