Implement Tranformer with C and Python for educational purpose. Code is written for readability.
cd lib/sml
make
cd ..
cd src/c
make
cd src/c
./transformer
cd src/python
python ./experiments/classify.py --random-seed=1234 --num-epochs=1 --tiny
- main Makefile for build library and c executable
- add config load
- add trained weight load
- add python code to generate test vector, and use that to test the C code
- SML: small math library, http://www.bios.unc.edu/distrib/bios235/sml/
- Transformer tutorial: http://jalammar.github.io/illustrated-transformer/
- Python Transformer implementation: http://peterbloem.nl/blog/transformers
- tranformer implementation: https://github.com/tunz/transformer-pytorch