← 开源
sooftware

attentions

PyTorch implementation of some attentions for Deep Learning Researchers.

Model DevelopmentArchitecturePython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
548
Star
73
Fork
+0
本周
1
贡献者
创建于 2020-03-21 · 更新于 2026-07-20 · 今日第 16370 名
主要开发者
README

An Apache 2.0 PyTorch implementation of some attentions for Deep Learning Researchers.


 [![](https://www.codefactor.io/repository/github/sooftware/attentions/badge)](https://www.codefactor.io/repository/github/sooftware/attentions)
 [![](http://img.shields.io/badge/license-Apache--2.0-informational)](https://github.com/sooftware/KoSpeech/blob/latest/LICENSE)
 [![](http://img.shields.io/badge/framework-PyTorch-informational)](https://github.com/pytorch/pytorch)
 [![](http://img.shields.io/badge/codestyle-PEP--8-informational)](https://www.python.org/dev/peps/pep-0008/)

Intro

attentions provides some attentions used in natural language processing using pytorch.
these attentions can used in neural machine translation, speech recognition, image captioning etc...

image

attention allows to attend to different parts of the source sentence at each step of the output generation.
Instead of encoding the input sequence into a single fixed context vector, we let the model learn how to generate a context vector for each output time step.

Implementation list

Name Citation
Additive Attention Bahdanau et al., 2015
Dot-Product Attention Luong et al., 2015
Location-Aware (Location Sensitive) Attention Chorowski et al., 2015
Scaled Dot-Product Attention Vaswani et al., 2017
Multi-Head Attention Vaswani et al., 2017
Relative Multi-Head Self Attention ZihangDai et al., 2019

Troubleshoots and Contributing

If you have any questions, bug reports, and feature requests, please open an issue on Github.
or Contacts [email protected] please.

I appreciate any kind of feedback or contribution. Feel free to proceed with small issues like bug fixes, documentation improvement. For major contributions and new features, please discuss with the collaborators in corresponding issues.

Code Style

I follow PEP-8 for code style. Especially the style of docstrings is important to generate documentation.

Author