EquivariantReconstructor#
- class deepinv.models.EquivariantReconstructor(model, transform=None, eval_transform=None)[source]#
Bases:
ReconstructorEquivariant reconstructor
Make a base reconstructor \(\tilde{R}\) equivariant by averaging over the transformations, i.e.,
\[R(y, A) = \frac{1}{|\mathcal{G}|}\sum_{g\in \mathcal{G}} T_g \tilde{R}(y, A T_g)\]An equivariant reconstructor is a reconstructor that satisfies [1]
\[R(y, A T_g) = T_g^{-1} R(y, A)\]for all \(g \in \mathcal{G}\) where \(T_g\) is a transform (eg shifts, rotations, etc).
- Parameters:
model (Reconstructor) – base reconstructor to be made equivariant.
transform (Transform, None) – geometric transformation. By default, it is set to a single random 90° rotation and flip.
eval_transform (Transform) – transformations to be used in evaluation mode. It can be used to have true Reynolds averaging at evaluation time and efficient Monte Carlo estimation at training time. By default, if training transformations are specified, evaluation transformations default to them, otherwise they default to the eight 90° rotations and flips.
- References:
- forward(y, physics, *reconstructor_args, **reconstructor_kwargs)[source]#
Apply the reconstructor to an input
- Parameters:
y (torch.Tensor) – input measurement.
physics (deepinv.physics.Physics) – physics operator associated with the measurements.
*reconstructor_args – args for reconstructor function.
**reconstructor_kwargs – kwargs for reconstructor function.
- Returns:
(
torch.Tensor) output of the reconstructor.- Return type:
Examples using EquivariantReconstructor:#
Self-supervised learning with Equivariant Splitting