Status: active.
This crate is the executable companion for 05 MLP.
It teaches the first step beyond a single neuron: hidden activations create intermediate representations.
- lesson module: 05 MLP
- active teaching crate
- deterministic XOR-shaped forward pass
- explicit
TryFromadapters for raw learner numbers - typed layer roles and shape checks
- typed
std::opsarithmetic for dot-product pieces and bias addition - public trace review boundary for learner-facing representation evidence
- no training claim; this crate focuses on representation and shape flow
src/
error.rs
lib.rs
examples/
01_hidden_features.rs
02_shape_flow.rs
03_forward_trace.rs
04_xor_table.rs
05_public_trace.rs
01_hidden_featuresshows what the hidden units detect.02_shape_flownames the typed map through the network.03_forward_traceprints every important intermediate value.04_xor_tableshows why hidden representation can solve a pattern one straight-line neuron cannot.05_public_traceshows how a reviewed forward trace becomes publishable learner-facing material.
Read the MLP as a composition of representation maps:
InputVector -> HiddenPreActivation
HiddenPreActivation -> HiddenActivation
HiddenActivation -> OutputLogit
OutputLogit -> Prediction
ReviewedForwardTrace -> PublicForwardTrace
The composition rule is shape agreement. A WeightMatrix can follow an
InputVector or HiddenActivation only when the vector width matches the
matrix input width.
cargo test --manifest-path code/Cargo.toml -p rust_ml_mlp --all-targetscargo run --manifest-path code/Cargo.toml -p rust_ml_mlp --example 01_hidden_features
cargo run --manifest-path code/Cargo.toml -p rust_ml_mlp --example 02_shape_flow
cargo run --manifest-path code/Cargo.toml -p rust_ml_mlp --example 03_forward_trace
cargo run --manifest-path code/Cargo.toml -p rust_ml_mlp --example 04_xor_table
cargo run --manifest-path code/Cargo.toml -p rust_ml_mlp --example 05_public_traceThis crate intentionally does not implement backpropagation for MLPs.
Module 04 teaches the update loop with a single neuron. This crate teaches the next structural idea:
InputVector -> HiddenActivation -> OutputLogit -> Prediction
ReviewedForwardTrace -> PublicForwardTrace
The public API avoids raw domain primitives. Examples parse raw numbers at the edge into InputValue, WeightValue, and BiasValue, then the forward pass moves through typed vectors, matrix rows, dimensions, logits, and predictions.
The public trace boundary keeps representation evidence separate from release
permission: a ForwardTrace explains the computation, while a
PublicForwardTrace proves the trace was reviewed for learner-facing use.