Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
🍀 Pytorch implementation of various Attention Mechanisms, MLP, Re-parameter, Convolution, which is helpful to further understand papers.⭐⭐⭐
| Date | Stars |
|---|---|
| 2026-07-24 | 12181 |
| 2026-07-25 | 12181 |
| 2026-07-28 | 12181 |
| 2026-07-30 | 12181 |
| 2026-08-06 | 12181 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
<img src="./FightingCVimg/LOGO.gif" height="200" width="400"/>
简体中文 | [English](./README_EN.md)
# FightingCV 代码库, 包含 [***Attention***](#attention-series),[***Backbone***](#backbone-series), [***MLP***](#mlp-series), [***Re-parameter***](#re-parameter-series), [**Convolution**](#convolution-series)



<!--
-------
*If this project is helpful to you, welcome to give a ***star***.*
*Don't forget to ***follow*** me to learn about project updates.*
-->
<!--
Hello,大家好,我是小马🚀🚀🚀
***For 小白(Like Me):***
最近在读论文的时候会发现一个问题,有时候论文核心思想非常简单,核心代码可能也就十几行。但是打开作者release的源码时,却发现提出的模块嵌入到分类、检测、分割等任务框架中,导致代码比较冗余,对于特定任务框架不熟悉的我,**很难找到核心代码**,导致在论文和网络思想的理解上会有一定困难。
***For 进阶者(Like You):***
如果把Conv、FC、RNN这些基本单元看做小的Lego积木,把Transformer、ResNet这些结构看成已经搭好的Lego城堡。那么本项目提供的模块就是一个个具有完整语义信息的Lego组件。**让科研工作者们避免反复造轮子**,只需思考如何利用这些“Lego组件”,搭建出更多绚烂多彩的作品。
***For 大神(May Be Like You):***
能力有限,**不喜轻喷**!!!
***For All:***
本项目致力于实现一个既能**让深度学习小白也能搞懂**,又能**服务科研和工业社区**的代码库。
-->
<!--
作为[**FightingCV公众号**](https://mp.weixin.qq.com/s/m9RiivbbDPdjABsTd6q8FA)和 **[FightingCV-Paper-Reading](https://github.com/xmu-xiaoma666/FightingCV-Paper-Reading)** 的补充,本项目的宗旨是从代码角度,实现🚀**让世界上没有难读的论文**🚀。
(同时也非常欢迎各位科研工作者将自己的工作的核心代码整理到本项目中,推动科研社区的发展,会在readme中注明代码的作者~)
## 技术交流 <img title="" src="https://user-images.githubusercontent.com/48054808/157800467-2a9946ad-30d1-49a9-b9db-ba33413d9c90.png" alt="" width="20">
欢迎大家关注公众号:**FightingCV**
| FightingCV公众号 | 小助手微信 (备注【**公司/学校+方向+ID**】)|
:-------------------------:|:-------------------------:
<img src='./FightingCVimg/FightingCV.jpg' width='200px'> | <img src='./FightingCVimg/xiaozhushou.jpg' width='200px'>
- 公众号**每天**都会进行**论文、算法和代码的干货分享**哦~
- **交流群每天分享一些最新的论文和解析**,欢迎大家一起**学习交流**哈~~~
- 强烈推荐大家关注[**知乎**](https://www.zhihu.com/people/jason-14-58-38/posts)账号和[**FightingCV公众号**](https://mp.weixin.qq.com/s/m9RiivbbDPdjABsTd6q8FA),可以快速了解到最新优质的干货资源。
-------
-->
## 🌟 Star History
[](https://star-history.com/#xmu-xiaoma666/External-Attention-pytorch&Date)
## 使用
### 安装
直接通过 pip 安装
```shell
pip install fightingcv-attention
```
或克隆该仓库
```shell
git clone https://github.com/xmu-xiaoma666/External-Attention-pytorch.git
cd External-Attention-pytorch
```
### 演示
#### 使用 pip 方式
```python
import torch
from torch import nn
from torch.nn import functional as F
# 使用 pip 方式
from fightingcv_attention.attention.MobileViTv2Attention import *
if __name__ == '__main__':
input=torch.randn(50,49,512)
sa = MobileViTv2Attention(d_model=512)
output=sa(input)
print(output.shape)
```
- pip包 内置模块使用参考: [fightingcv-attention 说明文档](./README_pip.md)
#### 使用 git 方式
```python
import torch
from torch import nn
from torch.nn import functional as F
# 与 pip方式 区别在于 将 `fightingcv_attention` 替换 `model`
from model.attention.MobileViTv2Attention import *
if __name__ == '__main__':
input=torch.randn(50,49,512)
sa = MobileViTv2Attention(d_model=512)
output=sa(input)
print(output.shape)
```
-------
# 目录
- [Attention Series](#attention-series)
- [1. External Attention Usage](#1-external-attention-usage)
- [2. Self Attention Usage](#2-self-attention-usage)
- [3. Simplified Self Attention Usage](#3-simplified-self-attention-usage)
- [4. Squeeze-and-Excitation Attention Usage](#4-squeeze-and-excitation-attention-usage)
- [5. SK Attention Usage](#5-sk-attention-usage)
- [6. CBAM Attention Usage](#6-cbam-attention-usage)
- [7. BAM Attention Usage](#7-bam-attention-usage)
- [8. ECA Attention Usage](#8-eca-attention-usage)
- [9. DANet Attention Usage](#9-danet-attention-usage)
- [10. Pyramid Split Attention (PSA) Usage](#10-Pyramid-Split-Attention-Usage)
- [11. Efficient Multi-Head SExcerpt of 63,343 characters
Read on GitHub271
52
Mango AI
46
8
youngpill · South Korea
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:3f1bfc134660f662, topic:pytorch