-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Support LayerScale #2451
Conversation
Codecov ReportBase: 66.62% // Head: 66.69% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## 2.x #2451 +/- ##
==========================================
+ Coverage 66.62% 66.69% +0.07%
==========================================
Files 120 120
Lines 7799 7816 +17
Branches 1067 1072 +5
==========================================
+ Hits 5196 5213 +17
Misses 2436 2436
Partials 167 167
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Co-authored-by: Zaida Zhou <[email protected]>
Co-authored-by: Zaida Zhou <[email protected]>
Hi! thanks for your contribution! Line 6 in ece11bc
is similar to LayerScale , could implement LayerScale there?
|
Hi ! CI seems failed now and we need to fix it 😸 |
@HAOCHENYE I have fixed test. |
LGTM 👍 ! My last comment: Please also update |
Thank you for your reviews! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* add layer scale * add layer scale * add layer scale * Update mmcv/cnn/bricks/transformer.py Co-authored-by: Zaida Zhou <[email protected]> * Update mmcv/cnn/bricks/transformer.py Co-authored-by: Zaida Zhou <[email protected]> * add layer scale * move LayerScale * add layer_scale_init_value * add typehint * fix for tensor with any dim * fix layer scale rule * fix layer scale rule * fix test * add docs Co-authored-by: Zaida Zhou <[email protected]>
Motivation
Support LayerScale from mmcls.
https://github.com/open-mmlab/mmclassification/blob/dev-1.x/mmcls/models/utils/layer_scale.py
Support LayerScale in FFN.
https://github.com/open-mmlab/mmclassification/blob/dev-1.x/mmcls/models/backbones/deit3.py#L18
It is also used in other backbones such as ViT-Adapter.
Related PR
open-mmlab/mmpretrain#1209
open-mmlab/mmdetection#9354
Checklist
Before PR:
After PR: