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
