Skip to content

project-89/transformer_tutor

 
 

Repository files navigation

A Set of Files to Give to a Tutor

If you want to work with an AI tutor to learn how transformers work at a granular level, these files will get you started.

Core Data Structures

matrix.js // Basic matrix operations and tensor manipulations embedding.js // Positional and token embedding implementations attention.js // Core attention mechanism multihead.js // Multi-head attention implementation

Layer Components

feedforward.js // Feed-forward neural network component layernorm.js // Layer normalization implementation sublayer.js // Sublayer with residual connections

Encoder-Decoder Structure

encoder.js // Complete encoder block decoder.js // Complete decoder block transformer.js // Full transformer architecture

Helper Utilities

masking.js // Padding and future masking utilities vocabulary.js // Token handling and vocabulary management optimizer.js // Basic gradient descent implementation

Training and Usage

train.js // Training loop and loss calculation inference.js // Inference and generation utilities config.js // Model configuration and hyperparameters

Example Usage

example.js // Simple translation example visualization.js // Attention visualization helpers

About

(p89 fork of ATH's LLM tutor -- original credit to matthew hendricks/tinycrops)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 69.2%
  • JavaScript 30.8%