'Multiple lines on same plot with incremental logging - wandb

I am using weights & biases (wandb). I want to group multiple plots into one while using incremental logging, any way to do that?

Say we have 10 metrics, I can add them to the project incrementally, gradually building 10 graphs:

import wandb
import math

N_STEPS = 100

wandb.init(project="someProject", name="testMultipleLines")
for epoch in range(N_STEPS):
    log = {}
    log['main_metric'] = epoch / N_STEPS  # some main metric

    # some other metrics I want to have all on 1 plot
    other_metrics = {}
    for j in range(10):
        other_metrics[f'metric_{j}'] = math.sin(j * math.pi * (epoch / N_STEPS))
    log['other_metrics'] = other_metrics

    wandb.log(log)

This by default gets presented on the wandb interface as 11 different plots. How can they be grouped through the API (without using the web interface) such that main_metric is on one figure and all other_metrics are bunched together on a second figure?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source