make_newton_display =================== .. py:function:: t3toolbox.backend.optimizer_display.make_newton_display(problem, val_sample = None, val_data = None, print_fn = print, fmt = '%.1e', record = True) .. code-block:: python def make_newton_display( problem, # backend.optimizers.Problem (holds the kind + full data) val_sample: typ.Any = None, # optional validation sample (same kind/layout as problem.sample) val_data: typ.Any = None, # optional validation data; both given -> a train|val table print_fn: typ.Optional[typ.Callable] = print, # where to send each iteration's text (None = silent) fmt: str = '%.1e', record: bool = True, # accumulate per-iteration records (scalars + err matrices) ) -> typ.Tuple[typ.Callable, list]: # (callback for newton_cg, records list filled as it runs) Build a ``callback(NewtonInfo)`` (+ its ``records`` list) that displays each Newton iteration. Precomputes the constant per-block **data norms** ``block_sumsq(data)`` once (the relative-error denominators). Each call: recomputes the residual block norms, forms the train (and, if ``val_data`` is given, validation -- one extra ``point_forward``, no transpose/sweep) relative-error matrices, prints via ``print_fn``, and appends a self-contained record (the scalar fields + ``train_err`` / ``val_err``). Requires ``problem.kind.block_sumsq`` (all built-in kinds have it).