git clone https://github.com/burcukilic/transformers_scratch.git
cd transformers_scratch
python3.12 -m venv env
source env/bin/activate
pip install -e .The project is organized as follows:
.
βββ src/dt/
βββ blocks.py
βββ decision_transformer.py
βββ minari_train_bc.py
βββ minari_train_dt.py
βββ transformer_decoder.py
βββ transformer_encoder.py
βββ test_transformer_blocks.py
Key files and their roles:
* `src/dt/blocks.py`: Has the Sinusoidal positional encoding, feed forward block, and Multi Head Attention implementations.
* `src/dt/transformer_encoder.py`: The transformer encoder implementation
* `src/dt/transformer_decoder.py`: The transformer decoder implementation
* `src/dt/decision_transformer.py`: Uses the transformer decoder implementation for Decision Transformer, multiple classes for different purposes
* `src/dt/minari_train_bc.py`: Downloads D4RL PointMaze dataset from minari and trains a simple behavior cloning with the dataset
* `src/dt/minari_train_dt.py`: Downloads D4RL PointMaze dataset from minari and trains a decision transformer with the dataset