DictionaryMatcher#
- class blochsim.estimators.DictionaryMatcher[source]#
Bases:
EstimatorMatch signals to dictionary atoms by normalized complex inner product.
- Parameters:
acquisition (Simulator, default=None) – The sequence being inverted, with every property that is neither unknown nor measured separately already fixed. Omit to give
dictionaryor signals tofit().dictionary (torch.Tensor, default=None) – Atoms
(n_atoms, n_contrasts), real or complex.parameters (torch.Tensor, default=None) – Parameter values
(n_atoms, n_parameters)of the atoms. Without them a call returns atom indices.query_chunk_size (int, default=4096) – Measured signals compared at once.
dictionary_chunk_size (int, default=16384) – Atoms compared at once.
top_k (int, default=1) – Candidates kept by
match(); the first is the estimate.groups (int, default=None) – Cluster the dictionary into this many groups and score group representatives first, discarding groups before scoring their atoms [1]. See
grouping.prune (float, default=5e-3) – Fraction below its best group score within which a voxel still considers a group. Larger keeps more groups. The default was tuned on 280 groups of 700 atoms; raise it for smaller dictionaries.
Notes
A
rankgiven tofit()compresses the dictionary to(atoms, rank)before grouping. The estimator also returns anM0map, computed from the match score and atom norms without touching atoms. Volumes are streamed asmap(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.
Find the best-matching atoms of each measured signal.
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 the matcher holds a dictionary.
- property grouping#
Clustering of the dictionary, or
Nonewithoutgroups.Its
conditionis the condition number of the representatives andcompressionthe factor by which in-group inner products shorten.
- match()[source]#
Find the best-matching atoms of each measured signal.
- Parameters:
signals (torch.Tensor) – Measurements
(..., contrasts).- Returns:
Fields shaped
(..., top_k).- Return type:
MatchResult
- Raises:
RuntimeError – If there is no dictionary.
ValueError – If the contrast count differs from the dictionary’s.