Skip to content

Charts#

Dashboard with charts in Neptune

The Charts tab displays any logged numerical series (FloatSeries fields).

You can view multiple charts at once, or maximize the space of a single chart for deeper analysis.

A customizable legend helps analyze runs without leaving the tab.

See example charts in Neptune 

How to log a numerical series?

Use the append() method of the Neptune client library to log a series of floating point values, such as metrics or losses.

run = neptune.init_run()

for epoch in range(parameters["n_epochs"]):
    ...  # My training loop

    run["train_dice_loss"].append(train_dice_loss)

You can also use extend() to pass a collection of values to be appended at once.

Zooming the chart#

Click and drag over an area of the chart to zoom in.

To reset the zoom, use the icon above the smoothing slider.

Exporting filtered charts#

To apply a filter on the field name, enter a term or regular expression in the input box.

Once you're happy with the filtered charts, click Export to.

  • Dashboard: Saves the set of charts as a template that can be applied to any selected runs.
  • Report: Saves the set of charts, including the current run selection.

Note: The result snapshots the field names that match the search query at the time. The dashboard doesn't dynamically update if new metric names appear and they match the originally used filter.

Editing the legend#

Chart widget with legend

While comparing multiple runs, the legend shows additional metadata of selected ( ) runs.

  • Pinned columns are automatically included.
  • Use the Add column button to include additional fields.
  • Use the search ( ) to locate matching values among the added columns.

The legend configuration applies globally across the project's charts.

Comparing grouped runs#

While showing experiments in Group mode, you can represent each group as a single line.

In the Charts tab, toggle Average grouped runs in the top menu.

The below example shows runs grouped by dataset version hash. You need to additionally toggle on grouping in the chart options, as shown in the screenshot.

See in Neptune 

Comparing multiple metrics of the same run#

Note

Combining multiple different metrics in a single chart is currently only supported for one run at a time.

If you've logged several metrics to a single run, you can display them on the same chart in a dashboard.

To create a chart with multiple graphs:

  1. In a dashboard, add a new Chart widget or edit an existing one.
  2. Type in a field (metric) to display as a graph and select it from the list.
  3. Enter and select additional fields to include in the chart.
  4. Once finished, save your changes.

Creating a custom chart widget with several graphs

See example charts in Neptune 

Downsampling and smoothing#

Neptune applies two smoothing functions to data displayed in charts:

  1. Downsampling algorithm when fetching data from the servers.
  2. Smoothing function controlled by the slider next to the chart.

The shaded area represents the margin of error (the minimum and maximum y values) of the values returned by the downsampling algorithm.

Learn more about the smoothing functions

If there are more than 1024 data points in the fetched data, the Neptune servers automatically downsample the values by taking the average of each consecutive value pair and forming a new value series out of the averages. The length of the new series is thus half of the original series.

This downsampling continues as long as the resulting series contains more than 1024 values.

The function returns a margin of error or uncertainty, which is displayed as a shaded area in the chart:

Visualized error margin in downsampled values

If you zoom in on a specific region (click and drag to the range) with less than 1024 data points, the chart updates to show the actual logged values.

The smoothing function is manually controlled with the slider on the right of a chart. The values range from a minimum of 1 to a maximum of 100 and increase in increments of 9.

Manual smoothing in Neptune

When you move the smoothing slider, Neptune applies a low-pass filter to the y values in the chart. Additionally, the function takes as input the margin of error (the minimum and maximum y values) of the values returned by the downsampling algorithm.

Smoothing function example
import math


def smooth(last, value):
    # Weighted average if last value is known, else just return the value
    return (
        weight * last + (1 - weight) * value if math.isfinite(last) else value
    )


def lowPassFilter(val):
    if val == 0 or val[1] == 0:
        return 0

    low = smooth(0, val[0])
    mid = smooth(0, val[1])
    high = smooth(0, val[2])

    return [low, mid, high]


def smoothData(data, smoothingValue):

    if len(data) == 0:
        return data

    global weight
    weight = 1 if smoothingValue > 100 else (smoothingValue - 1) / 100

    colCount = len(data[0])

    newData = dict()
    for i in range(len(data)):
        for k in range(1, colCount):
            newData[data[i][0]] = lowPassFilter(data[i][k])

    return newData

The input shape is [x, [minY, Y, maxY]], where

  • x is the x value
  • Y is the y value
  • minY and maxY represent the margin of error after downsampling.
data = smoothData(
    data=[
        [0, [1, 1, 1]],
        [1, [2, 2, 2]],
        [2, [3, 3, 3]],
        [3, [4, 4, 4]],
        [4, [5, 5, 5]],
        [5, [6, 6, 6]],
        [6, [7, 7, 7]],
        [7, [8, 8, 8]],
        [8, [9, 9, 9]],
        [9, [10, 10, 10]],
        [10, [11, 11, 11]],
    ],
    smoothingValue=100,
)

print(data)