You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# model = torch.hub.load('sm00thix/unet', 'unet_bn', **kwargs) # Convenience function equivalent to torch.hub.load('sm00thix/unet', 'unet', normalization='bn', **kwargs)
24
+
# model = torch.hub.load('sm00thix/unet', 'unet_bn', **kwargs) # Convenience function equivalent to torch.hub.load('sm00thix/unet', 'unet', normalization='bn' **kwargs)
25
25
# or
26
26
# model = torch.hub.load('sm00thix/unet', 'unet_ln', **kwargs) # Convenience function equivalent to torch.hub.load('sm00thix/unet', 'unet', normalization='ln', **kwargs)
27
27
# or
@@ -34,6 +34,7 @@ model = torch.hub.load('sm00thix/unet', 'unet', pretrained=False, in_channels=3,
34
34
This is an implementation of U-Net [[1]](#references). It comes with the following options for customization.
35
35
36
36
1. Number of input and output channels
37
+
37
38
`in_channels` is the number of channels in the input image.
38
39
`out_channels` is the number of channels in the output image.
39
40
2. Upsampling
@@ -46,8 +47,11 @@ This is an implementation of U-Net [[1]](#references). It comes with the followi
46
47
1.`normalization = None`: Applies no normalization.
3.`normalization = "ln"`: Applies layer normalization [[3]](#references). A permutation of dimensions is performed before the layer to ensure normalization is applied over the channel dimension. Afterward, the dimensions are permuted back to their original order.
50
+
5. Depth
51
+
52
+
`depth` is the The depth of the U-Net. This is the number of steps in the encoder and decoder paths. This is one less than the number of downsampling and upsampling blocks. The number of intermediate channels is 64*2**`depth`, i.e. [64, 128, 256, 512, 1024] for `depth` = 5.
49
53
50
-
In particular, setting bilinear = False, pad = False, and normalization = Nonewill yield the U-Net as originally designed. Generally, however, bilinear = True is recommended to avoid checkerboard artifacts.
54
+
In particular, setting `bilinear = False`, `pad = False`, `normalization = None`, and `depth = 5`will yield the U-Net as originally designed. Generally, however, `bilinear = True` is recommended to avoid checkerboard artifacts.
51
55
52
56
As in the original implementation, all weights are initialized by sampling from a Kaiming He Normal Distribution [[4]](#references), and all biases are initialized to zero. If Batch Normalization or Layer Normalization is used, the weights of those layers are initialized to one and their biases to zero.
0 commit comments