Skip to content

omarxadel/transformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Transformer from scratch

This project is an implementation of a transformer from scratch based on the proposed approach in Attention Is All You Need. A transformer is a deep learning model that adopts the mechanism of self-attention, differentially weighting the significance of each part of the input data. It is used primarily in the fields of natural language processing (NLP) and computer vision (CV).

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. Contact
  7. References

About The Project

This project is a very simple implementation of the transformer architecture with all of its building blocks. To get a better pictrure; here is the transformer architecture block diagram (Vaswani et al. 2017):

Figure 1

You can find each block of this diagram in the transformer directory.

Project Structure

│   README.md
│   .gitignore
│
└───src
│   └───model
│   └───test
│   └───transformer
|       |    transformer.py
|       └───decoder
|       └───encoder
|       └───modules
|
└───res                     <! --- Documentation resources --->

Built With

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

Installation

  1. Clone the repo
    git clone https://github.com/omarxadel/transformer
  2. Install requirements
    pip install -r /path/to/requirements.txt

Usage

This transformer has not yet been tested on a real-life use case (still work in progress). To validate that it's working you need to run in the CMD:

 python3 -m src.test.test_transformer

Roadmap

Building a model for a simple NLP task and validating it is still Work in Progress.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Omar Adel - omarxadel21@gmail.com

References

About

Transformer from scratch based on the proposed approach in Attention Is All You Need (Vaswani et al. 2017).

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages