Skip to content

About

Implementing Transformers from Scratch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decision Transformer Implementation

📦 Installation

git clone https://github.com/burcukilic/transformers_scratch.git
cd transformers_scratch
python3.12 -m venv env
source env/bin/activate
pip install -e .

📁 File Structure

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

About

Implementing Transformers from Scratch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages