Skip to main content

Module joint_penalty

Module joint_penalty 

Source
Expand description

Joint (cross-block) penalty specifications.

After the T^T S_j T pullback used by the V+M / SMGS-exact compile path, a single penalty S_j no longer has its nonzero region confined to one ParameterBlockSpec: the pullback by the inter-block coupling matrix T distributes weight across the entire compiled parameter vector. The existing ParameterBlockSpec.penalties: Vec<PenaltyMatrix> model encodes a per-block-local penalty (its dim equals the owning block’s column count), so it cannot represent these full-width operators.

JointPenaltySpec is the carrier for that case: one dense total_compiled × total_compiled matrix with its own initial smoothing parameter and structural nullspace dimension. It lives alongside, not inside, the per-block specs.

§Inner-solve integration

inner_blockwise_fit and the joint-Newton kernels in custom_family consume ordinary block-local penalties as a &[Array2<f64>] paired with per-block (start, end) ranges:

  • apply_joint_block_penalty_into(ranges, s_lambdas, …) (≈ line 19960)
  • joint_penalty_preconditioner_diag(…) (≈ line 20067)
  • add_joint_penalty_to_matrix(matrix, ranges, s_lambdas, …) (≈ line 20132)

A cross-block dense S has no single owning block range, so the solver also threads a JointPenaltyBundle through those helpers as a full-width path that:

  1. computes S · v as a full total × total mat-vec (cf. fast_av),
  2. accumulates diag(S) into the Jacobi preconditioner over the full parameter vector, and
  3. adds λ · S to the dense joint Hessian without slicing.

The remaining construction-site work is to produce the correct JointPenaltySpec instances for each coupled-family compile path; once a bundle is supplied through BlockwiseFitOptions::joint_penalties, the inner solve consumes its objective, mat-vec, preconditioner, and dense-Hessian contributions.

Structs§

JointPenaltyBundle
Per-evaluation bundle of cross-block penalties paired with their current log-smoothing parameters.
JointPenaltySpec
A penalty whose support spans the entire compiled parameter vector.

Enums§

JointPenaltyError
Reason a JointPenaltySpec failed validation.