PERK

Contents

PERK#

class blochsim.estimators.PERK[source]#

Bases: Estimator

Parameter estimation via regression with kernels (PERK).

Kernel ridge regression from signals to parameters with Gaussian random Fourier features [1]. Training accumulates covariances in chunks, so memory follows n_features, not the number of training samples.

Parameters:
  • acquisition (Simulator, default=None) – The sequence being inverted, with every property that is neither unknown nor measured separately already fixed. Omit to fit from signals passed to fit().

  • n_features (int, default=1000) – Number of random Fourier features.

  • length_scale (float or torch.Tensor, default=None) – Gaussian-kernel length scale per input feature, in signal units. None estimates it from the training standard deviation.

  • regularization (float, default=1e-5) – Tikhonov term added to the feature covariance.

  • chunk_size (int, default=65536) – Maximum samples transformed at once.

  • feature_seed (int, default=None) – Seed of the random feature map, separate from the seed of fit(). None draws one at random.

  • complex_mode ({"cartesian", "magnitude"}, default="cartesian") – Complex signals enter as interleaved real and imaginary parts ("cartesian") or as magnitudes.

  • normalize (bool, default=False) – Normalize each signal to unit norm before the feature map, discarding its amplitude. The estimator then also returns an M0 map, learned as the reciprocal norm of the training fingerprints.

  • stream (bool, default=False) – Simulate the training set chunk by chunk without holding it. Not compatible with a rank passed to fit(); a subspace is accepted.

  • uncertainty (bool, default=True) – Learn the error model that map() reads with uncertainty=True, at the cost of a second pass over the training source. With False that request raises.

Notes

The stated uncertainty is the regression’s total expected error, learned from the absolute residuals of its own training fit and scaled by sqrt(pi / 2) to a standard deviation for a Gaussian error. It includes the pull of the training prior as well as noise, so it exceeds the scatter over repeated noise realizations. It is valid at the signal amplitude the training set was simulated at.

Estimation is differentiable with respect to the signals. Volumes are streamed as map(execution=...) says.

References

Methods

fit

Fit the estimator over a sampling of the tissue it will meet.

from_coefficients

Map coefficients already in this estimator's basis.

map

Estimate the tissue parameters of a measured volume.

training_set

Simulate a training set from the properties given to fit().

uncertainty_of

Uncertainty of each map, as a standard deviation in the map's units.

property fitted#

Whether training statistics have been fitted.