An implementation of transformer model in Rust
- Pure Rust implementation of transformer architectures
- Support for encoder, decoder, and encoder-decoder models
- Multi-head attention, positional encoding, and feed-forward layers
- Configurable hyperparameters
- Easy-to-use API for training and inference
Add the following to your Cargo.toml:
[dependencies]
transformer-rs = "0.1"use transformer_rs::{Transformer, TransformerConfig};
let config = TransformerConfig::default();
let model = Transformer::new(config);
// Example input
let input = vec![1, 2, 3, 4];
let output = model.forward(&input);
println!("{:?}", output);See the examples/ directory for sample usage and training scripts.
Full API documentation is available here.
Contributions are welcome! Please open issues or submit pull requests.
This project is licensed under the MIT License.