LinearPhysicsMultiScaler#
- class deepinv.physics.LinearPhysicsMultiScaler(physics, img_shape, filter='sinc', factors=[2, 4, 8], **kwargs)[source]#
Bases:
PhysicsMultiScaler
,LinearPhysics
Multi-scale wrapper for linear physics operators.
See
PhysicsMultiScaler
for details.- Examples:
A multiscale BlurFFT operator can be created as follows:
>>> import torch >>> import deepinv as dinv >>> physics = dinv.physics.BlurFFT(img_size=(1, 32, 32), filter=dinv.physics.blur.gaussian_blur(.2)) >>> x = torch.rand((1, 1, 8, 8)) # define an image 4 times smaller than the physics input size (scale = 2) >>> new_physics = dinv.physics.LinearPhysicsMultiScaler(physics, (1, 32, 32), factors=[2, 4, 8]) # define a multiscale physics with base img size (1, 32, 32) >>> y = new_physics(x, scale=2) # applying physics at scale 2 >>> print(y.shape) torch.Size([1, 1, 32, 32])
- Parameters:
physics (deepinv.physics.Physics) – base physics operator.
img_shape (tuple) – shape of the input image (C, H, W).
filter (str) – type of filter to use for upsampling, e.g., ‘sinc’, ‘nearest’, ‘bilinear’.
factors (list[int]) – list of factors to use for upsampling.
device (torch.device, str) – device to use for the upsampling operator, e.g., ‘cpu’, ‘cuda’.