Artifact2ArtifactSplittingMaskGenerator#
- class deepinv.physics.generator.Artifact2ArtifactSplittingMaskGenerator(tensor_size, split_size=2, device='cpu', rng=None)[source]#
Bases:
Phase2PhaseSplittingMaskGenerator
Artifact2Artifact splitting mask generator for dynamic data.
To be exclusively used with
deepinv.loss.Artifact2ArtifactLoss
. Randomly selects a chunk from dynamic data (i.e. data of shape (B, C, T, H, W)) in the T dimension and puts zeros in the rest of the mask.When
step
called withpersist_prev
, the selected chunk will be different from the previous time it was called. This is used so input chunk is compared to a different output chunk.Artifact2Artifact was introduced in RARE: Image Reconstruction using Deep Priors Learned without Ground Truth for free-breathing MRI.
If input_mask not passed, a blank input mask is used instead.
- Parameters:
tensor_size (tuple[int]) – size of the tensor to be masked without batch dimension of shape (C, T, H, W)
split_size (int, tuple[int]) – time-length of chunk. Must divide
tensor_size[1]
exactly. Iftuple
, one is randomly selected each time.device (str, torch.device) – device where the tensor is stored (default: ‘cpu’).
rng (torch.Generator) – torch random number generator.