Plot array, over time

Hi all,

I have a simple 1D array (e.g. norm of each layer), that I want to plot over time (e.g. plot “norm against array index”, each time step). Should I create a line plot? How can I overlay line plots as they are updated?

Thanks! Carlos

Hi Carlos,

Yes absolutely! A line plot can work to display the norm of a layer. You can also log the weights of a layer individually as a histogram to get a more granular sense of your layers. This is done as

wandb.log({
    'layer' : wandb.Histogram(<array-like>)
})

Ok, thanks for replying! But if I want to have a chart that overlays line plots for each epoch, generated e.g. like this:

data = [[x, y] for (x, y) in zip(range(len(norms)), norms)]
table = wandb.Table(data = norms, columns = [“index”, “norm”])
norms_line = wandb.plot.line(table, “index”, “norm”, title=“Norms by layer”)
wandb.log({“epoch”: epoch, “norms”: norms_line})

It creates a chart with the line plot, but I couldn’t figure out how to modify the chart to overlay the lines for all epochs.

A related question, media charts created for each step seem to generate a scroll bar below automatically, to navigate the step/epoch. Can I add the same to this line plot, to navigate how it changed during each epoch?

Thanks again for taking the time.

Hey @cstein!

The easiest way to do this would be to use wandb.log to log your metrics and them overlaying them through the UI. As an example, let’s assume we have 2 metrics - Test/Loss and Test/Accuracy which have been logged through wandb.log. They can be overlayed as:

output

Please let me know if you face any issues!

Thanks,
Ramit

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.