sumsq_over_samples#

t3toolbox.backend.fitting.sumsq_over_samples(out, n_w)#
def sumsq_over_samples(
        out:    NDArray,    # scalar-output forward/residual, shape W+C (apply / entries)
        n_w:    int,        # number of leading sample-stack (W) axes
) -> NDArray:               # sum of squares over W, keeping the frame stack C

The ‖·‖² reduction for the scalar-output (apply / entries) kinds: sum out**2 over the leading n_w sample axes, keeping the frame stack C. Used for both the objective c = ½‖r‖² and the model’s quadratic term ½‖𝒥 Π p‖².

Parameters:
Return type:

NDArray