PERK#
- class blochsim.estimators.PERK[source]#
Bases:
EstimatorParameter 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.
Noneestimates 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
seedoffit().Nonedraws 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
M0map, 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
rankpassed tofit(); asubspaceis accepted.uncertainty (bool, default=True) – Learn the error model that
map()reads withuncertainty=True, at the cost of a second pass over the training source. WithFalsethat 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
fitFit the estimator over a sampling of the tissue it will meet.
from_coefficientsMap coefficients already in this estimator's basis.
mapEstimate the tissue parameters of a measured volume.
training_setSimulate a training set from the properties given to
fit().uncertainty_ofUncertainty of each map, as a standard deviation in the map's units.
- property fitted#
Whether training statistics have been fitted.