Azim Haffar
Back to projects

ML tooling / Real-time systems / Engineering notes

ML Training Inspector

Inspect the repository

Python / PyTorch / FastAPI / WebSockets / React / JavaScript

What I built

I built a live training dashboard and verified its charts and epoch table against a reproducible synthetic PyTorch CPU run.

Key decision

keep run ownership explicit

Verification

Revision c23afc9: 16 backend and four frontend tests passed. Desktop and mobile checks compared two saved synthetic CPU runs.

Synthetic results demonstrate the pipeline, not model quality. Resume is absent; one worker and one shared run.

ML Training Inspector showing measured synthetic CPU demo loss, accuracy and gradient charts
Actual dashboard from a seeded two-epoch synthetic CPU run. The observed metrics verify the visualization pipeline, not real-world predictive quality. Checkpoint resume is unavailable. Select the image for the full-size capture.

The decision, at a glance

How do you make a training loop understandable?

  1. 01

    Measure training

    Collect loss, accuracy, gradients and run state.

  2. 02

    Bound delivery

    Use per-client queues for live WebSocket feedback.

  3. 03

    Make state visible

    Distinguish completed, stopped and error outcomes.

Recorded evidence

The recorded two-epoch synthetic CPU run matched the dashboard charts and epoch table.

Read the verification scope ↗

Synthetic results demonstrate the pipeline. Checkpoint resume is unavailable.

Explore a training run

Recorded data · simulated playback

Lower loss. Better model?

Play two recorded epochs from the seeded synthetic CPU demo. Pause and compare training with validation. No model runs in your browser; playback timing is illustrative.

Ready · 0 / 2 epochs revealedSeed 42 · SimpleCNN · CPU

Training vs. validation loss

● Training● Validation
012

Start playback or advance one epoch at a time. Exact metrics will appear here.

The useful question is what happens outside training.

In this short synthetic run, training accuracy reaches 100% while validation accuracy falls to 10%. These observations verify the reporting pipeline, not model quality. Short-run BatchNorm evaluation differs considerably from training behavior; two epochs do not establish generalization.

Source: 4 October 2026 verification · 160 training / 80 validation synthetic examples. Playback pause controls this explanation only; it does not demonstrate backend checkpoint resume. Read project verification.

Saved runs and evaluation split

Saved runs can be compared side by side, including runs with differing settings and older runs with missing fields. CIFAR-10 uses a 45,000/5,000 train/validation split and a separate final test entry point. Full CIFAR-10 training and final test execution were outside this verification.

The problem

A training loop can produce numbers without making its behavior understandable. I built a browser dashboard to expose loss, accuracy, gradients, class-level results, and run state while training progresses.

My contribution

I connected PyTorch training to FastAPI and WebSockets, built React charts and an accessible epoch table, and added manual stopping and checkpoint saving. Recent work corrects example-weighted loss aggregation, bounds per-client queues, handles disconnects and terminal outcomes, and adds a seeded, download-free CPU demonstration.

One decision: keep run ownership explicit

The backend deliberately supports one shared run in one worker. Conflicting starts receive HTTP 409. Bounded client queues protect memory, and reconnects recover status and the latest epoch metadata rather than promising missed chart history. Stopped and error states remain distinct from successful completion.

Verification and evidence scope

The earlier published record reports 15 backend tests and two frontend tests, plus a successful production build. A real browser CPU run rendered charts and an epoch table whose values matched the demo. The seeded SimpleCNN run used two epochs, 160 synthetic training examples, and 80 validation examples. Model/optimizer loading reproduced validation metrics, but scheduler, random-state, and sampler state are not preserved, so resume is absent. The measured synthetic accuracy is not evidence of generalization; earlier repeated CIFAR-10 test-split results do not establish an unbiased benchmark.

Demo

Follow the published README to install the CPU demo dependencies and run python scripts/demo.py. For the browser walkthrough, start the backend with one worker and the frontend, choose the synthetic dataset, and run two SimpleCNN epochs. Inspect the charts and matching epoch table, then explore stop and snapshot controls. The capture on this page comes from the verified synthetic run. No public hosted service is linked.

Limits and next work

GPU runs, full CIFAR-10 training, ResNet9 training, containers, and cross-platform repeatability were not verified in that record. There is no authentication or per-user ownership. Heuristic gradient signals have no detection-quality evaluation; some near-zero gradients can be benign. Checkpoint resume and reconnect chart-history replay are not implemented.

Keep exploring / Next case studyHeart Disease Prediction SystemGet in touch