> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

> Track ML experiments with Weights & Biases to log metrics, hyperparameters, system metrics, and model artifacts.

# Experiments overview

[Try in Colab](https://colab.research.google.com/github/wandb/examples/blob/master/colabs/intro/Intro_to_Weights_%26_Biases.ipynb)

[Try in W\&B](https://forge.coreweave.com/wandb/stacey/deep-drive/workspace?workspace=user-lavanyashukla)

Track machine learning experiments with a few lines of code. You can then review the results in an [interactive dashboard](https://docs.coreweave.com/products/wandb/track/workspaces.md) or export your data to Python for programmatic access using our [Public API](https://docs.coreweave.com/products/wandb/ref/python/public-api.md).

Utilize Weights & Biases integrations if you use popular frameworks such as [Keras](https://docs.coreweave.com/products/wandb/integrations/keras.md). See [Weights & Biases integrations](https://docs.coreweave.com/products/wandb/integrations.md) for a full list of integrations and information on how to add Weights & Biases to your code.

![Experiments dashboard](https://mintcdn.com/coreweave-dbfa0e8d/3Dv_sw2eg8feUJlx/products/wandb/_media/experiments_landing_page.png?fit=max\&auto=format\&n=3Dv_sw2eg8feUJlx\&q=85\&s=b705bd9ebe6cd3c71dcb4af3c539761f)

The image above shows an example dashboard where you can view and compare metrics across multiple [runs](https://docs.coreweave.com/products/wandb/runs.md).

## How it works

Track a machine learning experiment with a few lines of code:

1. Create a [W\&B Run](https://docs.coreweave.com/products/wandb/runs.md).
2. Store a dictionary of hyperparameters, such as learning rate or model type, into your configuration ([`wandb.Run.config`](https://docs.coreweave.com/products/wandb/track/config)).
3. Log metrics ([`wandb.Run.log()`](https://docs.coreweave.com/products/wandb/track/log)) over time in a training loop, such as accuracy and loss.
4. Save outputs of a run, like the model weights or a table of predictions.

The following code demonstrates a common Weights & Biases experiment tracking workflow. Replace `my-team` with your Weights & Biases team entity and `my-project-name` with your project name.

```python theme={"system"}
import wandb

entity = "<my-team>"  # Set entity to your W&B team name
project = "my-project-name"  # Set project to your W&B project name

# When this block exits, it waits for logged data to finish uploading.
# If an exception is raised, the run is marked failed.
with wandb.init(entity=entity, project="my-project-name") as run:
  # Save model inputs and hyperparameters.
  run.config.learning_rate = 0.01

  # Run your experiment code.
  for epoch in range(num_epochs):
    # Do some training...

    # Log metrics over time to visualize model performance.
    run.log({"loss": loss})

  # Upload model outputs as artifacts.
  run.log_artifact(model)
```

## Get started

Depending on your use case, explore the following resources to get started with W\&B Experiments:

* Read the [Weights & Biases Quickstart](https://docs.coreweave.com/products/wandb/quickstart.md) to learn how to set up Weights & Biases and track your first experiment.
* Try the [Get Started with Weights & Biases](https://docs.coreweave.com/products/wandb/models_quickstart.md) to learn how to use Weights & Biases to track, share, and manage model artifacts in your machine learning workflows.
* Explore this chapter to learn how to:
  * [Create an experiment](https://docs.coreweave.com/products/wandb/track/create-an-experiment.md)
  * [Configure experiments](https://docs.coreweave.com/products/wandb/track/config.md)
  * [Log data from experiments](https://docs.coreweave.com/products/wandb/track/log.md)
  * [View results from experiments](https://docs.coreweave.com/products/wandb/track/workspaces.md)
* Explore the [W\&B Python Library](https://docs.coreweave.com/products/wandb/ref/python.md) within the [W\&B API Reference Guide](https://docs.coreweave.com/products/wandb/ref/python.md).

## Best practices and tips

For best practices and tips for experiments and logging, see [Best Practices: Experiments and Logging](https://forge.coreweave.com/wandb/wandb/pytorch-lightning-e2e/reports/W-B-Best-Practices-Guide--VmlldzozNTU1ODY1#w\&b-experiments-and-logging).
