Skip to main content
App version: 3.4.6

Metric previews

You can log metrics that are not fully computed yet and display them in the Neptune app.

If you work with metrics that take much time to compute, you can log partial results for a given step and then gradually update these values. With each call, you can also indicate the completion level of the metric computation.

Log metric previews

You can log a preview value for a step if a fully computed value hasn't been yet logged for this or following steps.

To indicate that the logged values are preview values, use the preview and preview_completion arguments:

run.log_metrics(
data={"loss": 0.13},
step=2.0,
preview=True,
preview_completion=0.8, # value between 0 and 1.0
)

A higher value of the preview_completion argument indicates that the metric computation is closer to being completed. Note that the metric previews with a completion value of 1.0 are still considered previews.

Metric previews aren't inherited when forking experiments.

Overwrite preview values

You can update the preview values as well as their completion level:

run.log_metrics(
data={"loss": 0.18},
step=2.0,
preview=True,
preview_completion=0.9,
)

You can override preview_completion with either a lower or higher value.

Replace previews with fully computed values

To override a preview with a fully computed value, skip the preview argument or set it to False:

run.log_metrics(
data={"loss": 0.12},
step=2.0,
preview=False,
)

Note that after logging a final value for a step, you can't change it back to a preview value.

Analyze metric previews in the app

Once you log metric previews to Neptune, you can work with them in the app. You can display incomplete points in the Charts tab, and configure chart widgets in your dashboards and reports to include point previews together with their completion level.

For details, see Display point previews.

Chart widget in the Neptune app. Displays both the metric and its completion level.

Fetch metric previews via API

See Query metadata: Fetch metric previews.