Example Gallery
Every runnable example in examples/ writes a header-row CSV to its output/ directory and ships a plot.py that renders the network’s behavior. Reproduce any graph below with:
cd examples/<name> && make run && make plot # writes output/*.csv and a PNG
The plot scripts share one style module, examples/plotting/tinymind_plot.py (matplotlib only, headless-safe). The CSV-first contract means you can also drop the data into pandas / a spreadsheet and build your own visualizations.
The graphs below use the dark theme to match this site; make plot defaults to a light theme (readable on any viewer). Set TINYMIND_PLOT_THEME=dark to reproduce these exactly.
Training dynamics
XOR learning curve — Q16.16 fixed-point MLP (2→4→1). 
KAN XOR learning curve — Kolmogorov-Arnold network with learnable B-spline edges. 
GRU XOR learning curve — Q16.16 GRU; the four-case error falls from chance (~0.5) to ~0.06 and plateaus. 
LSTM sinusoid — Q16.16 LSTM on a held-out, half-sample-shifted sinusoid: one-step-ahead RMS error 0.0076 and auto-regressive free-run 0.011, against 0.111 for persistence. 
LSTM sinusoid, float vs Q16.16 — the same LSTM trained in double and in Q16.16, side by side. 
Elman vs MLP on temporal XOR — the Elman network recovers x[t] XOR x[t-1] from its recurrent memory; the MLP, with no access to x[t-1], stays near 0.5. 
Neuro-fuzzy inference
Mackey-Glass ANFIS — Jang’s benchmark, a 16-rule Takagi-Sugeno system in 448 bytes of Q16.16: held-out fit, hybrid training, the rule base read back, and what pruning an oversized 81-rule grid recovers. 
int8 ANFIS — the same model on the int8 tier: accuracy holds, but the grade lookup tables make it 9.9x larger than Q16.16. A negative result, measured. 
Liquid neural networks (continuous-time)
LTC — fused ODE-solver cell trained to a leaky-integrator step response via reverse-mode autodiff. 
CfC — closed-form continuous-time cell on irregularly sampled held-out data, against the same cell blind to the elapsed time ts. 
int8 QCfC — pure-integer CfC cell tracking the float reference, with per-step quantization error. 
Physics-Informed NN
1-D heat equation — exact-autodiff residual training + learned field vs the analytic solution. 
int8 quantization parity
Transformer encoder block (int8) — int8 vs float output overlay + per-element quantization error. 
Transformer encoder stack (int8) — token embedding + sinusoidal positional encoding + 2 stacked linear-attention blocks, end-to-end. 
Transformer encoder stack, softmax attention (int8) — same stack with standard softmax self-attention (score grid + exp LUT). 
Encoder-decoder (seq2seq, int8) — encoder memory + decoder with causal self-attention and cross-attention; O(1) KV-cache decode matches the full-sequence pass byte-for-byte. 
Autoregressive generation (int8) — a decoder-only nano-LM generates token-by-token via step() over a fixed E×E KV state; int8 greedy decode reproduces the float reference’s tokens (48/48). 
seq2seq, softmax decoder (int8) — the seq2seq decoder with standard softmax self/cross-attention (growing KV cache + exp LUT); incremental decode matches the full-sequence pass byte-for-byte. 
State-space / S4-lite (int8) — a diagonal linear-recurrent layer filters a signal with a fixed O(1) state; int8 streaming step() matches the full-sequence pass byte-for-byte. 
GBDT decision regions (int8) — a gradient-boosted decision-tree ensemble classifies a 2D feature grid; int8 compare-and-branch inference reproduces the float tree’s regions. 
MobileNetV2-shaped pipeline (int8) — logit parity vs the float reference. 
ResNet residual block (int8) — int8 vs float output across 32 elements, with per-element error. 
ResNet-18 stem and block (int8) — logit parity vs the float reference; per-element error stays under 0.01. 
Mixed-precision KWS — int8 frontend, fp16 attention head, int8 classifier; output parity vs float. 
Hybrid int8 + Q-format MLP — int8 affine and Q8.8 layers joined by pure-integer bridges; per-element error under ~0.0043. 
Fixed-point log-mel front end — QLogMelSpectrogram<256, 32> on a synthetic vibration run whose level rises 44 dB (a bearing fault starts halfway): the float and fixed-point spectrograms, their difference, and the error by how far a band sits below the frame’s loudest band. 
On-device vibration anomaly detection — log-mel features of a synthetic machine and a k-means baseline learned frame by frame on the device: anomaly score over normal running and three growing faults, alarm rates, and how early each fault is caught, against a Euclidean k-means and a host-fitted Gaussian. 
Importer round trip (int8) — a 3-8-4-2 MLP calibrated with three observers and cross-layer equalization; int8 vs float parity, error near 0.004. 
Importer round trip, LSTM (int8) — an nn.LSTM + linear head imported onto QLSTMCell + QDense: one sequence’s hidden-state trace (int16 and int8 cell state against float) and the head output over 16 test sequences. 
Generated model from ONNX (int8) — a residual CNN quantized by ONNX Runtime and run from the generated model.hpp: the activation memory plan (each box an arena buffer, spanning the layers it is live for; 1,024 bytes against 2,048 unshared) and the test confusion on the optical digits (97.0%). 
Mixture-of-Experts
int8 MoE regime routing — a top-1 router partitions the input domain into three regimes; one of three linear experts runs per inference (color blocks = the routing map). 
UCI dataset solutions
End-to-end examples on real (or documented-synthetic) UCI datasets — see the UCI Dataset Capability Report for which example uses which dataset.
Iris — Q16.16 MLP (4→8→3) species classifier; training loss, test confusion, petal-space predictions. 
Energy Efficiency — Q16.16 MLP (8→16→2) regression of building heating/cooling load; predicted vs actual. 
Optical digits — Q16.16 MLP (64→32→10) on 8×8 handwritten-digit bitmaps; loss + 10×10 confusion. 
Optical digits, sample predictions — sampled 8×8 test bitmaps titled with true and predicted labels, red when misclassified. 
Human activity recognition — recurrent LstmNeuralNetwork (3→16→4) over tri-axial accelerometer windows; upstairs and downstairs differ only in sample order. 
Japanese Vowels — recurrent ElmanNeuralNetwork (12→16→9) speaker ID; trained offline in float, then swept across fixed-point formats. Q8.8 matches double precision (92.97%) at 4× smaller weights. 
Gas sensor array drift — MLP (128→32→6) trained on batch 1; accuracy decays across later batches as sensors drift. 
Gas sensor drift, adapted on the device — head-only fine-tuning (DenseHead), a class-mean PrototypeHead, re-normalization and bias training compared from 1 to 20 labelled samples per class. 
Air quality forecasting — recurrent LSTM (1→16→1) one-step-ahead hourly pollutant forecast. 
Cost & performance
KWS pipeline per-layer cost — compute cost + stacked weight/activation footprint per layer. 
KWS pipeline per-layer cost (int8) — the int8 counterpart: per-layer compute cost and weight/activation footprint. 
SIMD backends — int8 QConv2D / QDense throughput across backends (output checksum identical — bit-exact). 
Applications
XOR decision surface — PyTorch-trained weights, pure-integer tinymind inference; learned boundary as a heatmap. 
XOR decision surface, Q16.16 — tinymind-trained fixed-point MLP swept over the input grid; heatmap is P(XOR=1). 
PyTorch XOR, Q16.16 — PyTorch-trained weights, fixed-point tinymind inference. 
GRU XOR decision surface — the trained GRU swept over the input grid, state reset at each point. 
KAN XOR decision surface — trained on the four XOR points only: every corner is right, but ~60 spline coefficients constrained by 4 points give a busy surface. 
KAN XOR, dense training — trained over the whole input region, the KAN recovers the clean four-quadrant XOR map. 
Predictive maintenance — training loss + test confusion matrix (machine-failure classifier). 
Q-learning maze — per-start-state navigation trajectories.
DQN maze — greedy rollouts of the trained value network from every start room. 