kd.summaries.HistogramSummary

kd.summaries.HistogramSummary#

class kauldron.summaries.HistogramSummary(*, tensor: typing.Annotated[typing.Any, <object object at 0x7824c478ba80>], num_buckets: int = 30)[source]

Bases: kauldron.metrics.base.Metric

Basic histogram summary.

tensor: Annotated[Any, <object object at 0x7824c478ba80>]
num_buckets: int = 30
class State(
tensor: Array['n'],
*,
parent: _MetricT = _EMPTY_TYPE.EMPTY,
)[source]

Bases: kauldron.metrics.base_state.CollectingState[HistogramSummary]

Collecting state that returns Histograms.

tensor: Array['n']
compute() kauldron.summaries.histograms.Histogram[source]

Returns the concatenated and flattened values as a Histogram.

merge(
other: kauldron.metrics.base_state._SelfT,
) kauldron.metrics.base_state._SelfT[source]

Returns a new state that is the accumulation of self and other.

Parameters:

other – A State whose intermediate values should be accumulated onto the values of self.

Returns:

A new State that accumulates the value from both self and other.

replace(**updates)

Returns a new object replacing the specified fields with new values.

get_state(
tensor: jaxtyping.Shaped[Array, '*any'] | jaxtyping.Shaped[ndarray, '*any'],
) kauldron.summaries.histograms.HistogramSummary.State[source]
empty() kauldron.metrics.base.Metric.State[source]