ntk_block_spectrum
Compute PINN neural tangent kernel block traces, eigenvalue summaries, and dominance diagnostics from empirical Jacobians.
SKILL.mdbasicagent-skill/skill_library/paperbench/pinn/skill/ntk_pinn_analysis/ntk_block_spectrum/SKILL.md
GitHubNTK Block Spectrum
Use this skill when a PINN recovery task needs to diagnose convergence-rate imbalance between boundary and residual loss components. It implements the paper's block-kernel view with small deterministic arrays.
Inputs
- Boundary Jacobian
J_uas rows over boundary observations and columns over parameters. - Residual Jacobian
J_ras rows over residual observations and columns over the same parameters. - Optional dominance tolerance.
Outputs
trace_kuu,trace_krr, andtrace_full.- Eigenvalue lists for
KuuandKrr. - Dominance label:
residual_dominates,boundary_dominates, orbalanced.
Workflow
- Validate that both Jacobians are non-empty matrices with equal parameter dimension.
- Compute Gram blocks
Kuu = J_u J_u^TandKrr = J_r J_r^T. - Compute traces and symmetric eigenvalues.
- Compare block traces and record which loss component is expected to converge faster.
- Pass the diagnostics to the adaptive weighting skill.
Validation
Run:
python tests/test_ntk_spectrum.py
The tests use residual-dominant Jacobians and check trace, eigenvalue, and label behavior.
Limitations
This skill computes empirical finite-width diagnostics. It does not prove infinite-width convergence; it preserves the operational recovery mechanism needed for bounded experiments.