diff --git a/UNet/UNet_V12.py b/UNet/UNet_V12.py index 4b39b076b4dc7ce39c55c0545cefd9c690794682..cb3602201b4b8f5bba15f5eb0632d4f039784ff4 100644 --- a/UNet/UNet_V12.py +++ b/UNet/UNet_V12.py @@ -22,12 +22,14 @@ class depthwise_separable_conv(nn.Module): self.pointwise_1 = nn.Conv3d(in_c, out_1_c, kernel_size=1, bias=True) self.batch_norm_1 = nn.BatchNorm3d(out_1_c) self.relu = nn.ReLU() + self.droptout = nn.Dropout3d(p=0.5) + self.depthwise_2 = nn.Conv3d(out_1_c, out_1_c, kernel_size= kernel_size, padding=padding[1], groups=out_1_c, bias=True) self.pointwise_2 = nn.Conv3d(out_1_c, out_2_c, kernel_size=1, bias=True) self.batch_norm_2 = nn.BatchNorm3d(out_2_c) def forward(self, x): - x = self.batch_norm_1(self.relu(self.pointwise_1(self.depthwise_1(x)))) - return self.batch_norm_2(self.relu(self.pointwise_2(self.depthwise_2(x)))) + x = self.batch_norm_1(self.relu(self.droptout(self.pointwise_1(self.depthwise_1(x))))) + return self.batch_norm_2(self.relu(self.droptout(self.pointwise_2(self.depthwise_2(x))))) class convolution_Layer(nn.Module): def __init__(self, in_c, out_1_c, out_2_c, padding, kernel_size): @@ -223,7 +225,7 @@ if __name__ == '__main__': path_to_rep = '/home/yk138599/Hiwi/damask3' use_seeds = False seed = 373686838 - num_epochs = 500 + num_epochs = 300 b_size = 32 opt_func = torch.optim.Adam lr = 0.00003 diff --git a/UNet/UNet_V13.py b/UNet/UNet_V13.py index 811c5ff3a23544c9dcb65f3e71c9b75a4116c0a1..57e0d16715646ea800201ae976e09a2f9160aa59 100644 --- a/UNet/UNet_V13.py +++ b/UNet/UNet_V13.py @@ -22,12 +22,14 @@ class depthwise_separable_conv(nn.Module): self.pointwise_1 = nn.Conv3d(in_c, out_1_c, kernel_size=1, bias=True) self.batch_norm_1 = nn.BatchNorm3d(out_1_c) self.relu = nn.ReLU() + self.droptout = nn.Dropout3d(p=0.5) + self.depthwise_2 = nn.Conv3d(out_1_c, out_1_c, kernel_size= kernel_size, padding=padding[1], groups=out_1_c, bias=True) self.pointwise_2 = nn.Conv3d(out_1_c, out_2_c, kernel_size=1, bias=True) self.batch_norm_2 = nn.BatchNorm3d(out_2_c) def forward(self, x): - x = self.batch_norm_1(self.relu(self.pointwise_1(self.depthwise_1(x)))) - return self.batch_norm_2(self.relu(self.pointwise_2(self.depthwise_2(x)))) + x = self.batch_norm_1(self.relu(self.droptout(self.pointwise_1(self.depthwise_1(x))))) + return self.batch_norm_2(self.relu(self.droptout(self.pointwise_2(self.depthwise_2(x))))) class convolution_Layer(nn.Module): def __init__(self, in_c, out_1_c, out_2_c, padding, kernel_size): @@ -223,11 +225,11 @@ if __name__ == '__main__': path_to_rep = '/home/yk138599/Hiwi/damask3' use_seeds = False seed = 373686838 - num_epochs = 500 - b_size = 16 + num_epochs = 300 + b_size = 32 opt_func = torch.optim.Adam lr = 0.00003 - kernel = 9 + kernel = 7 print(f'number auf epochs: {num_epochs}') print(f'batchsize: {b_size}') print(f'learning rate: {lr}') diff --git a/UNet/UNet_V15.py b/UNet/UNet_V15.py index 1395565b527211a328fe08a8802fd8122243afcf..11072152928258221d80449e4adf0878849b1120 100644 --- a/UNet/UNet_V15.py +++ b/UNet/UNet_V15.py @@ -138,7 +138,7 @@ def accuracy(outputs, labels,normalization, threshold = 0.05): return percentage class UNet(UNetBase): - def __init__(self,kernel_size = 5, enc_chs=((2,16,32), (32,32,64), (64,64,128)), dec_chs_up=(128, 128, 64), dec_chs_conv=((192,128, 128),(160,64,64),(66,32,32)),normalization=np.array([0,1])): + def __init__(self,kernel_size = 7, enc_chs=((2,16,32), (32,32,64), (64,64,128)), dec_chs_up=(128, 128, 64), dec_chs_conv=((192,128, 128),(160,64,64),(66,32,32)),normalization=np.array([0,1])): super().__init__() self.encoder = Encoder(kernel_size = kernel_size, chs = enc_chs) self.decoder = Decoder(kernel_size = kernel_size, chs_upsampling = dec_chs_up, chs_conv = dec_chs_conv) @@ -229,7 +229,7 @@ if __name__ == '__main__': path_to_rep = '/home/yk138599/Hiwi/damask3' use_seeds = False seed = 373686838 - num_epochs = 1000 + num_epochs = 300 b_size = 32 opt_func = torch.optim.Adam lr = 0.00003 diff --git a/UNet/UNet_V16.py b/UNet/UNet_V16.py index 32797637d7079c328c0bfed76ec7a3fa3b9c8f11..ad3fa4c20d0d5961309c1997e7459cd69e520bae 100644 --- a/UNet/UNet_V16.py +++ b/UNet/UNet_V16.py @@ -228,7 +228,7 @@ if __name__ == '__main__': path_to_rep = '/home/yk138599/Hiwi/damask3' use_seeds = True seed = 373686838 - num_epochs = 10000 + num_epochs = 300 b_size = 32 opt_func = torch.optim.Adam lr = 0.00003 diff --git a/UNet/UNet_V9_3.py b/UNet/UNet_V9_3.py index 18068f80fb265d30bcf3d546786c38d73bfb48d6..ad7d81b693bb361ec739392d1b9cc81af9915d88 100644 --- a/UNet/UNet_V9_3.py +++ b/UNet/UNet_V9_3.py @@ -135,7 +135,7 @@ def accuracy(outputs, labels,normalization, threshold = 0.05): return percentage class UNet(UNetBase): - def __init__(self,kernel_size = 5, enc_chs=((2,16,32), (32,32,64), (64,64,128)), dec_chs_up=(128, 128, 64), dec_chs_conv=((192,128, 128),(160,64,64),(66,32,32)),normalization=np.array([0,1])): + def __init__(self,kernel_size = 3, enc_chs=((2,16,32), (32,32,64), (64,64,128)), dec_chs_up=(128, 128, 64), dec_chs_conv=((192,128, 128),(160,64,64),(66,32,32)),normalization=np.array([0,1])): super().__init__() self.encoder = Encoder(kernel_size = kernel_size, chs = enc_chs) self.decoder = Decoder(kernel_size = kernel_size, chs_upsampling = dec_chs_up, chs_conv = dec_chs_conv) diff --git a/UNet/core.ncg05.hpc.itc.rwth-aachen.de.120012.7 b/UNet/core.ncg05.hpc.itc.rwth-aachen.de.120012.7 deleted file mode 100644 index d4b727b97eb6b678a192ba1b831596cc043c613f..0000000000000000000000000000000000000000 Binary files a/UNet/core.ncg05.hpc.itc.rwth-aachen.de.120012.7 and /dev/null differ diff --git a/UNet/core.ncg14.hpc.itc.rwth-aachen.de.54389.7 b/UNet/core.ncg14.hpc.itc.rwth-aachen.de.54389.7 deleted file mode 100644 index 9c49c4b3e570ac2d7033d39ea5e754ec549111ce..0000000000000000000000000000000000000000 Binary files a/UNet/core.ncg14.hpc.itc.rwth-aachen.de.54389.7 and /dev/null differ diff --git a/UNet/core.ncg21.hpc.itc.rwth-aachen.de.42655.7 b/UNet/core.ncg21.hpc.itc.rwth-aachen.de.42655.7 deleted file mode 100644 index 6a3aeca25208d739c62a572e46c03fa9fbe171c2..0000000000000000000000000000000000000000 Binary files a/UNet/core.ncg21.hpc.itc.rwth-aachen.de.42655.7 and /dev/null differ diff --git a/UNet/core.ncg21.hpc.itc.rwth-aachen.de.53659.7 b/UNet/core.ncg21.hpc.itc.rwth-aachen.de.53659.7 deleted file mode 100644 index 99d9e1592ff250ca4e5217c3d3b6c43fab393839..0000000000000000000000000000000000000000 Binary files a/UNet/core.ncg21.hpc.itc.rwth-aachen.de.53659.7 and /dev/null differ diff --git a/UNet/core.nrg05.hpc.itc.rwth-aachen.de.75892.6 b/UNet/core.nrg05.hpc.itc.rwth-aachen.de.75892.6 deleted file mode 100644 index 023619fd8e7c563f5dcd305a761bb092dae3fdf1..0000000000000000000000000000000000000000 Binary files a/UNet/core.nrg05.hpc.itc.rwth-aachen.de.75892.6 and /dev/null differ