๐Ÿ”ฅLimited Offer: Get 50% OFFon AI & Full Stack Courses๐Ÿ”ฅ
Back to Deep Learning Notes
Topic #419

Experiment Tracking

A real project runs many training experiments โ€” different hyperparameters, architectures, and data versions โ€” and experiment tracking is the discipline of systematically recording each run so results remain comparable and reproducible.

What to Track for Every Experiment

CategoryExamples
ConfigurationHyperparameters, architecture choice, random seed
DataDataset version/hash used for this specific run
CodeGit commit hash, so the exact code that produced this result can be recovered later
MetricsTraining/validation loss and metrics, logged throughout training, not just the final value
ArtifactsThe resulting model checkpoint, plots, and any other outputs

Why Ad Hoc Tracking (Spreadsheets, Memory) Breaks Down

With just a handful of experiments, informally remembering "run 3 with a lower learning rate" might work โ€” but as experiment count grows into the dozens or hundreds (routine during hyperparameter search, see the Hyperparameter Tuning category), manually tracking configuration and results becomes unreliable and error-prone, and questions like "which exact run produced our best model, and with what config?" become genuinely hard to answer without a system.

Code โ€” Tracking Experiments Programmatically

import mlflow   # covered in full in the next note

with mlflow.start_run():
    mlflow.log_params({"learning_rate": 0.001, "batch_size": 32, "optimizer": "adam"})

    for epoch in range(num_epochs):
        train_loss = train_one_epoch(model, train_loader, optimizer)
        val_loss, val_acc = evaluate(model, val_loader)
        mlflow.log_metrics({"train_loss": train_loss, "val_loss": val_loss, "val_acc": val_acc}, step=epoch)

    mlflow.pytorch.log_model(model, "model")

Every run is now automatically recorded with its exact configuration, per-epoch metrics, and resulting model artifact โ€” queryable and comparable later without relying on memory or manual notes.

Comparing Runs Systematically

A dedicated experiment tracking tool provides a UI or query interface to sort and filter runs by any logged metric or parameter โ€” directly answering questions like "show me every run with learning rate below 0.001, sorted by validation accuracy" instantly, something a manual spreadsheet approach struggles to support well at scale.

Common Mistakes

  • Relying on informal notes, filenames, or memory to track experiment configurations โ€” this breaks down quickly as the number of experiments grows, and makes past results hard to reliably reproduce or compare.
  • Logging only the final metric value rather than metrics throughout training โ€” this loses valuable information for diagnosing training dynamics (e.g. when overfitting began) after the fact.

Interview Relevance

Q: "Why does experiment tracking become essential once a team is running systematic hyperparameter search, rather than just a few manual training runs?" Systematic search (grid search, random search, Bayesian optimization) can easily produce dozens to hundreds of runs โ€” manually tracking each run's exact configuration and results becomes unreliable and error-prone at this scale, and answering "which configuration actually produced the best result" becomes genuinely hard without a system. Dedicated tracking tools log configuration, metrics, and artifacts automatically for every run, making them reliably queryable and comparable later.

Practice Question

Why is it valuable to log a training run's exact git commit hash alongside its hyperparameters and results?

Want to go beyond the notes?

Join CodingNow 2.0's Deep Learning course โ€” live mentorship, real projects, and 100% placement support.

Enroll Now โ€” Free Demo Available

Experiment Tracking โ€“ FAQs

Quick answers about learning Experiment Tracking in Deep Learning.

This free note from CodingNow 2.0 explains Experiment Tracking in Deep Learning โ€” concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Deep Learning topic on CodingNow 2.0, including Experiment Tracking, is 100% free with no signup required.
With focused practice, most students grasp Experiment Tracking in 1โ€“3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) โ€” expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now