Recipes¶
Small, runnable, self-contained programs that each demonstrate one tool. Each recipe is a CMake
target built from a .cpp file in examples/recipes/, paired with one of the pages below. Every
page covers what you'll build, the code, how to run it, the expected output, and what's
happening. (The visualization page uses an existing GUI demo instead of a recipe file.)
Build and run a recipe¶
Build a single recipe instead of the whole project, then run it:
cmake --build build --target <recipe_target> --config Release
./build/<recipe_target> # Linux/macOS (single-config generators)
build\Release\<recipe_target>.exe # Windows (Visual Studio, multi-config)
Printed numbers can differ slightly across compilers and standard libraries. The expected output on each page notes where this is noticeable.
Recipes are smaller and more didactic than the full demos in
examples/ (see
examples/README.md).
Recipes link to the related full demo where one exists.
Deep Learning Modules and Layers¶
- XOR training walkthrough
- RNN vs. LSTM vs. GRU on a parity task
- Residual connections and normalization layers
- Full fine-tuning: pretrain, save, reload, fine-tune
- What did the fine-tune change? LoRA and full fine-tuning of SmolLM2, explained
- Is the student born better? Born-again networks on MNIST, over five seeds
- Half the layers: distilling SmolLM2 the way DistilBERT was made
Data Loading, Transformation & Validation¶
Interpretability¶
- KernelSHAP basics
- LIME basics
- Saliency and Integrated Gradients
- Grad-CAM walkthrough
- LRP on a trained MNIST classifier
- LRP on ImageNet models (ResNet18, VGG16)
- Can I trust this explanation? Four explainers of SmolLM2, each with a report
- How sure is the model? Calibration, uncertainty and conformal prediction on TEM-1 with ESM-2
Reinforcement Learning¶
Mechanistic Interpretability¶
- Sparse autoencoder + linear probe
- GFlowNet on HyperGrid
- Is the shape real? Calendar circles in SmolLM2 and Llama, tested