SCUNet
- class deepinv.models.SCUNet(in_nc=3, config=[4, 4, 4, 4, 4, 4, 4], dim=64, drop_path_rate=0.0, input_resolution=256, pretrained='download', device='cpu')[source]
Bases:
Module
SCUNet denoising network.
The Swin-Conv-UNet (SCUNet) denoising was introduced in Practical Blind Denoising via Swin-Conv-UNet and Data Synthesis.
- Parameters:
in_nc (int) – number of input channels. Default: 3.
config (list) – number of layers in each stage. Default: [4, 4, 4, 4, 4, 4, 4].
dim (int) – number of channels in each layer. Default: 64.
drop_path_rate (float) – drop path per sample rate (stochastic depth) for each layer. Default: 0.0.
input_resolution (int) – input resolution. Default: 256.
pretrained (bool) – use a pretrained network. If
pretrained=None
, the weights will be initialized at random using Pytorch’s default initialization. Ifpretrained='download'
, the weights will be downloaded from an online repository (only available for the default architecture). Finally,pretrained
can also be set as a path to the user’s own pretrained weights. Default: ‘download’. See pretrained-weights for more details.train (bool) – training or testing mode. Default: False.
device (str) – gpu or cpu. Default: ‘cpu’.
- forward(x, sigma=None)[source]
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.