block_sumsq_over_probes#

t3toolbox.backend.fitting.block_sumsq_over_probes(zz, n_w, has_order)#
def block_sumsq_over_probes(
        zz:         typ.Union[typ.Sequence[NDArray], NDArray],  # ragged len=d (elm [order]+W+C+(Ni,)) OR packed (d,)+[order]+W+C+(N,)
        n_w:        int,                    # number of leading W axes (unused; see block_sumsq_over_samples)
        has_order:  bool,
) -> NDArray:                               # (d, n_order) -- per-(mode, order) sum of squares

Per-(mode, order) sum-of-squares for the vector-output probe kinds -> a 2-D (d, n_order) matrix (d probe modes). Keeps the mode axis (and a leading order axis, if any) and sums the rest (W + C + the free mode); UNWEIGHTED. Mirrors zz’s packedness (like sumsq_over_probes()): a ragged len=d list stacks per-mode reductions; a packed uniform (d,)+[order]+W+C+(N,) array keeps the leading d (and order) axes and sums the rest – the padded free mode N is a zeroed prefix (like sumsq), so it contributes nothing. So the uniform probe kinds inherit this verbatim via dc.replace (no override needed).

Parameters:
  • zz (t3toolbox.backend.common.typ.Union[t3toolbox.backend.common.typ.Sequence[NDArray], NDArray])

  • n_w (int)

  • has_order (bool)

Return type:

NDArray