MomentJacobianPreconditioner
phasic.svgd.MomentJacobianPreconditioner(
model,
observed_data,
theta_dim,
param_transform=None,
rewards=None,
epsilon=1e-08,
)Moment Jacobian preconditioner for multi-scale SVGD.
Computes J[k,j] = d(moment_k)/d(theta_j) via finite differences at a reference point, then uses column norms as scaling factors. Scaling D_j = ||J[:,j]|| (column norm), normalized to mean 1.
This is simpler and more robust than Fisher preconditioning because it avoids dividing by PMF values (which can blow up when PMF is small).
Parameters
model :callable-
Model function: model(theta, data, rewards=None) -> (pmf, moments)
observed_data :array-
Observation data points
theta_dim :int-
Number of parameters (learnable dimensions only if fixed params exist)
param_transform :callableor None = None-
Transformation from unconstrained to constrained space (e.g., softplus)
rewards :arrayor None = None-
Optional rewards for multivariate models
epsilon :float= 1e-8-
Floor for scaling values to avoid division by zero
Methods
| Name | Description |
|---|---|
| compute_scaling | Compute Jacobian column norms at reference point and derive scaling. |
compute_scaling
phasic.svgd.MomentJacobianPreconditioner.compute_scaling(theta_ref)Compute Jacobian column norms at reference point and derive scaling.
Uses moment-matching to find a better reference point before computing the Jacobian. The provided theta_ref is used as a starting point for the moment-matching search.
Parameters
theta_ref :array(theta_dim)-
Initial reference point in unconstrained space (same space as particles). Used as starting point for moment-matching refinement.