Comments (4)
抱歉,这两天在广州玩,回复得慢了一些。
concat(x, y)+ conv 的方式融合权重不是 1 和 1,是 W_A * X[:, i, j] + W_B * Y[:, i, j],这个在论文里有写到。虽然不是 1 和 1,但这个仍然是线性的。
的确,如您所说,concat 规避了直接相加,但会增加显存和计算量,或许基于 Concat 会有性能更好的架构,但这个超出 AFF 一文的初衷了,AFF 只要就是想传达三点:
- 注意力机制可以被用在所有的特征融合场景中(同层、长跳、短跳、乃至注意力本身)
- 通道注意力也可以有尺度这一概念,可以多尺度
- X + Y 可能是瓶颈所在。
我相信肯定有比目前 AFF 结构更为合理、性能更好的结构,很高兴与您交流。
from open-aff.
逻辑或者说动机大概是这样的:
第一层,以 ResNet、FPN 为代表,融合方式 X + Y,这种线性融合方式给定了固定的权重,即 1 和 1;(PWConv(X + Y) (比如FPN)、 PWConv(Concat(X,Y)) (U-Net)这两种本质上也是线性的,跟 X + Y 一样)
第二层,以 SKNet、AFF 为代表,融合方式 AFF(X, Y) = X * M(X + Y) + Y * (1 - M(X + Y)) ( M 为注意力模块,SKNet 用的是 Softmax,此外 AFF 的注意力模块不同,但这里忽略这些细节),Motivation 是用 注意力机制动态、自适应分配的权重 来代替上面的固定权重,可以得到更好的效果。虽然认为 X + Y 这类线性的简单融合是性能瓶颈之一,但在注意力模块 M 中仍然用着性能瓶颈 X + Y。
第三层,iAFF,iAFF(X, Y) = X * M(AFF(X, Y)) + Y * (1 - M(AFF(X, Y))),(AFF(X, Y) 是上一层 AFF 得到的特征),用 AFF(X, Y) 代替了(或者说缓解了)注意力模块 M 中我们不想要的 X + Y,改善了注意力模块的输入质量,输出权重也相应的改善了。其实 AFF(X, Y) 里面还是有 X + Y,所以这个过程可以一直迭代下去,所以叫做 iterative AFF,但是考虑到边际效应以及计算量、内存使用的增长,我们就止步于此了。
from open-aff.
两天多没有等到您的进一步回复,那我 close issue 了哈。
from open-aff.
有个问题就是concat(x+y)+conv的方式融合权重不是1和1把,那么我们在开始时是不是可以不用x+y的方式,而是用concat的方式,这样就不用两次注意力了,但我此处指在fpn结构上,因为放在基础网络上,concat方式会增加显存和计算量
from open-aff.
Related Issues (20)
- AFF-FPN HOT 3
- ASKCResNetFPN
- 您好,请问AFF模块中的最后一步为什么要乘以2?有什么意义呢?希望收到您的回复 HOT 2
- TypeError: forward() missing 1 required positional argument: 'residual' HOT 2
- resnet50预训练模型 HOT 3
- module -> self.global_att2
- __init__() takes from 1 to 3 positional arguments but 6 were given
- 代码中AFF模块中,为什么要用2×呢? HOT 1
- 请教 这种特征融合思路能否应用到 NLP 中?
- 可否进行实现三种特征图的融合 HOT 1
- Concat and fusion instead of add in iAFF and AFF
- iAFF类的forward函数中, xg2 = self.global_att(xi) 这一行是不是笔误 HOT 1
- 运行模块时报错请教 HOT 1
- aff使用于fpn或者Unet结构 HOT 2
- When the website will be ready?
- 为何将iaff加入到resnet第一层会报如下错误:TypeError: forward() missing 1 required positional argument: 'residual'
- 您好可以发一下iAFF-ResNeXt-50-32x4d训练ImageNet的权重文件吗
- ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 256, 1, 1]) HOT 2
- 关于BN层 HOT 2
- 请问怎么在pytorch直接使用AFF呀? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-aff.