/transformer_simple

Simple Implement Transformer with C and Python for educational purpose

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Simple Implementation for Transformer with C and Python

Implement Tranformer with C and Python for educational purpose. Code is written for readability.

Build

cd lib/sml
make
cd ..

cd src/c
make

Run

C version

cd src/c
./transformer

Python version

cd src/python

python ./experiments/classify.py  --random-seed=1234 --num-epochs=1 --tiny

TODO:

  • 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

Reference: