From a953415a0ddd64d2fc24ebe6335fe86a87fef2ae Mon Sep 17 00:00:00 2001 From: Kaiyu Li Date: Mon, 13 Dec 2021 14:51:44 +0800 Subject: [PATCH] delete convolution bias before BN The convolution bias before BN is redundan Former-commit-id: 514f18e1a961fee4bf98fa6f50084a166e3bff4b --- unet/unet_parts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unet/unet_parts.py b/unet/unet_parts.py index 7f68f52..986ba25 100644 --- a/unet/unet_parts.py +++ b/unet/unet_parts.py @@ -13,10 +13,10 @@ class DoubleConv(nn.Module): if not mid_channels: mid_channels = out_channels self.double_conv = nn.Sequential( - nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1), + nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1, bias=False), nn.BatchNorm2d(mid_channels), nn.ReLU(inplace=True), - nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1), + nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1, bias=False), nn.BatchNorm2d(out_channels), nn.ReLU(inplace=True) )