sumsq_over_probes#

t3toolbox.backend.fitting.sumsq_over_probes(zz, n_w)#
def sumsq_over_probes(
        zz:     typ.Union[typ.Sequence[NDArray], NDArray],  # ragged len=d (elm W+C+(Ni,)) OR packed (d,)+W+C+(N,)
        n_w:    int,                                         # number of leading sample-stack (W) axes
) -> NDArray:                           # sum of squares over W and the free mode, summed over d, keep C

The ‖·‖² reduction for the vector-output probe kind: sum over the leading n_w sample axes and the trailing free mode, keeping the frame stack C, summed over the d probes. Mirrors zz’s packedness: a ragged len=d sequence loops over d (each z_i is W+C+(Ni,)); a packed (d,)+W+C+(N,) array sums d + W + the padded mode N in one op (the free-mode padding is a zeroed prefix, so it contributes nothing – the packed inner-loop path).

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

  • n_w (int)

Return type:

NDArray