当前位置:网站首页>在网络中添加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也能够得到提升。
边栏推荐
- The method of using bat command to quickly create system restore point
- [virtualization] how to convert virtual machines from workstation to esxi
- My little idea -- using MATLAB to realize reading similar to ring buffer
- mysql数据库的授权访问
- [activiti] activiti environment configuration
- Flink task, sub task, task slot and parallelism
- Two architectures of data integration: ELT and ETL
- Brief introduction of [data mining] cluster analysis
- Canal+kafka actual combat (monitor MySQL binlog to realize data synchronization)
- The repetition detection function of PHP multi line text content and count the number of repetitions
猜你喜欢

Flink sql-client.sh use

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

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

达梦数据库_DISQL下各种连接数据库的方法和执行SQL、脚本的方法

【mycat】mycat安装

【mycat】mycat配置文件

达梦数据库_LENGTH_IN_CHAR和CHARSET的影响情况

《统计学习方法(第2版)》李航 第15章 奇异值分解 SVD 思维导图笔记 及 课后习题答案(步骤详细)SVD 矩阵奇异值 十五章
![[Baidu map API] the version of the map JS API you are using is too low and no longer maintained. In order to ensure the normal use of the basic functions of the map, please upgrade to the latest versi](/img/d5/b0e4cc4155673d6042a0e39de4eddf.png)
[Baidu map API] the version of the map JS API you are using is too low and no longer maintained. In order to ensure the normal use of the basic functions of the map, please upgrade to the latest versi

多商户商城系统功能拆解12讲-平台端商品评价
随机推荐
plsql查询数据乱码
[vSphere high availability] working principle of host and virtual machine fault monitoring
MySQL batch insert demo
Flink task, sub task, task slot and parallelism
达梦数据库_常用初始化参数
黑龙江省SVG格式地图的创建及生成
电商系统PC商城模块介绍
The female colleague of the company asked me to go to her residence to repair the computer at 11 o'clock at night. It turned out that disk C was popular. Look at my move to fix the female colleague's
Multi merchant mall system function disassembly lesson 03 - platform side merchant management
Flink重启策略
Likeshop single merchant SaaS mall system opens unlimited
数据库连接数过大
Highcharts use custom vector maps
Use streaming media to transfer RSTP to the Web terminal for playback (II) [review]
Flink Watermark机制
[vSphere high availability] virtual machine reset and restart
Numpy数组广播规则记忆方法 array broadcast 广播原理 广播机制
Vulnhub funbox: rookie (funbox2) target penetration
SqlServer 完全删除
数据集成的两种架构:ELT和ETL