Skip to content

ming-make/Transformer-Backward-Propagation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Transformer Backward Propagation

Introduction

This is an implementation of backward propagation of Transformer by Pytorch w/Python3.8 based on the paper: Attention is all you need.

Requirements

torch==2.2.0
numpy==1.22.3

Project Structure

.
|-- Back_Propagation
|   |-- Encoder.py
|   |-- FFN.py
|   |-- LayerNorm.py
|   |-- MultiHead.py
|   |-- __pycache__
|   |   |-- FFN.cpython-38.pyc
|   |   |-- LayerNorm.cpython-38.pyc
|   |   `-- MultiHead.cpython-38.pyc
|   |-- basic_layer.py
|   `-- requirements.txt
|-- LICENSE
|-- README.md

You can test the implementation of back propagation by running the commented code at the bottom of each python file.

Finished

  • FFN Layer
  • Linear Layer
  • Multi-head Attention Layer
  • Encoder Layer

To Do

  • Embedding Layer
  • Decoder Layer
  • Encoder
  • Decoder
  • Transformer

Notice: Without considering dropout

References

About

Backward Propagation of Classical Transformer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages