wandb/examples

Example deep learning projects that use wandb's features.

wandb/examples – Ready‑to‑run code showing how to use Weights & Biases

What it is – This repository is a collection of short scripts and Colab notebooks that demonstrate how to integrate the Weights & Biases (W&B) library into typical machine‑learning workflows. The examples cover many popular frameworks (PyTorch, TensorFlow/Keras, Hugging Face Transformers, PyTorch Lightning, XGBoost, scikit‑learn, etc.) and illustrate the core W&B features: logging metrics, saving hyper‑parameters, tracking datasets, visualising runs, and managing model artifacts.

Why it matters – W&B is a platform for experiment tracking, model versioning, and collaborative reporting. By looking at these examples you can see, with minimal code, how to:

  • Start a run (wandb.init) and attach a project name.
  • Record configuration values (wandb.config).
  • Log scalar metrics (wandb.log).
  • Automatically capture model gradients, weights, and topology (run.watch).
  • Use framework‑specific helpers (e.g., wandb.keras.WandbMetricsLogger, WandbCallback for XGBoost, WandbLogger for PyTorch Lightning).
  • Store and retrieve datasets or model checkpoints via W&B Artifacts.
  • Finish a run cleanly (wandb.finish).

Key parts of the repo

  • examples/ – ready‑to‑run Python scripts for each framework, showing the minimal code needed to log a training loop.
  • colabs/ – Google‑Colab notebooks that let you try the integrations in a browser without any local setup.
  • A short Getting Started section in the README that walks you through installing the wandb package, logging in, and running a simple example that logs loss over ten steps.

Typical users

  • Data scientists and ML engineers who want to add experiment tracking to existing projects.
  • Students learning a new framework and looking for a concrete example of how to log runs.
  • Teams that need a shared dashboard for comparing hyper‑parameter sweeps, model performance, and resource usage.

How to start

  1. Install the core library:
    pip install wandb
    wandb login   # paste your API key from wandb.com
    
  2. Pick an example that matches your stack (e.g., examples/pytorch/train.py or colabs/keras.ipynb).
  3. Run the script or notebook; a new run will appear in your W&B dashboard where you can explore logged metrics, configs, and artifacts.

What you’ll see – The README includes a screenshot of a W&B dashboard and a link to a short video tour, so you can get a visual sense of the UI before you dive in.


All details above are taken directly from the repository’s README; no additional features are inferred.

Related

  • Project
  • Project
  • Dispatch
  • Project
  • Project