kd.metrics.SingleDimension#
- class kauldron.metrics.SingleDimension(
- *,
- tensor: typing.Annotated[typing.Any,
- <object object at 0x7824c478ba80>] = '__KEY_REQUIRED__',
- index: int | None = 0,
Bases:
kauldron.metrics.base.MetricReturns a single chosen dimension of the tensor.
- tensor
kontext.Key for the tensor to capture the value of.
- Type:
Any
- index
Dimension to index (from the last axis). If None, no indexing is performed.
- Type:
int | None
- tensor: Annotated[Any, <object object at 0x7824c478ba80>] = '__KEY_REQUIRED__'
- index: int | None = 0
- class State(
- total: "Float['']",
- count: "Float['']",
- *,
- parent: '_MetricT' = <_EMPTY_TYPE.EMPTY: 1>,
Bases:
kauldron.metrics.base_state.AverageState- merge(
- other: kauldron.metrics.base_state.AverageState,
Returns a new state that is the accumulation of self and other.
- replace(**updates)
Returns a new object replacing the specified fields with new values.
- get_state(
- tensor: jaxtyping.Float[Array, '*any'] | jaxtyping.Float[ndarray, '*any'],
- empty() kauldron.metrics.base.Metric.State[source]