W&B Report and Workspace API is in Public Preview.
Try in Colab
wandb-workspaces
W&B library. You can load and modify workspaces by URL, use expressions to filter and group runs, and customize the appearances of runs.
wandb-workspaces
is a Python library for programmatically creating and customizing W&B Workspaces and Reports.
In this tutorial you will see how to use wandb-workspaces
to create and customize workspaces by defining configurations, set panel layouts, and organize sections.
How to use this notebook
- Run each cell one at a time.
- Copy and paste the URL that is printed after you run a cell to view the changes made to the workspace.
Programmatic interaction with workspaces is currently supported for Saved workspaces views. Saved workspaces views are collaborative snapshots of a workspace. Anyone on your team can view, edit, and save changes to saved workspace views.
1. Install and import dependencies
2. Create a new project and workspace
For this tutorial we will create a new project so that we can experiment with thewandb_workspaces
API:
Note: You can load an existing workspace using its unique Saved view
URL. See the next code block to see how to do this.
(Optional) Load an existing project and workspace
Instead of creating a new project, you can load one of your own existing project and workspace. To do this, find the unique workspace URL and pass it tows.Workspace.from_url
as a string. The URL has the form https://wandb.ai/[SOURCE-ENTITY]/[SOURCE-USER]?nw=abc
.
For example:
3. Programmatic workspace examples
Below are examples for using programmatic workspace features:Create a workspace with saved view
This example demonstrates how to create a new workspace and populate it with sections and panels. Workspaces can be edited like regular Python objects, providing flexibility and ease of use.
Load a workspace from a URL
Duplicate and customize workspaces without affecting the original setup. To do this, load an existing workspace and save it as a new view:Basic settings
The following code shows how to create a workspace, add sections with panels, and configure settings for the workspace, individual sections, and panels:Customize runs
The following code cells show you how to filter, change the color, group, and sort runs programmatically. In each example, the general workflow is to specify the desired customization as an argument to the appropriate parameter inws.RunsetSettings
.
Filter runs
You can create filters with python expressions and metrics you log withwandb.log
or that are logged automatically as part of the run such as Created Timestamp. You can also reference filters by how they appear in the W&B App UI such as the Name, Tags, or ID.
The following example shows how to filter runs based on the validation loss summary, validation accuracy summary, and the regex specified: