Appearance
RoNetV4.1
A modular neural network library for Luau, written as strict (--!strict) modules. It includes an autograd engine, tensor and matrix kernels, transformer building blocks, a set of optimizers, a training loop, and a byte-level BPE tokenizer. It runs entirely on the stock Luau command line interpreter with no external packages.
What you get
coreautograd engine with a Tensor type and a finite-difference-verified set of operatorsnnlayers: Linear, Activations, Norm, Dropout, Embedding, RoPE, Attention (causal, grouped-query), FFN (SwiGLU), Sequentialmodels: MLP, TransformerBlock (pre-norm with ReZero/DeepNorm options), and a Transformer with batched forward, shifted next-token loss, and autoregressive generationloss: stable cross-entropy with label smoothing, plus KL, JS, focal, BCE, and LM next-token lossesoptim: AdamW, AdEMAMix, Lion, NAdamW, CautiousAdamW, ScheduleFreeAdamW, SOAP, Muon, MuonAdamWtrain: LR schedulers, EMA weight averaging, checkpoint serialization, and a batched Trainer loopdata: a deterministic byte-level BPE tokenizer with state persistence
Exploring the docs
- Quick start walks through a small classifier and a tiny language model.
- API reference documents every module. The pages are generated from the doc comments in the source by
node docs/gen.mjs.
Running the tests
sh
bash tests/run_all.sh # uses `luau` from PATH
LUAU=/path/to/luau bash tests/run_all.shThe suite covers the tensor engine with finite differences, every layer, every optimizer, the training stack, the BPE tokenizer, and one end-to-end language model fit followed by generation and checkpoint round-trips.