mbi.marginal_loss.calculate_l2_lipschitz_from_metadata
- mbi.marginal_loss.calculate_l2_lipschitz_from_metadata(domain: Domain, measurements: Sequence[LinearMeasurement]) float | None[source]
Lipschitz constant of the (unnormalized) l2 loss gradient from metadata.
The loss is quadratic, so its gradient’s Lipschitz constant is lambda_max of a Hessian that is block-diagonal by maximal clique:
H = sum_M (1 / sigma_M^2) (Q_M P_{c_M})^T (Q_M P_{c_M})
where P_{c_M} marginalizes a maximal-clique table down to clique c_M, with ||P_c||^2 = |C| / |c| (the product of the summed-out domain sizes). Bounding each block by the sum of its terms’ norms gives:
L <= max_C sum_{M->C} ||Q_M||^2 / sigma_M^2 * |C| / |c_M|.
The uniform vector is the top eigenvector of every marginalization operator, so this is exact when all queries are identity marginals (the common case) and a safe overestimate otherwise (a larger L only shrinks the step size).
Returns None if any query’s operator norm is unknown (e.g. a nonlinear or user-supplied callable query), signalling the caller to fall back to the power-iteration estimate.