Experiments/Visualizations

Histograms

Visualize your data as histograms

mlop supports logging one or multiple arrays of data as histograms.

To use histogram logging you first need to instantiate the mlop.Histogram class

histogram = mlop.Histogram(
    data: Union[list, np.ndarray, torch.Tensor],
    bins: int | None = 64,
)
ParameterTypeDescription
dataUnion[list, np.ndarray, torch.Tensor]The data to log. Can be a list of numbers, a NumPy array, or a PyTorch tensor.
binsintThe number of bins to use for the histogram. Defaults to 64.

Binning Details

When the bins parameter is manually set as None, mlop will automatically attempt to retrieve histogram binning from the data parameter provided the parameter has a dimension of 2, by using the 2nd array for bin edges. It may additionally flag the uniform attribute for the histogram if the length of the 2nd array is exactly one more than the 1st dimension.

This provides you with the nice visualization

histogram