Log custom x values for graph#
When logging metrics (or other series of values), you can set custom values for the x axis with the step
argument.
Note
The entries logged for step
must be strictly increasing Int or Float values.
How the step is incremented#
If the step
argument is not provided, the step is automatically incremented on each append()
call, in steps of 1.
This means that if you first log some custom step
values in increments other than 1 and then continue logging values without the step
argument, the step values will continue where they left off but in increments of 1.
Example
If you log step values at increments of 10:
the final step will be 90
. If you then append more values, without providing a step:
the second set of step values will be logged in increments of 1 (starting from 91
).
Logging images with custom index#
You might use the epoch
number as the index for the append()
method when logging a series of Matplotlib figures.
import neptune
import matplotlib.pyplot as plt
run = neptune.init_run()
for epoch in range(100):
plt_fig = get_histogram()
run["train/distribution"].append(
plt_fig,
step=epoch,
)
Logging custom charts#
If you have customized charts with special values for the x axis, rather than logging the individual values as a series, you can create your own plot objects and upload those to Neptune.
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(7, 9))
run["matplotlib-fig"].upload(fig)