Tan_pytorch_segmentation/pytorch_segmentation/PV_Attention/Pyramid Split Attention(PSA...

18 lines
847 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
EPSANet: An Efficient Pyramid Split Attention Block on Convolutional Neural Network---arXiv 2021.05.30
论文地址https://arxiv.org/pdf/2105.14447.pdf
这是深大5月30日在arXiv上上传的一篇文章本文的目的是如何获取并探索不同尺度的空间信息来丰富特征空间。网络结构相对来说也比较简单主要分成四步
第一步将原来的feature根据通道分成n组然后对不同的组进行不同尺度的卷积得到新的特征W1
第二步用SE在原来的特征上进行SE从而获得不同的阿头疼托尼
第三步对不同组进行SOFTMAX
第四步将获得attention与原来的特征W1相乘。
"""
from attention.PSA import PSA
import torch
input = torch.randn(50, 512, 7, 7)
psa = PSA(channel=512, reduction=8)
output = psa(input)
print(output.shape)