huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
132.06k stars 26.31k forks source link

Add SENet Blocks in Encoding Layers #11998

Open calusbr opened 3 years ago

calusbr commented 3 years ago

🚀 Feature Request

I read the article "SesameBERT: Attention for Anywhere" and would like to add SENet blocks in the Huggingface implementation. The article's authors made an implementation with Tensorflow, but I would like to use the lib in pytorch.

Motivation

The use of (Squeeze-and-Excitation Networks) SENet Blocks has obtained state-of-the-art results. And they seem to be promising in NLP.

Your contribution

I know that it is possible to modify the [BertLayer()] and [BertEnconder()] classes

Any suggestions on how to modify the code so that you can apply the idea used in the article?

image

AdityaDas-IITM commented 3 years ago

Hey, I'd like to work on implementing this feature if it hasn't been done yet.