MeanStdRms

class cubie.outputhandling.summarymetrics.mean_std_rms.MeanStdRms(precision)[source]

Bases: SummaryMetric

Composite metric that calculates mean, std, and rms together.

Notes

Uses three buffer slots: shift (first value), sum of shifted values, and sum of squares of shifted values. The shift technique improves numerical stability for the variance calculation.

The output array contains [mean, std, rms] in that order.

__init__(precision) None[source]

Initialise the MeanStdRms composite metric.

build() MetricFuncCache[source]

Generate CUDA device functions for composite calculation.

Returns:

Cache containing the device update and save callbacks.

Return type:

MetricFuncCache

Notes

The update callback accumulates sum and sum_of_squares while the save callback computes all three metrics from these running sums and clears the buffer.