lifecycle:training

Training

The repeatable path from validated data to a versioned model artifact.

19

Lessons

Formal explanations, examples, simulations, and checkpoints.

Engineering foundations

From notebook to reproducible run

A reproducible result is a result whose complete input identity can be replayed.

Engineering foundations

Contracts before models

Contracts keep bad meaning from becoming good-looking features.

Engineering foundations

Training code is product code

The shipped model is the reloaded artifact, not the object still living in the trainer.

Engineering foundations

Containers and configuration without surprises

A container is reproducible only when its image, inputs, configuration, and outputs all have explicit identities.

Engineering foundations

Observable, idempotent, failure-safe workflows

A safe workflow makes commitment atomic and repetition uneventful.

Engineering foundations

Read a research paper as an executable specification

Turn a research paper into a testable claim map, implementation contract, and prioritized reading plan before writing code.

Engineering foundations

Reproduce, validate, and productionize a paper

Implement a paper from baseline to novel component, diagnose reproduction gaps, and adapt it for production without silently changing its claim.

Neural networks from scratch

Beyond linear boundaries

Hidden nonlinearities earn their place by making the final decision simpler in a learned representation.

Neural networks from scratch

Forward pass, activations, losses, and initialization

A trustworthy forward pass makes shapes, activation semantics, initialization, and loss expectations explicit.

Neural networks from scratch

Backpropagation without magic

Backprop becomes ordinary once every edge in the forward graph has a local derivative you can inspect.

Neural networks from scratch

SGD, momentum, AdamW, and schedules

The trained state is parameters plus optimizer history, schedule position, data order, and randomness.

Neural networks from scratch

Regularize, normalize, debug, and ship

Shipping a network means freezing its inference behavior, not merely saving its weights.

Neural networks from scratch

Activation functions: geometry, gradients, and failure modes

Select activation functions by signal range, gradient flow, architecture, precision, and failure mode; then diagnose saturation and dead units from telemetry.

Neural networks from scratch

Loss functions by task, data, and deployment constraints

Choose and debug training objectives as optimization surrogates for the real task, including imbalance, outliers, uncertainty, ranking, dense prediction, and generation.

GPU-aware training

What the GPU actually executes

GPU performance comes from feeding a few substantial, well-shaped kernels—not merely from placing tensors on a CUDA device.

GPU-aware training

Keep it fed: loaders and async copies

A fast training step needs an equally deliberate supply chain from storage to pinned memory to the device.

GPU-aware training

Mixed precision without NaNs

Mixed precision is trustworthy only when dtype choices, loss scaling, skipped steps, and quality parity are all observable.

GPU-aware training

Activations, accumulation, and checkpointing

Checkpointing trades compute for activation memory; accumulation trades update frequency for batch memory—measure and validate each trade separately.

GPU-aware training

Profile from timeline to cost per sample

Profile a controlled workload, explain the timeline, and judge improvements by cost to an unchanged quality target.