-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update transformer block code to run with test code brought in
- Loading branch information
Showing
3 changed files
with
89 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,43 @@ | ||
# Implement Transformer (TODO reference) with C | ||
|
||
Implement Tranformer with C to understand the internal operations, so it is intentionally implemented for readablilty than optimality | ||
Implement Tranformer with C and Python for educational purpose. Code is written for readability. | ||
|
||
# Build | ||
|
||
``` | ||
cd sml | ||
cd lib/sml | ||
make | ||
cd .. | ||
cd src | ||
cd src/c | ||
make | ||
``` | ||
|
||
# Run | ||
|
||
## C version | ||
``` | ||
cd src | ||
cd src/c | ||
./transformer | ||
``` | ||
|
||
## Python version | ||
``` | ||
cd src/python | ||
python ./experiments/classify.py --random-seed=1234 --num-epochs=1 --tiny | ||
``` | ||
|
||
# TODO: | ||
- have a main Makefile | ||
- 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: | ||
- SML: small math library, http://www.bios.unc.edu/distrib/bios235/sml/ | ||
- Transformer tutorial: http://jalammar.github.io/illustrated-transformer/ | ||
- Transformer tutorial2: http://peterbloem.nl/blog/transformers | ||
- Python Transformer implementation: http://peterbloem.nl/blog/transformers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters