Programmatic Access to Metrics
Created on September 12|Last edited on September 12
Comment
If you'd like to query points via the W&B API, you can do so via the following:
Querying sampled points in a run (more performant)
import wandbapi = wandb.Api()# access the run object via the apirun = api.run('<entity>/<project>/<run_id>')# history is a dataframe where each column corresponds to a metrichistory = run.history()
Querying all points in a run:
import wandbapi = wandb.Api()# access the run object via the apirun = api.run('<entity>/<project>/<run_id>')# full_history is an iterator that yields dictionaries from the run's history, one at a time.full_history = run.scan_history()# list of dictionaries where each dictionary represents a single step's data from the run's history.losses = [row for row in full_history]
Querying a summary metric (final point, best point, min/max)
The last value logged with wandb.log is automatically set as the summary dictionary in a W&B Run.
If you would like to utilize custom summary metrics to capture model performance at the best, min, or max step, check out the docs here.
import wandbapi = wandb.Api()# access the run object via the apirun = api.run('<entity>/<project>/<run_id>')# run.summary is a dictionary of the final points in trainingrun.summary
Add a comment