diff --git a/Bericht/Bilder/UNet_Architecture.png b/Bericht/Bilder/My_UNet.png similarity index 100% rename from Bericht/Bilder/UNet_Architecture.png rename to Bericht/Bilder/My_UNet.png diff --git a/Bericht/Bilder/channels.jpg b/Bericht/Bilder/channels.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7164ac136a173d140598d0353a79a964a8e39a08 Binary files /dev/null and b/Bericht/Bilder/channels.jpg differ diff --git a/Notes.txt b/Notes.txt index 4e29fa3b634fe494d1431d78ad280a88fb04705b..e2deb1194f469ecd816690941ea53e13718946a9 100644 --- a/Notes.txt +++ b/Notes.txt @@ -12,6 +12,9 @@ V13: 4 layer, doppel Conv, normDataen,phase 64 V14: 4 layer, single conv, normDataen,phase + angle 64 V15: 3 layer, doppelte depth Conv pro layer, norm. Daten,kernel 7, phase only, dropout 0.3, 32 V16: 3 layer, doppelte depth Conv pro layer, norm. Daten,kernel 7, angelsonly, dropout 0.5, 32 +V17: 3 layer, doppelte depth Conv pro layer, norm. Daten,kernel 7, angelsonly, dropout 0.5, 32, but last layer 70 32 1 1 +V18: 3 layer, doppelte depth Conv pro layer, norm. Daten,kernel 7, angelsonly, dropout 0.5, 32, like 16 but first layer 6 32 32 + V9 mit kernel 7 und nur den phasen: mean error over whole set: 16.91116704929035 max error average: 292.8658473955995 and maximum 814.873957640188 diff --git a/UNet/UNet_V15.py~c0cc9d273fc96dfe1568dcc5cddd577a337efb3f b/UNet/UNet_V18.py similarity index 94% rename from UNet/UNet_V15.py~c0cc9d273fc96dfe1568dcc5cddd577a337efb3f rename to UNet/UNet_V18.py index b20f5ecfa19e3d9908cf4edafcd2e37f47e3d027..f7d2e4d13971a0874ab4c8440835532bd517b8f7 100644 --- a/UNet/UNet_V15.py~c0cc9d273fc96dfe1568dcc5cddd577a337efb3f +++ b/UNet/UNet_V18.py @@ -1,4 +1,4 @@ -#like V6_2 but only the different phases as input + """UNet_V6.ipynb Automatically generated by Colaboratory. @@ -25,7 +25,8 @@ 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.25) + 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) @@ -136,7 +137,7 @@ def accuracy(outputs, labels,normalization, threshold = 0.05): return percentage class UNet(UNetBase): - 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])): + def __init__(self,kernel_size = 7, enc_chs=((6,32,32), (32,64,64), (64,128,128)), dec_chs_up=(128, 128, 64), dec_chs_conv=((192,128, 128),(160,64,64),(70,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) @@ -174,8 +175,8 @@ def fit(epochs, lr, model, train_loader, val_loader, path, opt_func=torch.optim. result['train_loss'] = torch.stack(train_losses).mean().item() model.epoch_end(epoch, result) history.append(result) - torch.save(model.state_dict(),f'{path}/Unet_dict_V15.pth') - torch.save(history,f'{path}/history_V15.pt') + torch.save(model.state_dict(),f'{path}/Unet_dict_V18.pth') + torch.save(history,f'{path}/history_V18.pt') return history def get_default_device(): @@ -225,9 +226,9 @@ def Create_Dataloader(path, batch_size = 100, percent_val = 0.2): if __name__ == '__main__': #os.chdir('F:/RWTH/HiWi_IEHK/DAMASK3/UNet/Trainingsdata') path_to_rep = '/home/yk138599/Hiwi/damask3' - use_seeds = False - seed = 373686838 - num_epochs = 1000 + use_seeds = True + seed = 2199910834 + num_epochs = 200 b_size = 32 opt_func = torch.optim.Adam lr = 0.00003 @@ -243,8 +244,8 @@ if __name__ == '__main__': random.seed(seed) np.random.seed(seed) device = get_default_device() - normalization = np.load(f'{path_to_rep}/UNet/Trainingsdata/Norm_min_max_32_phase_only.npy', allow_pickle = True) - train_dl, valid_dl = Create_Dataloader(f'{path_to_rep}/UNet/Trainingsdata/TD_norm_32_phase_only.pt', batch_size= b_size ) + normalization = np.load(f'{path_to_rep}/UNet/Trainingsdata/Norm_min_max_32_angles.npy', allow_pickle = True) + train_dl, valid_dl = Create_Dataloader(f'{path_to_rep}/UNet/Trainingsdata/TD_norm_32_angles.pt', batch_size= b_size ) train_dl = DeviceDataLoader(train_dl, device) valid_dl = DeviceDataLoader(valid_dl, device) diff --git a/UNet/core.ncg02.hpc.itc.rwth-aachen.de.47730.7 b/UNet/core.ncg02.hpc.itc.rwth-aachen.de.47730.7 index e8f36ddbe5566960261cc6f04d6fd354f7d6a04b..c77c27276a2216959a5d3f008b7e227dc4a02638 100644 Binary files a/UNet/core.ncg02.hpc.itc.rwth-aachen.de.47730.7 and b/UNet/core.ncg02.hpc.itc.rwth-aachen.de.47730.7 differ diff --git a/UNet/core.ncg28.hpc.itc.rwth-aachen.de.45496.7 b/UNet/core.ncg28.hpc.itc.rwth-aachen.de.45496.7 index b4c72ebbd821051de2f5f4b760735552817d6bb4..bca0eaabdfe2424d8ca75f202fe3f18bbb18a923 100644 Binary files a/UNet/core.ncg28.hpc.itc.rwth-aachen.de.45496.7 and b/UNet/core.ncg28.hpc.itc.rwth-aachen.de.45496.7 differ diff --git a/UNet/postprocessing_new.ipynb b/UNet/postprocessing_new.ipynb index 47da6ef5912639bae19da018529e91158556a719..b27a0ca6ce8153727ebbe7f4f205b471c8d2c0bc 100644 --- a/UNet/postprocessing_new.ipynb +++ b/UNet/postprocessing_new.ipynb @@ -241,6 +241,13 @@ "predict_stress(sample_index, normalization = normalization_64, model = model_15, dataset = Training_data_64,UNet = UNet,grain_data =grain_data_64)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": 25,