TimeMixin#
- class deepinv.physics.TimeMixin[source]#
Bases:
object
Base class for temporal capabilities for physics and models.
Implements various methods to add or remove the time dimension.
Also provides template methods for temporal physics to implement.
- static average(x, mask=None, dim=2)[source]#
Flatten time dim of x by averaging across frames.
If mask is non-overlapping in time dim, then this will simply be the sum across frames.
- Parameters:
- Returns:
flattened tensor with time dim removed of shape
(B,C,H,W)
- Return type:
- static flatten(x)[source]#
Flatten time dim into batch dim.
Lets non-dynamic algorithms process dynamic data by treating time frames as batches.
- static flatten_C(x)[source]#
Flatten time dim into channel dim.
Use when channel dim doesn’t matter and you don’t want to deal with annoying batch dimension problems (e.g. for transforms).
- static repeat(x, target, dim=2)[source]#
Repeat static image across new time dim T times. Opposite of
average
.
Examples using TimeMixin
:#

Self-supervised learning with Equivariant Imaging for MRI.

Self-supervised MRI reconstruction with Artifact2Artifact