Metrics Map
A mutable, typed wrapper around Map<MetricKey<*>, Metric>.
Mutability invariant: MetricsMap is always updated in-place via recomputeAll and set. It is never replaced wholesale on a StageRecord -- the same instance is mutated throughout the stage's lifetime. The plus operator creates a new instance (used only during preset composition at stage creation time).
Serialized like a plain Map, e.g. { "metric_key_id": { ... metric fields ... }, ... }.
Types
Link copied to clipboard
object Companion
Factory helpers for building a MetricsMap.
Properties
Functions
Link copied to clipboard
Returns a new MetricsMap containing this map's entries plus other's (the latter wins on key clashes).
Link copied to clipboard
fun recomputeAll(currentStage: StageRecord, substages: List<TrainingRecord>, isStageUpdate: Boolean)
Recompute all metrics in-place from the given substages.