Skip to content

Logging custom x values for graph#

When logging metrics or other series of values to be plotted as a chart, you can specify custom values to use for the x axis with the step argument.

run["metric"].log(
    value=acc,
    step=i,
)

Note

The entries logged for step must be strictly increasing.

Example#

You might use the epoch number as the index for the log() method when logging a series of Matplotlib figures.

import neptune.new as neptune
import matplotlib.pyplot as plt

run = neptune.init_run()

for epoch in range(100):
    plt_fig = get_histogram()

    run["train/distribution"].log(
        plt_fig,
        step=epoch,
    )