multigeom.geometry.fisher#

Closed-form Fisher information baseline J(x) used in the paper.

For the Gaussian observation model p(r | x) = N(f_φ(x), σ² I), the classical
Fisher information matrix is

    J(x) = (1 / σ²) · J_{f_φ}(x)ᵀ J_{f_φ}(x)

where J_{f_φ}(x) ∈ ℝ^{n × P} is the Jacobian of the encoder mean f_φ at x,
with n = 50 target neurons and P = 64×64 = 4096 pixels.

Because J_{f_φ} has rank at most n ≪ P, we extract the top-k eigenpairs of
J(x) directly from the SVD of J_{f_φ} = U S Vᵀ:
    eigenvalues  = S² / σ²
    eigenvectors = rows of Vᵀ
This avoids ever forming the P × P outer product (which would be 4096² = 16M
entries).

The Jacobian itself is materialised row-by-row by reverse-mode autograd:
one backward pass per neuron through (input → frozen backbone → readout).
The backbone parameters are frozen (`requires_grad = False`), so gradients
of the response w.r.t. the input flow through but no gradient is computed
for the backbone weights.

Functions

fisher_eigendecomposition(image, encoder, sigma)

Compute the top-k eigenpairs of J(x) = (1/σ²) J_{f_φ}ᵀ J_{f_φ}.

Classes

FisherOutput(eigenvalues, eigenvectors)

Top eigenpairs of J(x) returned by compute_fisher: eigenvalues [k] and eigenvectors [k, P], largest first.