Skip to main content

read_tensorboard_distributions

read_tensorboard_distributions(
    logdir
    *
    tags=None
    runs=None
    max_points=DEFAULT_MAX_POINTS
)

Read the distribution charts of a TensorBoard log directory.

One chart per tag and run, as TensorBoard’s Distributions dashboard draws them: the step along the x axis, and nine values – the minimum, six percentiles, the median and the maximum of the logged values at each step – drawn as the nested bands between them around the median line, and read as one percentile_band layer.

Parameters

Name Type Description Default
logdir str or os.PathLike The directory TensorBoard would be started with (--logdir). required
tags iterable of str Only these histogram tags, in this order. None
runs iterable of str Only these runs. None
max_points int or None At most this many steps per chart, evenly spaced and always keeping the first and last. None keeps every step. 1000

Returns

Name Type Description
list of TensorBoardChart One per tag and run.

Raises

Name Type Description
FileNotFoundError If logdir is not a directory.
ValueError If max_points is below 2.

Notes

The distributions are the histograms the Histograms dashboard reads, so whatever :func:maidr.read_tensorboard_histograms reads is read here. Each value is a quantile, its level the share of values below it, such as 0.8413; a reader enters on the median, moves Up and Down through the quantiles in value order, which is the spread of the distribution at that step, and Left and Right along one of them over training. maidr.js names the band around the median, such as the middle 68%. percentile_band is an experimental type.

Examples

>>> import maidr
>>> for chart in maidr.read_tensorboard_distributions("logs/fit"):
...     maidr.show(chart)