liveBook · Manning

Weights and Biases

As explained in Transformers in Action

Weights & Biases is a machine-learning experiment-tracking platform for recording, visualizing, and managing training runs and model artifacts.

Weights & Biases (W&B) organizes machine-learning development by tracking training and inference runs, visualizing results, monitoring resources, and sharing reports with a team. section 8.0 section 8.2.1

W&B supports several connected workflow tasks:

  • Records hyperparameters, training metrics, validation metrics, and run-level results for organized comparison. section 8.2.1
  • Monitors GPU allocation and utilization, helping estimate resource requirements and identify opportunities for lower-cost hardware. section 8.2.1
  • Runs framework-independent hyperparameter sweeps across tools such as PyTorch and Hugging Face Transformers. section 8.2.1
  • Shares dashboards, reports, tables, and generated outputs for collaborative model evaluation. section 8.4 section 10.1.2
Listing 8.9 Defining the sweep configuration
sweep_config = {
    'method': 'bayes',  
    'metric': {
      'name': 'eval_loss',
      'goal': 'minimize'},
    'parameters': {
      'learning_rate': {
        'min': 1e-5,
        'max': 5e-4},
      'num_train_epochs': {
        'values': [2, 3, 4]},
      'per_device_train_batch_size': {
        'values': [8, 16, 32]},
      'model_name_or_path': {
        'values': ['bert-base-uncased', 'distilbert-base-uncased']}
    },
    'early_terminate': {
      'type': 'hyperband',
      'min_iter': 3,  
      'eta': 2,  
      's': 2 }
}

A sweep configuration declares the search method, optimization metric, parameter ranges or values, and early-termination policy; W&B then provides views for comparing runs. section 8.2.1

Comparing generated text

Initialize a W&B project, generate several responses to one prompt with nucleus sampling, place the prompt and outputs in a W&B table, and inspect them in the dashboard alongside outputs from other methods or models. section 10.1.2

How Transformers in Action covers it

How deep it goes
Explains tracking, resource monitoring, sweeps, dashboards, and tables with configuration and executable workflow examples.
Examples
Uses GPU dashboards, Bayesian sweeps, parallel-coordinate plots, run tables, and generated-text comparison tables.
What it assumes
Assumes model training or generation workflows and hyperparameters, while demonstrating W&B integration through concrete configurations and code.
What you can do after
Operate/configure experiment tracking, resource monitoring, sweeps, dashboards, and collaborative output comparisons.
How it connects
Connects experiment tracking with hyperparameter optimization, model monitoring, result visualization, PyTorch, Hugging Face Transformers, and Ray.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Transformers in Action. The section links point to the parts of the book it draws on.