Status: active.
This crate is the executable companion for 03 Neuron and 04 Learning.
It models the first honest training system in the course with:
- semantic newtypes for inputs, weights, bias, prediction, target, loss, and gradients
- a single-neuron forward pass with manual backpropagation
- SGD updates and epoch-level dataset training helpers
- tiny boolean datasets such as OR and AND
- token-target utilities that bridge scalar supervision to next-token loss
- a tiny bigram next-token model using
token -> embedding -> lm_head -> logits
src/
bigram.rs
dataset.rs
neuron.rs
optimizer.rs
token_targets.rs
lib.rs
examples/
train_bigram_cycle.rs
train_or_gate.rs
token_targets.rs
cargo test --manifest-path code/neuron/Cargo.tomlcargo run --example train_or_gate --manifest-path code/neuron/Cargo.tomlcargo run --example train_bigram_cycle --manifest-path code/neuron/Cargo.tomlcargo run --example token_targets --manifest-path code/neuron/Cargo.tomlThis crate is intentionally educational, not production-grade. It does not include:
- mini-batch loaders
- momentum or Adam
- autograd
- matrix-based multi-layer backpropagation
- full tokenizer or vocabulary tooling
- Transformer training
The goal is to make the first training loop and the token-target bridge explicit.