A minimalist implementation of a transformer model in pure Rust, built from scratch without external dependencies.
- π§ Transformer architecture implementation
- π€ Custom tokenizer
- π Matrix operations
- π’ Embedding layer
- π Multi-head attention mechanism
- π Feed-forward networks
- π Layer normalization
- π‘οΈ Temperature-controlled text generation
- Clone the repository
- Place your training text in the project root
- Run the project:
cargo run --release
Rustformer includes:
- Basic matrix operations
- Tokenization of input text
- Embedding layer
- Positional encoding
- Multi-head attention mechanism
- Feed-forward networks
- Layer normalization
- Training loop
- Text generation with temperature sampling