torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride=1, padding=0,
dilation=1, groups=1, bias=True, padding_mode='zeros', device=None, dtype=None)
Parameters
in_channels (int) – Number of channels in the input image——输入图像的通道,彩色为3,张量另算
out_channels (int) – Number of channels produced by the convolution——卷积后输出通道
kernel_size (int or tuple) – Size of the convolving kernel——卷积核
stride (int or tuple, optional) – Stride of the convolution. Default: 1——卷积步长
padding (int, tuple or str, optional) – Padding added to all four sides of the input. Default: 0——是否填充
padding_mode (string, optional) – ‘zeros’, ‘reflect’, ‘replicate’ or ‘circular’. Default: ‘zeros’——填充模式
dilation (int or tuple, optional) – Spacing between kernel elements. Default: 1——卷积核间距
groups (int, optional) – Number of blocked connections from input channels to output channels. Default: 1——输入输出通道之间的block连接(暂时不理解)
bias (bool, optional) – If True, adds a learnable bias to the output. Default: True——添加学习偏差
torch.nn.BatchNorm2d(num_features, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True,
device=None, dtype=None)
Parameters
num_features – C from an expected input of size (N, C, H, W)
eps – a value added to the denominator for numerical stability. Default: 1e-5
momentum – the value used for the running_mean and running_var computation. Can be set to None for cumulative moving average (i.e. simple average). Default: 0.1 —— 冲量
affine – a boolean value that when set to True, this module has learnable affine parameters. Default: True
track_running_stats – a boolean value that when set to True, this module tracks the running mean and variance, and when set to False, this module does not track such statistics, and initializes statistics buffers running_mean and running_var as None. When these buffers are None, this module always uses batch statistics. in both training and eval modes. Default: True
torch.nn.ReLU(inplace=False)
torch.nn.MaxPool2d(kernel_size, stride=None, padding=0, dilation=1, return_indices=False,
ceil_mode=False)
Parameters
kernel_size – the size of the window to take a max over
stride – the stride of the window. Default value is kernel_size
padding – implicit zero padding to be added on both sides
dilation – a parameter that controls the stride of elements in the window
return_indices – if True, will return the max indices along with the outputs. Useful for torch.nn.MaxUnpool2d later
ceil_mode – when True, will use ceil instead of floor to compute the output shape
最终atrous_unet网络结构
简化模型图: