How do I log a list of values?
Support:
less than a minute
These examples show logging losses a couple of different ways using wandb.Run.log().
import wandb
# Initialize a new run
with wandb.init(project="log-list-values", name="log-dict") as run:
    # Log losses as a dictionary
    losses = [0.1, 0.2, 0.3, 0.4, 0.5]
    run.log({"losses": losses})
    run.log({f"losses/loss-{ii}": loss for ii, loss in enumerate(losses)})
import wandb
# Initialize a new run
with wandb.init(project="log-list-values", name="log-hist") as run:
    # Log losses as a histogram
    losses = [0.1, 0.2, 0.3, 0.4, 0.5]
    run.log({"losses": wandb.Histogram(losses)})
For more, see the documentation on logging.
Feedback
Was this page helpful?
Glad to hear it! If you have more to say, please let us know.
Sorry to hear that. Please tell us how we can improve.