GithubHelp home page GithubHelp logo

ristoale97 / yati Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 689 KB

Yet Another Transformer Implementation

License: MIT License

Python 100.00%
deep-learning neural-networks transformer transformer-architecture transformer-pytorch

yati's Introduction

๐Ÿค– Yet Another Transformer Implementation ๐Ÿค–

Python Pytorch

Warning

This repository was developed for academic and personal purposes in order to better understand the underlying architecture of the Transformer and to use it for future small projects.


๐Ÿ“ฆ Installation

First, clone the repo.

git clone https://github.com/RistoAle97/yati

Then, install the dependencies.

pip install -r requirements.txt

๐Ÿ› ๏ธ Implementation details

Note

Some implementation choices have been made that may differ from the original paper [1]:

  • The source and target embeddings are shared, so a unified vocabulary (one for all the languages in a NMT task to give an example) is needed.
  • The embeddings are tied to the linear output (i.e.: they share the weights).
  • Pre-normalization was employed instead of post-normalization [2].
  • Layer normalization [3] is performed at the end of both the encoder and decoder stacks.
  • There is no softmax layer as it is already used by the CrossEntropy loss function implemented in PyTorch.

Hereafter a comparison between the original transformer and the one from this repository.

Original This repository

๐Ÿ“š Bibliography

[1] Vaswani, Ashish, et al. "Attention is all you need.". Advances in neural information processing systems 30 (2017).

[2] Nguyen, Toan Q., and Julian Salazar. "Transformers without tears: Improving the normalization of self-attention.". arXiv preprint arXiv:1910.05895 (2019).

[3] Ba, Jimmy Lei, Jamie Ryan Kiros, and Geoffrey E. Hinton. "Layer normalization". arXiv preprint arXiv:1607.06450 (2016).

Some additional nice reads:

๐Ÿ“ License

This project is MIT licensed.

yati's People

Contributors

ristoale97 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.