CNN_transfer_learning_weights.ipynb 172 KB
Newer Older
Lafnoune Imane's avatar
Lafnoune Imane committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "papermill": {
     "duration": 0.012261,
     "end_time": "2020-08-20T13:10:33.841122",
     "exception": false,
     "start_time": "2020-08-20T13:10:33.828861",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "# CNN with transfer learning with weights (efficientnet)\n",
    "\n",
    "This notebook contains the configurations required to train an efficientnet model for K-folds.\n",
    "\n",
    "It is possible to hit -0.6910 LB by tweaking parameters in this notebook!\n",
    "\n",
    "https://www.kaggle.com/khoongweihao/k-fold-tf-efficientnet-models-training"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import os\n",
    "import logging\n",
    "logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## A - Preprocessing : Reading Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "os.chdir('../')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Patient</th>\n",
       "      <th>Weeks</th>\n",
       "      <th>FVC</th>\n",
       "      <th>Percent</th>\n",
       "      <th>Age</th>\n",
       "      <th>Sex</th>\n",
       "      <th>SmokingStatus</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>ID00007637202177411956430</td>\n",
       "      <td>-4</td>\n",
       "      <td>2315</td>\n",
       "      <td>58.253649</td>\n",
       "      <td>79</td>\n",
       "      <td>Male</td>\n",
       "      <td>Ex-smoker</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ID00007637202177411956430</td>\n",
       "      <td>5</td>\n",
       "      <td>2214</td>\n",
       "      <td>55.712129</td>\n",
       "      <td>79</td>\n",
       "      <td>Male</td>\n",
       "      <td>Ex-smoker</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>ID00007637202177411956430</td>\n",
       "      <td>7</td>\n",
       "      <td>2061</td>\n",
       "      <td>51.862104</td>\n",
       "      <td>79</td>\n",
       "      <td>Male</td>\n",
       "      <td>Ex-smoker</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>ID00007637202177411956430</td>\n",
       "      <td>9</td>\n",
       "      <td>2144</td>\n",
       "      <td>53.950679</td>\n",
       "      <td>79</td>\n",
       "      <td>Male</td>\n",
       "      <td>Ex-smoker</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>ID00007637202177411956430</td>\n",
       "      <td>11</td>\n",
       "      <td>2069</td>\n",
       "      <td>52.063412</td>\n",
       "      <td>79</td>\n",
       "      <td>Male</td>\n",
       "      <td>Ex-smoker</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     Patient  Weeks   FVC    Percent  Age   Sex SmokingStatus\n",
       "0  ID00007637202177411956430     -4  2315  58.253649   79  Male     Ex-smoker\n",
       "1  ID00007637202177411956430      5  2214  55.712129   79  Male     Ex-smoker\n",
       "2  ID00007637202177411956430      7  2061  51.862104   79  Male     Ex-smoker\n",
       "3  ID00007637202177411956430      9  2144  53.950679   79  Male     Ex-smoker\n",
       "4  ID00007637202177411956430     11  2069  52.063412   79  Male     Ex-smoker"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from preprocessing.read_load_data import read_data\n",
    "\n",
    "input_directory='../osic-pulmonary-fibrosis-progression'\n",
    "train_df, test_df, sample_df = read_data(input_directory)   \n",
    "train_df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## B - Preprocessing : Loading Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "patients_train_ids= train_df.Patient.unique()\n",
    "patient_test_list= test_df.Patient.unique()\n",
    "patients_train_ids = [pat for pat in patients_train_ids]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:loading  attributes...\n",
      "INFO:loading images...\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Array shape:  (176, 240, 240, 4)\n",
      "min value:  -0.1251496147096971\n",
203
      "max value:  0.16921848376184256\n"
Lafnoune Imane's avatar
Lafnoune Imane committed
204
205
206
207
208
209
210
211
     ]
    }
   ],
   "source": [
    "from preprocessing.read_load_data import load_images\n",
    "\n",
    "logging.info(\"loading  attributes...\")\n",
    "df = pd.read_csv(f'{input_directory}/train.csv')\n",
212
    "df = df.sort_values(\"Weeks\").drop_duplicates(subset = 'Patient', keep='first')\n",
Lafnoune Imane's avatar
Lafnoune Imane committed
213
214
215
216
217
218
219
220
    "patients_train_ids= df.Patient.unique().tolist()\n",
    "df = df[df['Patient'].isin(patients_train_ids)]\n",
    "\n",
    "logging.info(\"loading images...\")\n",
    "images = load_images(input_directory,\n",
    "                    'train',\n",
    "                     patients_train_ids,\n",
    "                     option='superposition',\n",
221
222
    "                    outputH = 240,\n",
    "                    outputW = 240)\n",
Lafnoune Imane's avatar
Lafnoune Imane committed
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
    "\n",
    "print(\"Array shape: \", images.shape)\n",
    "#check value between -1,1\n",
    "print('min value: ', np.amin(images))\n",
    "print('max value: ', np.amax(images))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## C - Preprocessing : shuffle"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "split = train_test_split(df, images, test_size=0.2, random_state=42)\n",
    "(trainAttrX, testAttrX, trainImagesX, testImagesX) = split"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## D - Preprocessing : Scaling + Encoding"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "from preprocessing.scale_data import scale_variable\n",
    "\n",
    "sc, trainAttrX, testAttrX = scale_variable(trainAttrX, testAttrX,'FVC')\n",
    "trainY = trainAttrX.loc[:,'FVC_scaled']\n",
    "testY = testAttrX.loc[:,'FVC_scaled']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## E - Processing : Create models"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
282
    "from tensorflow.keras.callbacks import ModelCheckpoint, EarlyStopping\n",
Lafnoune Imane's avatar
Lafnoune Imane committed
283
    "\n",
284
285
286
    "#set early stopping criteria\n",
    "pat = 10 #this is the number of epochs with no improvment after which the training will stop\n",
    "es = EarlyStopping(monitor='val_loss', patience=pat, verbose=1)\n",
Lafnoune Imane's avatar
Lafnoune Imane committed
287
    "\n",
288
289
    "#define the model checkpoint callback -> this will keep on saving the model as a physical file\n",
    "cp = ModelCheckpoint('clean_notebooks/cnn_transfer_learning_weights.h5', verbose=1, save_best_only=True)"
Lafnoune Imane's avatar
Lafnoune Imane committed
290
291
292
293
294
295
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
   "outputs": [],
   "source": [
    "def custom_shuffle_split(trainAttrX,train_dataset,trainY,test_size = 0.1 ):\n",
    "    cut = int(len(trainY)*test_size)\n",
    "    arr = list(np.arange(len(trainY)))\n",
    "    np.random.shuffle(arr)\n",
    "    trainidx = arr[cut:]\n",
    "    testidx = arr[:cut]\n",
    "    train_x, train_y =  train_dataset[trainidx] , trainY[trainidx]\n",
    "    val_x, val_y =  train_dataset[testidx], trainY[testidx]\n",
    "    return train_x, val_x, train_y, val_y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "trainY = trainAttrX.loc[:,'FVC_scaled'].copy()\n",
    "trainY = trainY.reset_index( drop = True)\n",
    "trainAttrX.reset_index(inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "from processing.models import create_transfer_learning\n",
    "from keras.optimizers import Adam\n",
    "from tensorflow.keras.models import Model\n",
    "import efficientnet.tfkeras as efn\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
Lafnoune Imane's avatar
Lafnoune Imane committed
336
337
338
339
340
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
      "Training on Fold:  1\n",
      "Epoch 1/30\n",
      "15/15 [==============================] - ETA: 3:47 - loss: 0.588 - ETA: 10s - loss: 0.621 - ETA: 9s - loss: 0.6918 - ETA: 8s - loss: 0.722 - ETA: 7s - loss: 0.746 - ETA: 6s - loss: 0.743 - ETA: 6s - loss: 0.788 - ETA: 5s - loss: 0.822 - ETA: 4s - loss: 0.856 - ETA: 3s - loss: 0.875 - ETA: 3s - loss: 0.887 - ETA: 2s - loss: 0.893 - ETA: 1s - loss: 0.903 - ETA: 0s - loss: 0.911 - ETA: 0s - loss: 0.918 - 33s 1s/step - loss: 0.9241 - val_loss: 1.0518\n",
      "\n",
      "Epoch 00001: val_loss improved from inf to 1.05183, saving model to clean_notebooks\\cnn_transfer_learning_weights.h5\n",
      "Epoch 2/30\n",
      "15/15 [==============================] - ETA: 12s - loss: 0.76 - ETA: 10s - loss: 0.82 - ETA: 9s - loss: 0.8200 - ETA: 8s - loss: 0.852 - ETA: 7s - loss: 0.861 - ETA: 6s - loss: 0.871 - ETA: 5s - loss: 0.881 - ETA: 5s - loss: 0.890 - ETA: 4s - loss: 0.891 - ETA: 3s - loss: 0.893 - ETA: 2s - loss: 0.894 - ETA: 2s - loss: 0.892 - ETA: 1s - loss: 0.886 - ETA: 0s - loss: 0.894 - ETA: 0s - loss: 0.902 - 12s 778ms/step - loss: 0.9086 - val_loss: 1.0756\n",
      "\n",
      "Epoch 00002: val_loss did not improve from 1.05183\n",
      "Epoch 3/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 1.49 - ETA: 11s - loss: 1.26 - ETA: 9s - loss: 1.1002 - ETA: 8s - loss: 1.015 - ETA: 7s - loss: 0.968 - ETA: 7s - loss: 0.933 - ETA: 6s - loss: 0.921 - ETA: 5s - loss: 0.920 - ETA: 4s - loss: 0.920 - ETA: 3s - loss: 0.914 - ETA: 3s - loss: 0.912 - ETA: 2s - loss: 0.910 - ETA: 1s - loss: 0.907 - ETA: 0s - loss: 0.914 - ETA: 0s - loss: 0.921 - 12s 798ms/step - loss: 0.9263 - val_loss: 1.0678\n",
      "\n",
      "Epoch 00003: val_loss did not improve from 1.05183\n",
      "Epoch 4/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 1.199 - ETA: 9s - loss: 1.052 - ETA: 8s - loss: 0.970 - ETA: 7s - loss: 0.956 - ETA: 7s - loss: 0.944 - ETA: 6s - loss: 0.930 - ETA: 5s - loss: 0.910 - ETA: 5s - loss: 0.889 - ETA: 4s - loss: 0.885 - ETA: 3s - loss: 0.883 - ETA: 2s - loss: 0.898 - ETA: 2s - loss: 0.907 - ETA: 1s - loss: 0.915 - ETA: 0s - loss: 0.921 - ETA: 0s - loss: 0.926 - 12s 787ms/step - loss: 0.9315 - val_loss: 1.0578\n",
      "\n",
      "Epoch 00004: val_loss did not improve from 1.05183\n",
      "Epoch 5/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 3.11 - ETA: 9s - loss: 2.8582 - ETA: 8s - loss: 2.553 - ETA: 8s - loss: 2.364 - ETA: 7s - loss: 2.205 - ETA: 6s - loss: 2.079 - ETA: 5s - loss: 1.971 - ETA: 5s - loss: 1.882 - ETA: 4s - loss: 1.806 - ETA: 3s - loss: 1.744 - ETA: 2s - loss: 1.690 - ETA: 2s - loss: 1.639 - ETA: 1s - loss: 1.593 - ETA: 0s - loss: 1.553 - ETA: 0s - loss: 1.517 - 12s 788ms/step - loss: 1.4867 - val_loss: 1.0491\n",
      "\n",
      "Epoch 00005: val_loss improved from 1.05183 to 1.04907, saving model to clean_notebooks\\cnn_transfer_learning_weights.h5\n",
      "Epoch 6/30\n",
      "15/15 [==============================] - ETA: 11s - loss: 0.52 - ETA: 9s - loss: 0.6942 - ETA: 8s - loss: 0.717 - ETA: 7s - loss: 0.704 - ETA: 7s - loss: 0.694 - ETA: 6s - loss: 0.679 - ETA: 5s - loss: 0.681 - ETA: 5s - loss: 0.686 - ETA: 4s - loss: 0.706 - ETA: 3s - loss: 0.722 - ETA: 2s - loss: 0.736 - ETA: 2s - loss: 0.750 - ETA: 1s - loss: 0.773 - ETA: 0s - loss: 0.791 - ETA: 0s - loss: 0.806 - 12s 790ms/step - loss: 0.8199 - val_loss: 1.0606\n",
      "\n",
      "Epoch 00006: val_loss did not improve from 1.04907\n",
      "Epoch 7/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 1.597 - ETA: 9s - loss: 1.559 - ETA: 8s - loss: 1.439 - ETA: 7s - loss: 1.355 - ETA: 6s - loss: 1.289 - ETA: 6s - loss: 1.242 - ETA: 5s - loss: 1.218 - ETA: 5s - loss: 1.191 - ETA: 4s - loss: 1.163 - ETA: 3s - loss: 1.138 - ETA: 2s - loss: 1.116 - ETA: 2s - loss: 1.116 - ETA: 1s - loss: 1.112 - ETA: 0s - loss: 1.107 - ETA: 0s - loss: 1.102 - 12s 772ms/step - loss: 1.0983 - val_loss: 1.0706\n",
      "\n",
      "Epoch 00007: val_loss did not improve from 1.04907\n",
      "Epoch 8/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.19 - ETA: 9s - loss: 0.2623 - ETA: 8s - loss: 0.293 - ETA: 8s - loss: 0.419 - ETA: 7s - loss: 0.503 - ETA: 6s - loss: 0.568 - ETA: 6s - loss: 0.603 - ETA: 5s - loss: 0.621 - ETA: 4s - loss: 0.667 - ETA: 3s - loss: 0.705 - ETA: 3s - loss: 0.730 - ETA: 2s - loss: 0.755 - ETA: 1s - loss: 0.776 - ETA: 0s - loss: 0.792 - ETA: 0s - loss: 0.806 - 12s 797ms/step - loss: 0.8187 - val_loss: 1.0579\n",
      "\n",
      "Epoch 00008: val_loss did not improve from 1.04907\n",
      "Epoch 9/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 0.936 - ETA: 9s - loss: 0.813 - ETA: 8s - loss: 0.761 - ETA: 7s - loss: 0.802 - ETA: 7s - loss: 0.915 - ETA: 6s - loss: 0.967 - ETA: 6s - loss: 0.995 - ETA: 5s - loss: 1.011 - ETA: 4s - loss: 1.014 - ETA: 3s - loss: 1.012 - ETA: 3s - loss: 1.007 - ETA: 2s - loss: 1.004 - ETA: 1s - loss: 0.998 - ETA: 0s - loss: 0.998 - ETA: 0s - loss: 0.998 - 12s 800ms/step - loss: 0.9977 - val_loss: 1.0649\n",
      "\n",
      "Epoch 00009: val_loss did not improve from 1.04907\n",
      "Epoch 10/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 1.039 - ETA: 9s - loss: 1.590 - ETA: 8s - loss: 1.613 - ETA: 8s - loss: 1.625 - ETA: 7s - loss: 1.586 - ETA: 6s - loss: 1.542 - ETA: 5s - loss: 1.492 - ETA: 5s - loss: 1.450 - ETA: 4s - loss: 1.411 - ETA: 3s - loss: 1.374 - ETA: 2s - loss: 1.338 - ETA: 2s - loss: 1.309 - ETA: 1s - loss: 1.288 - ETA: 0s - loss: 1.268 - ETA: 0s - loss: 1.250 - 12s 777ms/step - loss: 1.2348 - val_loss: 1.0652\n",
      "\n",
      "Epoch 00010: val_loss did not improve from 1.04907\n",
      "Epoch 11/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.85 - ETA: 9s - loss: 0.7976 - ETA: 8s - loss: 0.775 - ETA: 7s - loss: 0.770 - ETA: 6s - loss: 0.766 - ETA: 6s - loss: 0.824 - ETA: 5s - loss: 0.875 - ETA: 5s - loss: 0.915 - ETA: 4s - loss: 0.940 - ETA: 3s - loss: 0.960 - ETA: 3s - loss: 0.973 - ETA: 2s - loss: 0.980 - ETA: 1s - loss: 0.985 - ETA: 0s - loss: 0.986 - ETA: 0s - loss: 0.985 - 12s 831ms/step - loss: 0.9857 - val_loss: 1.0534\n",
      "\n",
      "Epoch 00011: val_loss did not improve from 1.04907\n",
      "Epoch 12/30\n",
      "15/15 [==============================] - ETA: 11s - loss: 0.37 - ETA: 10s - loss: 1.06 - ETA: 9s - loss: 1.1942 - ETA: 8s - loss: 1.276 - ETA: 7s - loss: 1.321 - ETA: 6s - loss: 1.329 - ETA: 6s - loss: 1.317 - ETA: 5s - loss: 1.300 - ETA: 4s - loss: 1.283 - ETA: 3s - loss: 1.273 - ETA: 3s - loss: 1.258 - ETA: 2s - loss: 1.244 - ETA: 1s - loss: 1.228 - ETA: 0s - loss: 1.211 - ETA: 0s - loss: 1.197 - 12s 796ms/step - loss: 1.1842 - val_loss: 1.0568\n",
      "\n",
      "Epoch 00012: val_loss did not improve from 1.04907\n",
      "Epoch 13/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 0.728 - ETA: 9s - loss: 0.793 - ETA: 9s - loss: 1.063 - ETA: 8s - loss: 1.135 - ETA: 7s - loss: 1.152 - ETA: 6s - loss: 1.145 - ETA: 5s - loss: 1.133 - ETA: 5s - loss: 1.129 - ETA: 4s - loss: 1.120 - ETA: 3s - loss: 1.110 - ETA: 2s - loss: 1.099 - ETA: 2s - loss: 1.095 - ETA: 1s - loss: 1.090 - ETA: 0s - loss: 1.086 - ETA: 0s - loss: 1.083 - 12s 775ms/step - loss: 1.0802 - val_loss: 1.0654\n",
      "\n",
      "Epoch 00013: val_loss did not improve from 1.04907\n",
      "Epoch 14/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 0.531 - ETA: 9s - loss: 0.576 - ETA: 8s - loss: 0.910 - ETA: 8s - loss: 1.016 - ETA: 7s - loss: 1.056 - ETA: 6s - loss: 1.064 - ETA: 5s - loss: 1.063 - ETA: 5s - loss: 1.059 - ETA: 4s - loss: 1.061 - ETA: 3s - loss: 1.061 - ETA: 3s - loss: 1.057 - ETA: 2s - loss: 1.051 - ETA: 1s - loss: 1.050 - ETA: 0s - loss: 1.047 - ETA: 0s - loss: 1.044 - 12s 805ms/step - loss: 1.0412 - val_loss: 1.0502\n",
      "\n",
      "Epoch 00014: val_loss did not improve from 1.04907\n",
      "Epoch 15/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 2.814 - ETA: 9s - loss: 2.473 - ETA: 8s - loss: 2.216 - ETA: 7s - loss: 2.052 - ETA: 7s - loss: 1.935 - ETA: 6s - loss: 1.824 - ETA: 5s - loss: 1.736 - ETA: 5s - loss: 1.670 - ETA: 4s - loss: 1.622 - ETA: 3s - loss: 1.576 - ETA: 2s - loss: 1.536 - ETA: 2s - loss: 1.499 - ETA: 1s - loss: 1.463 - ETA: 0s - loss: 1.430 - ETA: 0s - loss: 1.401 - 12s 800ms/step - loss: 1.3761 - val_loss: 1.0478\n",
      "\n",
      "Epoch 00015: val_loss improved from 1.04907 to 1.04779, saving model to clean_notebooks\\cnn_transfer_learning_weights.h5\n",
      "Epoch 16/30\n",
      "15/15 [==============================] - ETA: 11s - loss: 0.52 - ETA: 10s - loss: 0.48 - ETA: 9s - loss: 0.4851 - ETA: 8s - loss: 0.533 - ETA: 8s - loss: 0.581 - ETA: 7s - loss: 0.633 - ETA: 6s - loss: 0.672 - ETA: 5s - loss: 0.698 - ETA: 4s - loss: 0.719 - ETA: 3s - loss: 0.754 - ETA: 3s - loss: 0.777 - ETA: 2s - loss: 0.794 - ETA: 1s - loss: 0.812 - ETA: 0s - loss: 0.826 - ETA: 0s - loss: 0.839 - 12s 815ms/step - loss: 0.8497 - val_loss: 1.0599\n",
      "\n",
      "Epoch 00016: val_loss did not improve from 1.04779\n",
      "Epoch 17/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.76 - ETA: 10s - loss: 0.88 - ETA: 9s - loss: 0.8885 - ETA: 8s - loss: 0.865 - ETA: 7s - loss: 0.844 - ETA: 6s - loss: 0.861 - ETA: 6s - loss: 0.870 - ETA: 5s - loss: 0.905 - ETA: 4s - loss: 0.928 - ETA: 3s - loss: 0.941 - ETA: 2s - loss: 0.949 - ETA: 2s - loss: 0.954 - ETA: 1s - loss: 0.953 - ETA: 0s - loss: 0.957 - ETA: 0s - loss: 0.960 - 12s 783ms/step - loss: 0.9630 - val_loss: 1.0509\n",
      "\n",
      "Epoch 00017: val_loss did not improve from 1.04779\n",
      "Epoch 18/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 0.762 - ETA: 9s - loss: 0.947 - ETA: 8s - loss: 0.986 - ETA: 8s - loss: 0.972 - ETA: 7s - loss: 0.954 - ETA: 7s - loss: 0.940 - ETA: 6s - loss: 0.925 - ETA: 5s - loss: 0.918 - ETA: 4s - loss: 0.906 - ETA: 4s - loss: 0.900 - ETA: 3s - loss: 0.901 - ETA: 2s - loss: 0.912 - ETA: 1s - loss: 0.922 - ETA: 0s - loss: 0.928 - ETA: 0s - loss: 0.934 - 12s 834ms/step - loss: 0.9392 - val_loss: 1.0470\n",
      "\n",
      "Epoch 00018: val_loss improved from 1.04779 to 1.04696, saving model to clean_notebooks\\cnn_transfer_learning_weights.h5\n",
      "Epoch 19/30\n",
      "15/15 [==============================] - ETA: 12s - loss: 0.87 - ETA: 9s - loss: 0.8142 - ETA: 8s - loss: 0.819 - ETA: 7s - loss: 0.834 - ETA: 7s - loss: 0.912 - ETA: 6s - loss: 0.953 - ETA: 5s - loss: 0.978 - ETA: 5s - loss: 0.997 - ETA: 4s - loss: 1.004 - ETA: 3s - loss: 1.008 - ETA: 2s - loss: 1.007 - ETA: 2s - loss: 1.005 - ETA: 1s - loss: 1.002 - ETA: 0s - loss: 0.997 - ETA: 0s - loss: 0.997 - 12s 799ms/step - loss: 0.9980 - val_loss: 1.0557\n",
      "\n",
      "Epoch 00019: val_loss did not improve from 1.04696\n",
      "Epoch 20/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.37 - ETA: 9s - loss: 0.4398 - ETA: 8s - loss: 0.611 - ETA: 7s - loss: 0.660 - ETA: 7s - loss: 0.689 - ETA: 6s - loss: 0.706 - ETA: 5s - loss: 0.708 - ETA: 5s - loss: 0.708 - ETA: 4s - loss: 0.710 - ETA: 3s - loss: 0.719 - ETA: 2s - loss: 0.725 - ETA: 2s - loss: 0.736 - ETA: 1s - loss: 0.745 - ETA: 0s - loss: 0.763 - ETA: 0s - loss: 0.779 - 12s 771ms/step - loss: 0.7926 - val_loss: 1.0508\n",
      "\n",
      "Epoch 00020: val_loss did not improve from 1.04696\n",
      "Epoch 21/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.91 - ETA: 9s - loss: 0.9903 - ETA: 9s - loss: 0.956 - ETA: 9s - loss: 0.931 - ETA: 8s - loss: 0.895 - ETA: 7s - loss: 0.891 - ETA: 6s - loss: 0.887 - ETA: 5s - loss: 0.881 - ETA: 4s - loss: 0.911 - ETA: 4s - loss: 0.935 - ETA: 3s - loss: 0.947 - ETA: 2s - loss: 0.954 - ETA: 1s - loss: 0.957 - ETA: 0s - loss: 0.959 - ETA: 0s - loss: 0.962 - 13s 844ms/step - loss: 0.9644 - val_loss: 1.0496\n",
      "\n",
      "Epoch 00021: val_loss did not improve from 1.04696\n",
      "Epoch 22/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 1.278 - ETA: 9s - loss: 1.180 - ETA: 8s - loss: 1.117 - ETA: 8s - loss: 1.035 - ETA: 7s - loss: 0.989 - ETA: 6s - loss: 0.958 - ETA: 5s - loss: 0.935 - ETA: 5s - loss: 0.951 - ETA: 4s - loss: 0.961 - ETA: 3s - loss: 0.975 - ETA: 2s - loss: 0.981 - ETA: 2s - loss: 0.981 - ETA: 1s - loss: 0.979 - ETA: 0s - loss: 0.979 - ETA: 0s - loss: 0.979 - 12s 773ms/step - loss: 0.9795 - val_loss: 1.0485\n",
      "\n",
      "Epoch 00022: val_loss did not improve from 1.04696\n",
      "Epoch 23/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.81 - ETA: 9s - loss: 0.8376 - ETA: 8s - loss: 0.880 - ETA: 8s - loss: 0.883 - ETA: 7s - loss: 0.883 - ETA: 6s - loss: 0.913 - ETA: 5s - loss: 0.927 - ETA: 5s - loss: 0.963 - ETA: 4s - loss: 0.984 - ETA: 3s - loss: 1.000 - ETA: 2s - loss: 1.010 - ETA: 2s - loss: 1.015 - ETA: 1s - loss: 1.014 - ETA: 0s - loss: 1.011 - ETA: 0s - loss: 1.011 - 11s 760ms/step - loss: 1.0122 - val_loss: 1.0492\n",
      "\n",
      "Epoch 00023: val_loss did not improve from 1.04696\n",
      "Epoch 24/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 1.051 - ETA: 9s - loss: 1.197 - ETA: 8s - loss: 1.163 - ETA: 8s - loss: 1.113 - ETA: 7s - loss: 1.077 - ETA: 6s - loss: 1.054 - ETA: 5s - loss: 1.042 - ETA: 5s - loss: 1.032 - ETA: 4s - loss: 1.022 - ETA: 3s - loss: 1.010 - ETA: 2s - loss: 1.019 - ETA: 2s - loss: 1.022 - ETA: 1s - loss: 1.020 - ETA: 0s - loss: 1.021 - ETA: 0s - loss: 1.020 - 12s 798ms/step - loss: 1.0206 - val_loss: 1.0460\n",
      "\n",
      "Epoch 00024: val_loss improved from 1.04696 to 1.04599, saving model to clean_notebooks\\cnn_transfer_learning_weights.h5\n",
      "Epoch 25/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.52 - ETA: 9s - loss: 0.5896 - ETA: 8s - loss: 0.633 - ETA: 7s - loss: 0.630 - ETA: 7s - loss: 0.625 - ETA: 6s - loss: 0.650 - ETA: 5s - loss: 0.660 - ETA: 5s - loss: 0.675 - ETA: 4s - loss: 0.688 - ETA: 3s - loss: 0.699 - ETA: 2s - loss: 0.707 - ETA: 2s - loss: 0.717 - ETA: 1s - loss: 0.726 - ETA: 0s - loss: 0.746 - ETA: 0s - loss: 0.764 - 12s 808ms/step - loss: 0.7790 - val_loss: 1.0484\n",
      "\n",
      "Epoch 00025: val_loss did not improve from 1.04599\n",
      "Epoch 26/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.99 - ETA: 9s - loss: 0.9126 - ETA: 8s - loss: 0.876 - ETA: 7s - loss: 0.850 - ETA: 7s - loss: 0.822 - ETA: 6s - loss: 0.817 - ETA: 5s - loss: 0.817 - ETA: 5s - loss: 0.858 - ETA: 4s - loss: 0.884 - ETA: 3s - loss: 0.902 - ETA: 2s - loss: 0.920 - ETA: 2s - loss: 0.931 - ETA: 1s - loss: 0.939 - ETA: 0s - loss: 0.944 - ETA: 0s - loss: 0.949 - 12s 782ms/step - loss: 0.9539 - val_loss: 1.0537\n",
      "\n",
      "Epoch 00026: val_loss did not improve from 1.04599\n",
      "Epoch 27/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.92 - ETA: 10s - loss: 1.13 - ETA: 9s - loss: 1.3648 - ETA: 8s - loss: 1.448 - ETA: 7s - loss: 1.443 - ETA: 7s - loss: 1.416 - ETA: 6s - loss: 1.385 - ETA: 5s - loss: 1.356 - ETA: 4s - loss: 1.328 - ETA: 3s - loss: 1.302 - ETA: 3s - loss: 1.283 - ETA: 2s - loss: 1.260 - ETA: 1s - loss: 1.246 - ETA: 0s - loss: 1.231 - ETA: 0s - loss: 1.218 - 12s 814ms/step - loss: 1.2061 - val_loss: 1.0495\n",
      "\n",
      "Epoch 00027: val_loss did not improve from 1.04599\n",
      "Epoch 28/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 0.909 - ETA: 9s - loss: 1.010 - ETA: 8s - loss: 1.060 - ETA: 8s - loss: 1.039 - ETA: 7s - loss: 1.006 - ETA: 6s - loss: 0.967 - ETA: 5s - loss: 0.945 - ETA: 5s - loss: 0.925 - ETA: 4s - loss: 0.913 - ETA: 3s - loss: 0.898 - ETA: 2s - loss: 0.891 - ETA: 2s - loss: 0.885 - ETA: 1s - loss: 0.892 - ETA: 0s - loss: 0.897 - ETA: 0s - loss: 0.905 - 12s 782ms/step - loss: 0.9126 - val_loss: 1.0527\n",
      "\n",
      "Epoch 00028: val_loss did not improve from 1.04599\n",
      "Epoch 29/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 0.612 - ETA: 9s - loss: 0.717 - ETA: 8s - loss: 0.725 - ETA: 7s - loss: 0.759 - ETA: 7s - loss: 0.760 - ETA: 6s - loss: 0.782 - ETA: 5s - loss: 0.788 - ETA: 5s - loss: 0.789 - ETA: 4s - loss: 0.790 - ETA: 3s - loss: 0.790 - ETA: 2s - loss: 0.810 - ETA: 2s - loss: 0.822 - ETA: 1s - loss: 0.833 - ETA: 0s - loss: 0.846 - ETA: 0s - loss: 0.858 - 12s 779ms/step - loss: 0.8692 - val_loss: 1.0461\n",
      "\n",
      "Epoch 00029: val_loss did not improve from 1.04599\n",
      "Epoch 30/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.54 - ETA: 9s - loss: 0.6109 - ETA: 9s - loss: 0.655 - ETA: 8s - loss: 0.687 - ETA: 7s - loss: 0.724 - ETA: 7s - loss: 0.740 - ETA: 6s - loss: 0.753 - ETA: 5s - loss: 0.765 - ETA: 4s - loss: 0.767 - ETA: 3s - loss: 0.765 - ETA: 2s - loss: 0.770 - ETA: 2s - loss: 0.788 - ETA: 1s - loss: 0.801 - ETA: 0s - loss: 0.814 - ETA: 0s - loss: 0.826 - 12s 768ms/step - loss: 0.8370 - val_loss: 1.0536\n",
      "\n",
      "Epoch 00030: val_loss did not improve from 1.04599\n",
      "1/1 [==============================] - ETA: 0s - loss: 1.042 - 1s 1s/step - loss: 1.0424\n",
      "Val Score:  1.0424169301986694\n",
      "====================================================================================\n",
      "\n",
      "\n",
      "Training on Fold:  2\n",
      "Epoch 1/30\n",
      "15/15 [==============================] - ETA: 3:11 - loss: 1.310 - ETA: 10s - loss: 1.330 - ETA: 9s - loss: 1.2674 - ETA: 8s - loss: 1.231 - ETA: 7s - loss: 1.203 - ETA: 6s - loss: 1.169 - ETA: 5s - loss: 1.138 - ETA: 5s - loss: 1.133 - ETA: 4s - loss: 1.128 - ETA: 3s - loss: 1.121 - ETA: 3s - loss: 1.110 - ETA: 2s - loss: 1.098 - ETA: 1s - loss: 1.091 - ETA: 0s - loss: 1.083 - ETA: 0s - loss: 1.074 - 27s 958ms/step - loss: 1.0679 - val_loss: 0.5773\n",
      "\n",
      "Epoch 00001: val_loss improved from 1.04599 to 0.57729, saving model to clean_notebooks\\cnn_transfer_learning_weights.h5\n",
      "Epoch 2/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.78 - ETA: 10s - loss: 0.70 - ETA: 10s - loss: 0.69 - ETA: 9s - loss: 0.7609 - ETA: 7s - loss: 0.782 - ETA: 7s - loss: 0.807 - ETA: 6s - loss: 0.817 - ETA: 5s - loss: 0.864 - ETA: 4s - loss: 0.901 - ETA: 3s - loss: 0.923 - ETA: 3s - loss: 0.939 - ETA: 2s - loss: 0.946 - ETA: 1s - loss: 0.951 - ETA: 0s - loss: 0.952 - ETA: 0s - loss: 0.953 - 12s 821ms/step - loss: 0.9536 - val_loss: 0.5573\n",
      "\n",
      "Epoch 00002: val_loss improved from 0.57729 to 0.55730, saving model to clean_notebooks\\cnn_transfer_learning_weights.h5\n",
      "Epoch 3/30\n",
      "15/15 [==============================] - ETA: 12s - loss: 0.54 - ETA: 9s - loss: 0.6453 - ETA: 8s - loss: 1.057 - ETA: 7s - loss: 1.172 - ETA: 7s - loss: 1.226 - ETA: 6s - loss: 1.231 - ETA: 6s - loss: 1.220 - ETA: 5s - loss: 1.212 - ETA: 4s - loss: 1.203 - ETA: 3s - loss: 1.190 - ETA: 2s - loss: 1.181 - ETA: 2s - loss: 1.170 - ETA: 1s - loss: 1.156 - ETA: 0s - loss: 1.144 - ETA: 0s - loss: 1.133 - 12s 810ms/step - loss: 1.1237 - val_loss: 0.5687\n",
      "\n",
      "Epoch 00003: val_loss did not improve from 0.55730\n",
      "Epoch 4/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 1.05 - ETA: 10s - loss: 0.95 - ETA: 9s - loss: 0.8909 - ETA: 8s - loss: 1.040 - ETA: 7s - loss: 1.103 - ETA: 6s - loss: 1.143 - ETA: 6s - loss: 1.148 - ETA: 5s - loss: 1.156 - ETA: 4s - loss: 1.155 - ETA: 3s - loss: 1.144 - ETA: 3s - loss: 1.140 - ETA: 2s - loss: 1.133 - ETA: 1s - loss: 1.125 - ETA: 0s - loss: 1.115 - ETA: 0s - loss: 1.107 - 12s 802ms/step - loss: 1.1004 - val_loss: 0.6012\n",
      "\n",
      "Epoch 00004: val_loss did not improve from 0.55730\n",
      "Epoch 5/30\n",
      "15/15 [==============================] - ETA: 11s - loss: 0.50 - ETA: 9s - loss: 0.4865 - ETA: 9s - loss: 0.538 - ETA: 8s - loss: 0.538 - ETA: 7s - loss: 0.525 - ETA: 6s - loss: 0.536 - ETA: 6s - loss: 0.543 - ETA: 5s - loss: 0.582 - ETA: 4s - loss: 0.616 - ETA: 3s - loss: 0.648 - ETA: 3s - loss: 0.677 - ETA: 2s - loss: 0.706 - ETA: 1s - loss: 0.727 - ETA: 0s - loss: 0.745 - ETA: 0s - loss: 0.762 - 13s 855ms/step - loss: 0.7769 - val_loss: 0.5296\n",
      "\n",
      "Epoch 00005: val_loss improved from 0.55730 to 0.52962, saving model to clean_notebooks\\cnn_transfer_learning_weights.h5\n",
      "Epoch 6/30\n",
      "15/15 [==============================] - ETA: 11s - loss: 0.91 - ETA: 9s - loss: 0.7949 - ETA: 8s - loss: 0.782 - ETA: 8s - loss: 0.934 - ETA: 7s - loss: 0.995 - ETA: 7s - loss: 1.030 - ETA: 6s - loss: 1.057 - ETA: 5s - loss: 1.080 - ETA: 4s - loss: 1.092 - ETA: 3s - loss: 1.094 - ETA: 3s - loss: 1.096 - ETA: 2s - loss: 1.094 - ETA: 1s - loss: 1.087 - ETA: 0s - loss: 1.082 - ETA: 0s - loss: 1.076 - 13s 852ms/step - loss: 1.0721 - val_loss: 0.5321\n",
      "\n",
      "Epoch 00006: val_loss did not improve from 0.52962\n",
      "Epoch 7/30\n",
      "15/15 [==============================] - ETA: 11s - loss: 0.70 - ETA: 11s - loss: 0.76 - ETA: 10s - loss: 0.78 - ETA: 9s - loss: 0.7785 - ETA: 8s - loss: 0.817 - ETA: 7s - loss: 0.852 - ETA: 6s - loss: 0.861 - ETA: 5s - loss: 0.863 - ETA: 5s - loss: 0.860 - ETA: 4s - loss: 0.855 - ETA: 3s - loss: 0.848 - ETA: 2s - loss: 0.848 - ETA: 1s - loss: 0.847 - ETA: 0s - loss: 0.856 - ETA: 0s - loss: 0.864 - 13s 847ms/step - loss: 0.8709 - val_loss: 0.5513\n",
      "\n",
      "Epoch 00007: val_loss did not improve from 0.52962\n",
      "Epoch 8/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.44 - ETA: 10s - loss: 1.12 - ETA: 9s - loss: 1.2044 - ETA: 8s - loss: 1.235 - ETA: 7s - loss: 1.227 - ETA: 7s - loss: 1.200 - ETA: 6s - loss: 1.184 - ETA: 5s - loss: 1.166 - ETA: 4s - loss: 1.153 - ETA: 3s - loss: 1.143 - ETA: 3s - loss: 1.131 - ETA: 2s - loss: 1.122 - ETA: 1s - loss: 1.112 - ETA: 0s - loss: 1.105 - ETA: 0s - loss: 1.098 - 12s 812ms/step - loss: 1.0925 - val_loss: 0.6082\n",
      "\n",
      "Epoch 00008: val_loss did not improve from 0.52962\n",
      "Epoch 9/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 1.38 - ETA: 9s - loss: 1.3343 - ETA: 8s - loss: 1.203 - ETA: 8s - loss: 1.128 - ETA: 7s - loss: 1.157 - ETA: 6s - loss: 1.191 - ETA: 6s - loss: 1.197 - ETA: 5s - loss: 1.188 - ETA: 4s - loss: 1.178 - ETA: 3s - loss: 1.166 - ETA: 3s - loss: 1.155 - ETA: 2s - loss: 1.143 - ETA: 1s - loss: 1.131 - ETA: 0s - loss: 1.122 - ETA: 0s - loss: 1.113 - 12s 806ms/step - loss: 1.1064 - val_loss: 0.5931\n",
      "\n",
      "Epoch 00009: val_loss did not improve from 0.52962\n",
      "Epoch 10/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 2.90 - ETA: 9s - loss: 2.2816 - ETA: 8s - loss: 2.001 - ETA: 7s - loss: 1.791 - ETA: 7s - loss: 1.648 - ETA: 6s - loss: 1.530 - ETA: 5s - loss: 1.436 - ETA: 5s - loss: 1.361 - ETA: 4s - loss: 1.306 - ETA: 3s - loss: 1.263 - ETA: 2s - loss: 1.233 - ETA: 2s - loss: 1.208 - ETA: 1s - loss: 1.189 - ETA: 0s - loss: 1.171 - ETA: 0s - loss: 1.158 - 12s 798ms/step - loss: 1.1479 - val_loss: 0.5651\n",
      "\n",
      "Epoch 00010: val_loss did not improve from 0.52962\n",
      "Epoch 11/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 1.43 - ETA: 9s - loss: 1.2673 - ETA: 9s - loss: 1.196 - ETA: 8s - loss: 1.156 - ETA: 7s - loss: 1.108 - ETA: 6s - loss: 1.079 - ETA: 6s - loss: 1.058 - ETA: 5s - loss: 1.030 - ETA: 4s - loss: 1.005 - ETA: 3s - loss: 0.990 - ETA: 3s - loss: 0.993 - ETA: 2s - loss: 0.992 - ETA: 1s - loss: 0.993 - ETA: 0s - loss: 0.991 - ETA: 0s - loss: 0.989 - 12s 804ms/step - loss: 0.9882 - val_loss: 0.5755\n",
      "\n",
      "Epoch 00011: val_loss did not improve from 0.52962\n",
      "Epoch 12/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.72 - ETA: 9s - loss: 0.7317 - ETA: 8s - loss: 0.700 - ETA: 7s - loss: 0.769 - ETA: 7s - loss: 0.794 - ETA: 6s - loss: 0.810 - ETA: 5s - loss: 0.809 - ETA: 5s - loss: 0.811 - ETA: 4s - loss: 0.811 - ETA: 3s - loss: 0.814 - ETA: 2s - loss: 0.819 - ETA: 2s - loss: 0.821 - ETA: 1s - loss: 0.835 - ETA: 0s - loss: 0.844 - ETA: 0s - loss: 0.852 - 12s 808ms/step - loss: 0.8596 - val_loss: 0.5624\n",
      "\n",
      "Epoch 00012: val_loss did not improve from 0.52962\n",
      "Epoch 13/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 1.05 - ETA: 9s - loss: 0.8971 - ETA: 8s - loss: 0.839 - ETA: 7s - loss: 0.841 - ETA: 7s - loss: 0.848 - ETA: 6s - loss: 0.874 - ETA: 6s - loss: 0.881 - ETA: 5s - loss: 0.886 - ETA: 4s - loss: 0.907 - ETA: 3s - loss: 0.921 - ETA: 3s - loss: 0.930 - ETA: 2s - loss: 0.936 - ETA: 1s - loss: 0.941 - ETA: 0s - loss: 0.944 - ETA: 0s - loss: 0.946 - 12s 839ms/step - loss: 0.9482 - val_loss: 0.5984\n",
      "\n",
      "Epoch 00013: val_loss did not improve from 0.52962\n",
      "Epoch 14/30\n",
      "15/15 [==============================] - ETA: 11s - loss: 0.75 - ETA: 10s - loss: 0.71 - ETA: 10s - loss: 0.76 - ETA: 9s - loss: 0.7929 - ETA: 8s - loss: 0.834 - ETA: 7s - loss: 0.852 - ETA: 6s - loss: 0.858 - ETA: 5s - loss: 0.857 - ETA: 4s - loss: 0.858 - ETA: 4s - loss: 0.858 - ETA: 3s - loss: 0.872 - ETA: 2s - loss: 0.887 - ETA: 1s - loss: 0.896 - ETA: 0s - loss: 0.902 - ETA: 0s - loss: 0.907 - 13s 844ms/step - loss: 0.9119 - val_loss: 0.5432\n",
      "\n",
      "Epoch 00014: val_loss did not improve from 0.52962\n",
      "Epoch 15/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 1.25 - ETA: 9s - loss: 1.7054 - ETA: 9s - loss: 1.718 - ETA: 8s - loss: 1.645 - ETA: 7s - loss: 1.554 - ETA: 6s - loss: 1.478 - ETA: 5s - loss: 1.411 - ETA: 5s - loss: 1.362 - ETA: 4s - loss: 1.334 - ETA: 3s - loss: 1.309 - ETA: 2s - loss: 1.284 - ETA: 2s - loss: 1.259 - ETA: 1s - loss: 1.237 - ETA: 0s - loss: 1.221 - ETA: 0s - loss: 1.207 - 12s 799ms/step - loss: 1.1948 - val_loss: 0.5379\n",
      "\n",
      "Epoch 00015: val_loss did not improve from 0.52962\n",
      "Epoch 00015: early stopping\n",
      "1/1 [==============================] - ETA: 0s - loss: 1.677 - 1s 1s/step - loss: 1.6774\n",
      "Val Score:  1.6773935556411743\n",
      "====================================================================================\n",
      "\n",
      "\n",
      "Training on Fold:  3\n",
      "Epoch 1/30\n",
      "15/15 [==============================] - ETA: 3:07 - loss: 1.246 - ETA: 9s - loss: 1.1709  - ETA: 9s - loss: 1.140 - ETA: 8s - loss: 1.089 - ETA: 7s - loss: 1.134 - ETA: 6s - loss: 1.157 - ETA: 6s - loss: 1.174 - ETA: 5s - loss: 1.183 - ETA: 4s - loss: 1.185 - ETA: 4s - loss: 1.180 - ETA: 3s - loss: 1.180 - ETA: 2s - loss: 1.173 - ETA: 1s - loss: 1.165 - ETA: 0s - loss: 1.156 - ETA: 0s - loss: 1.149 - 29s 1s/step - loss: 1.1434 - val_loss: 0.7335\n",
      "\n",
      "Epoch 00001: val_loss did not improve from 0.52962\n",
      "Epoch 2/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 1.40 - ETA: 9s - loss: 1.2592 - ETA: 8s - loss: 1.174 - ETA: 8s - loss: 1.129 - ETA: 7s - loss: 1.179 - ETA: 6s - loss: 1.193 - ETA: 5s - loss: 1.182 - ETA: 5s - loss: 1.190 - ETA: 4s - loss: 1.196 - ETA: 3s - loss: 1.198 - ETA: 2s - loss: 1.199 - ETA: 2s - loss: 1.195 - ETA: 1s - loss: 1.187 - ETA: 0s - loss: 1.177 - ETA: 0s - loss: 1.169 - 12s 808ms/step - loss: 1.1616 - val_loss: 0.7364\n",
      "\n",
      "Epoch 00002: val_loss did not improve from 0.52962\n",
      "Epoch 3/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.35 - ETA: 9s - loss: 0.6468 - ETA: 8s - loss: 0.753 - ETA: 8s - loss: 0.816 - ETA: 7s - loss: 0.865 - ETA: 6s - loss: 0.947 - ETA: 5s - loss: 0.988 - ETA: 5s - loss: 1.016 - ETA: 4s - loss: 1.030 - ETA: 3s - loss: 1.034 - ETA: 2s - loss: 1.036 - ETA: 2s - loss: 1.040 - ETA: 1s - loss: 1.039 - ETA: 0s - loss: 1.036 - ETA: 0s - loss: 1.035 - 12s 785ms/step - loss: 1.0339 - val_loss: 0.7467\n",
      "\n",
      "Epoch 00003: val_loss did not improve from 0.52962\n",
      "Epoch 4/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 1.594 - ETA: 9s - loss: 1.487 - ETA: 8s - loss: 1.330 - ETA: 8s - loss: 1.202 - ETA: 7s - loss: 1.131 - ETA: 6s - loss: 1.085 - ETA: 5s - loss: 1.050 - ETA: 4s - loss: 1.018 - ETA: 4s - loss: 0.987 - ETA: 3s - loss: 0.966 - ETA: 2s - loss: 0.950 - ETA: 2s - loss: 0.937 - ETA: 1s - loss: 0.932 - ETA: 0s - loss: 0.940 - ETA: 0s - loss: 0.946 - 11s 765ms/step - loss: 0.9521 - val_loss: 0.8092\n",
      "\n",
      "Epoch 00004: val_loss did not improve from 0.52962\n",
      "Epoch 5/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 1.65 - ETA: 9s - loss: 1.3970 - ETA: 8s - loss: 1.294 - ETA: 8s - loss: 1.246 - ETA: 7s - loss: 1.286 - ETA: 6s - loss: 1.299 - ETA: 5s - loss: 1.290 - ETA: 5s - loss: 1.284 - ETA: 4s - loss: 1.267 - ETA: 3s - loss: 1.246 - ETA: 2s - loss: 1.226 - ETA: 2s - loss: 1.215 - ETA: 1s - loss: 1.206 - ETA: 0s - loss: 1.195 - ETA: 0s - loss: 1.186 - 11s 768ms/step - loss: 1.1790 - val_loss: 0.8342\n",
      "\n",
      "Epoch 00005: val_loss did not improve from 0.52962\n",
      "Epoch 6/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 1.86 - ETA: 9s - loss: 1.4492 - ETA: 8s - loss: 1.358 - ETA: 8s - loss: 1.284 - ETA: 7s - loss: 1.250 - ETA: 6s - loss: 1.230 - ETA: 5s - loss: 1.201 - ETA: 5s - loss: 1.172 - ETA: 4s - loss: 1.173 - ETA: 3s - loss: 1.166 - ETA: 2s - loss: 1.163 - ETA: 2s - loss: 1.158 - ETA: 1s - loss: 1.152 - ETA: 0s - loss: 1.144 - ETA: 0s - loss: 1.137 - 11s 765ms/step - loss: 1.1316 - val_loss: 0.8180\n",
      "\n",
      "Epoch 00006: val_loss did not improve from 0.52962\n",
      "Epoch 7/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.58 - ETA: 9s - loss: 0.5122 - ETA: 9s - loss: 0.563 - ETA: 8s - loss: 0.642 - ETA: 7s - loss: 0.782 - ETA: 6s - loss: 0.883 - ETA: 6s - loss: 0.947 - ETA: 5s - loss: 0.981 - ETA: 4s - loss: 1.008 - ETA: 3s - loss: 1.024 - ETA: 3s - loss: 1.033 - ETA: 2s - loss: 1.035 - ETA: 1s - loss: 1.038 - ETA: 0s - loss: 1.038 - ETA: 0s - loss: 1.038 - 12s 803ms/step - loss: 1.0395 - val_loss: 0.7642\n",
      "\n",
      "Epoch 00007: val_loss did not improve from 0.52962\n",
      "Epoch 8/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 0.735 - ETA: 9s - loss: 1.042 - ETA: 8s - loss: 1.181 - ETA: 8s - loss: 1.205 - ETA: 7s - loss: 1.203 - ETA: 6s - loss: 1.252 - ETA: 5s - loss: 1.264 - ETA: 5s - loss: 1.271 - ETA: 4s - loss: 1.275 - ETA: 3s - loss: 1.268 - ETA: 2s - loss: 1.265 - ETA: 2s - loss: 1.256 - ETA: 1s - loss: 1.245 - ETA: 0s - loss: 1.234 - ETA: 0s - loss: 1.224 - 12s 772ms/step - loss: 1.2153 - val_loss: 0.7149\n",
      "\n",
      "Epoch 00008: val_loss did not improve from 0.52962\n",
      "Epoch 9/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.33 - ETA: 9s - loss: 0.7276 - ETA: 9s - loss: 0.918 - ETA: 8s - loss: 0.973 - ETA: 7s - loss: 0.987 - ETA: 6s - loss: 0.978 - ETA: 5s - loss: 1.027 - ETA: 5s - loss: 1.048 - ETA: 4s - loss: 1.056 - ETA: 3s - loss: 1.063 - ETA: 2s - loss: 1.067 - ETA: 2s - loss: 1.065 - ETA: 1s - loss: 1.065 - ETA: 0s - loss: 1.063 - ETA: 0s - loss: 1.060 - 12s 800ms/step - loss: 1.0588 - val_loss: 0.7858\n",
      "\n",
      "Epoch 00009: val_loss did not improve from 0.52962\n",
      "Epoch 10/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.79 - ETA: 9s - loss: 1.4718 - ETA: 9s - loss: 1.564 - ETA: 8s - loss: 1.577 - ETA: 7s - loss: 1.535 - ETA: 6s - loss: 1.507 - ETA: 6s - loss: 1.491 - ETA: 5s - loss: 1.469 - ETA: 4s - loss: 1.443 - ETA: 3s - loss: 1.416 - ETA: 3s - loss: 1.388 - ETA: 2s - loss: 1.363 - ETA: 1s - loss: 1.340 - ETA: 0s - loss: 1.317 - ETA: 0s - loss: 1.298 - 12s 823ms/step - loss: 1.2812 - val_loss: 0.8416\n",
      "\n",
      "Epoch 00010: val_loss did not improve from 0.52962\n",
      "Epoch 11/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 0.77 - ETA: 9s - loss: 0.9367 - ETA: 9s - loss: 0.996 - ETA: 8s - loss: 0.984 - ETA: 7s - loss: 0.969 - ETA: 6s - loss: 0.947 - ETA: 5s - loss: 0.928 - ETA: 5s - loss: 0.906 - ETA: 4s - loss: 0.929 - ETA: 3s - loss: 0.942 - ETA: 2s - loss: 0.963 - ETA: 2s - loss: 0.977 - ETA: 1s - loss: 0.985 - ETA: 0s - loss: 0.993 - ETA: 0s - loss: 0.998 - 12s 782ms/step - loss: 1.0040 - val_loss: 0.8535\n",
      "\n",
      "Epoch 00011: val_loss did not improve from 0.52962\n",
      "Epoch 12/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 0.418 - ETA: 9s - loss: 0.487 - ETA: 8s - loss: 0.507 - ETA: 8s - loss: 0.512 - ETA: 7s - loss: 0.507 - ETA: 6s - loss: 0.550 - ETA: 5s - loss: 0.574 - ETA: 5s - loss: 0.636 - ETA: 4s - loss: 0.688 - ETA: 3s - loss: 0.727 - ETA: 2s - loss: 0.758 - ETA: 2s - loss: 0.782 - ETA: 1s - loss: 0.801 - ETA: 0s - loss: 0.819 - ETA: 0s - loss: 0.836 - 12s 775ms/step - loss: 0.8501 - val_loss: 0.7406\n",
      "\n",
      "Epoch 00012: val_loss did not improve from 0.52962\n",
      "Epoch 13/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 1.113 - ETA: 9s - loss: 1.853 - ETA: 8s - loss: 1.969 - ETA: 7s - loss: 1.931 - ETA: 6s - loss: 1.867 - ETA: 6s - loss: 1.801 - ETA: 5s - loss: 1.740 - ETA: 4s - loss: 1.682 - ETA: 4s - loss: 1.636 - ETA: 3s - loss: 1.590 - ETA: 2s - loss: 1.549 - ETA: 2s - loss: 1.509 - ETA: 1s - loss: 1.474 - ETA: 0s - loss: 1.442 - ETA: 0s - loss: 1.416 - 11s 768ms/step - loss: 1.3936 - val_loss: 0.6933\n",
      "\n",
      "Epoch 00013: val_loss did not improve from 0.52962\n",
      "Epoch 14/30\n",
      "15/15 [==============================] - ETA: 11s - loss: 0.57 - ETA: 10s - loss: 0.51 - ETA: 8s - loss: 0.5305 - ETA: 7s - loss: 0.556 - ETA: 7s - loss: 0.565 - ETA: 6s - loss: 0.595 - ETA: 5s - loss: 0.630 - ETA: 4s - loss: 0.662 - ETA: 4s - loss: 0.686 - ETA: 3s - loss: 0.706 - ETA: 2s - loss: 0.718 - ETA: 2s - loss: 0.727 - ETA: 1s - loss: 0.747 - ETA: 0s - loss: 0.767 - ETA: 0s - loss: 0.786 - 12s 762ms/step - loss: 0.8023 - val_loss: 0.7021\n",
      "\n",
      "Epoch 00014: val_loss did not improve from 0.52962\n",
      "Epoch 15/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 3.54 - ETA: 9s - loss: 2.8727 - ETA: 9s - loss: 2.425 - ETA: 8s - loss: 2.155 - ETA: 7s - loss: 1.949 - ETA: 6s - loss: 1.823 - ETA: 5s - loss: 1.728 - ETA: 5s - loss: 1.653 - ETA: 4s - loss: 1.587 - ETA: 3s - loss: 1.534 - ETA: 2s - loss: 1.489 - ETA: 2s - loss: 1.451 - ETA: 1s - loss: 1.416 - ETA: 0s - loss: 1.389 - ETA: 0s - loss: 1.366 - 12s 776ms/step - loss: 1.3453 - val_loss: 0.7815\n",
      "\n",
      "Epoch 00015: val_loss did not improve from 0.52962\n",
      "Epoch 16/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 0.195 - ETA: 9s - loss: 0.385 - ETA: 8s - loss: 0.699 - ETA: 7s - loss: 0.887 - ETA: 7s - loss: 0.960 - ETA: 6s - loss: 1.021 - ETA: 5s - loss: 1.070 - ETA: 5s - loss: 1.096 - ETA: 4s - loss: 1.112 - ETA: 3s - loss: 1.118 - ETA: 2s - loss: 1.119 - ETA: 2s - loss: 1.121 - ETA: 1s - loss: 1.120 - ETA: 0s - loss: 1.118 - ETA: 0s - loss: 1.116 - 11s 763ms/step - loss: 1.1145 - val_loss: 0.7988\n",
      "\n",
      "Epoch 00016: val_loss did not improve from 0.52962\n",
      "Epoch 17/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 1.42 - ETA: 9s - loss: 1.4878 - ETA: 8s - loss: 1.435 - ETA: 7s - loss: 1.364 - ETA: 7s - loss: 1.291 - ETA: 6s - loss: 1.238 - ETA: 5s - loss: 1.240 - ETA: 5s - loss: 1.234 - ETA: 4s - loss: 1.238 - ETA: 3s - loss: 1.238 - ETA: 2s - loss: 1.231 - ETA: 2s - loss: 1.220 - ETA: 1s - loss: 1.208 - ETA: 0s - loss: 1.196 - ETA: 0s - loss: 1.186 - 12s 787ms/step - loss: 1.1780 - val_loss: 0.7627\n",
      "\n",
      "Epoch 00017: val_loss did not improve from 0.52962\n",
      "Epoch 18/30\n",
      "15/15 [==============================] - ETA: 10s - loss: 1.49 - ETA: 9s - loss: 1.3619 - ETA: 8s - loss: 1.287 - ETA: 7s - loss: 1.198 - ETA: 7s - loss: 1.130 - ETA: 6s - loss: 1.075 - ETA: 5s - loss: 1.042 - ETA: 4s - loss: 1.010 - ETA: 4s - loss: 1.004 - ETA: 3s - loss: 0.995 - ETA: 2s - loss: 0.993 - ETA: 2s - loss: 0.990 - ETA: 1s - loss: 1.000 - ETA: 0s - loss: 1.005 - ETA: 0s - loss: 1.008 - 11s 759ms/step - loss: 1.0109 - val_loss: 0.8160\n",
      "\n",
      "Epoch 00018: val_loss did not improve from 0.52962\n",
      "Epoch 19/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 0.512 - ETA: 9s - loss: 0.796 - ETA: 8s - loss: 0.971 - ETA: 7s - loss: 1.001 - ETA: 7s - loss: 0.994 - ETA: 6s - loss: 0.988 - ETA: 5s - loss: 0.971 - ETA: 4s - loss: 0.951 - ETA: 4s - loss: 0.930 - ETA: 3s - loss: 0.916 - ETA: 2s - loss: 0.919 - ETA: 2s - loss: 0.928 - ETA: 1s - loss: 0.937 - ETA: 0s - loss: 0.946 - ETA: 0s - loss: 0.953 - 11s 757ms/step - loss: 0.9592 - val_loss: 0.7927\n",
      "\n",
      "Epoch 00019: val_loss did not improve from 0.52962\n",
      "Epoch 20/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 1.246 - ETA: 9s - loss: 1.362 - ETA: 8s - loss: 1.379 - ETA: 7s - loss: 1.315 - ETA: 7s - loss: 1.269 - ETA: 6s - loss: 1.232 - ETA: 5s - loss: 1.191 - ETA: 4s - loss: 1.152 - ETA: 4s - loss: 1.120 - ETA: 3s - loss: 1.091 - ETA: 2s - loss: 1.065 - ETA: 2s - loss: 1.046 - ETA: 1s - loss: 1.051 - ETA: 0s - loss: 1.051 - ETA: 0s - loss: 1.051 - 11s 763ms/step - loss: 1.0518 - val_loss: 0.6939\n",
      "\n",
      "Epoch 00020: val_loss did not improve from 0.52962\n",
      "Epoch 21/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 1.667 - ETA: 9s - loss: 1.442 - ETA: 8s - loss: 1.314 - ETA: 7s - loss: 1.251 - ETA: 7s - loss: 1.209 - ETA: 6s - loss: 1.165 - ETA: 5s - loss: 1.127 - ETA: 4s - loss: 1.092 - ETA: 4s - loss: 1.066 - ETA: 3s - loss: 1.046 - ETA: 2s - loss: 1.032 - ETA: 2s - loss: 1.016 - ETA: 1s - loss: 1.011 - ETA: 0s - loss: 1.016 - ETA: 0s - loss: 1.020 - 12s 775ms/step - loss: 1.0239 - val_loss: 0.6994\n",
      "\n",
      "Epoch 00021: val_loss did not improve from 0.52962\n",
      "Epoch 22/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 1.424 - ETA: 9s - loss: 1.263 - ETA: 8s - loss: 1.178 - ETA: 7s - loss: 1.083 - ETA: 7s - loss: 1.016 - ETA: 6s - loss: 0.966 - ETA: 5s - loss: 0.943 - ETA: 5s - loss: 0.921 - ETA: 4s - loss: 0.902 - ETA: 3s - loss: 0.896 - ETA: 2s - loss: 0.906 - ETA: 2s - loss: 0.916 - ETA: 1s - loss: 0.924 - ETA: 0s - loss: 0.931 - ETA: 0s - loss: 0.937 - 12s 772ms/step - loss: 0.9432 - val_loss: 0.7734\n",
      "\n",
      "Epoch 00022: val_loss did not improve from 0.52962\n",
      "Epoch 23/30\n",
      "15/15 [==============================] - ETA: 9s - loss: 0.234 - ETA: 9s - loss: 0.384 - ETA: 8s - loss: 0.494 - ETA: 7s - loss: 0.548 - ETA: 7s - loss: 0.684 - ETA: 6s - loss: 0.769 - ETA: 5s - loss: 0.832 - ETA: 4s - loss: 0.881 - ETA: 4s - loss: 0.923 - ETA: 3s - loss: 0.951 - ETA: 2s - loss: 0.967 - ETA: 2s - loss: 0.976 - ETA: 1s - loss: 0.987 - ETA: 0s - loss: 0.992 - ETA: 0s - loss: 0.996 - 11s 754ms/step - loss: 1.0001 - val_loss: 0.7179\n",
      "\n",
      "Epoch 00023: val_loss did not improve from 0.52962\n",
      "Epoch 00023: early stopping\n",
      "1/1 [==============================] - ETA: 0s - loss: 0.920 - 1s 1s/step - loss: 0.9203\n",
      "Val Score:  0.9203376770019531\n",
      "====================================================================================\n",
      "\n",
      "\n",
      "Computation time :  15.151 min\n"
Lafnoune Imane's avatar
Lafnoune Imane committed
634
635
636
637
     ]
    }
   ],
   "source": [
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
    "from time import time\n",
    "from processing.models import fit_and_evaluate\n",
    "t0 = time()\n",
    "n_folds = 3\n",
    "epochs = 30\n",
    "batch_size = 8\n",
    "\n",
    "\n",
    "#save the model history in a list after fitting so that we can plot later\n",
    "model_history = [] \n",
    "\n",
    "for i in range(n_folds):\n",
    "    print(\"Training on Fold: \",i+1)\n",
    "    \n",
    "    new_model = efn.EfficientNetB1(weights='imagenet',include_top=False)\n",
    "\n",
    "    input_channel = 4\n",
    "    config = new_model.get_config()\n",
    "    config[\"layers\"][0][\"config\"][\"batch_input_shape\"] = (None, 240, 240, input_channel)\n",
    "    modify_name = config[\"layers\"][1][\"config\"][\"name\"]\n",
    "    custom_model = Model.from_config(config)\n",
    "\n",
    "    model = create_transfer_learning(new_model,custom_model,modify_name, input_channel,weights=True)\n",
    "    opt = Adam(lr=1e-3, decay=1e-3 / 200)\n",
    "    model.compile(loss=\"mean_squared_error\", optimizer=opt)\n",
    "    t_x, val_x, t_y, val_y = custom_shuffle_split(trainAttrX ,trainImagesX,trainY,test_size = 0.1)    \n",
    "    model_history.append(fit_and_evaluate(t_x, val_x, t_y, val_y, epochs, batch_size,model,es,cp))\n",
    "    print(\"=======\"*12, end=\"\\n\\n\\n\")\n",
    "\n",
    "print(\"Computation time : \", round((time() - t0)/60,3), \"min\")"
Lafnoune Imane's avatar
Lafnoune Imane committed
668
669
670
671
   ]
  },
  {
   "cell_type": "code",
672
   "execution_count": 13,
Lafnoune Imane's avatar
Lafnoune Imane committed
673
674
675
676
   "metadata": {},
   "outputs": [
    {
     "data": {
677
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEICAYAAAC+iFRkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAABoBElEQVR4nO2dd3gc1fWw37vqvfdiWXKVq2y5gy2bZmNCb6YakhgIJIT8IED4EgipECBAIAndVBM6poONsQ223AuW3GRZltV7WXVp7/fH7Mqy6u5qm6T7Ps8+kmbuzJzRSmfPnCqklCgUCoVieKNztgAKhUKhsD9K2SsUCsUIQCl7hUKhGAEoZa9QKBQjAKXsFQqFYgSglL1CoVCMAJSyVyiGEEKIlUKI750th2LooZS9wqkIIfKEEGc7Ww5rEEJkCCEMQgh9t9c8Z8umUHTH3dkCKBRDnCIpZbyzhVAoBkJZ9gqXRAjhJYR4U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ZoDPBiZYeo7houwHHIo+FJFSFhq/lgEfor3JQ51So1/V5F8tc7I8g0ZKWWr8ZzSgjd0cUu+T0Q/8PvCmlPID4+Yh+z71dj9D/T0yIaWsATYA89Dme7sbdw2o84aLsh9wKPpQQwjhZwwwIYTwA84FDvR/1JBgLXCj8fsbgY+dKItNMClFI5cwhN4nY/DvJeCglPKJLruG5PvU1/0M8fcoQggRbPzeBy0R5SCa0r/cuGzA92hYZOMAGFOpngTcgJellH9xrkSDQwiRjGbNA7gDbw21exJCrEEbRh8OlAIPAh8B7wCJaK2sr5RSDpmAZx/3lIHmHpBAHnBLF3+3SyOEOAPYDPwIGIybf4fm5x5y71M/97OCofseTUULwLqhGejvSCkfNuqIt4FQYA9wnZSypc/zDBdlr1AoFIq+GS5uHIVCoVD0g1L2CoVCMQJQyl6hUChGAErZKxQKxQhAKXuFQqEYAShlr1AoFCMApewVCoViBPD/AbbGXTxgiGytAAAAAElFTkSuQmCC\n",
Lafnoune Imane's avatar
Lafnoune Imane committed
678
679
680
681
682
683
684
685
686
687
688
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
689
    "import matplotlib.pyplot as plt \n",
Lafnoune Imane's avatar
Lafnoune Imane committed
690
    "\n",
691
692
693
694
695
696
    "plt.title('Loss vs Epochs')\n",
    "plt.plot(model_history[0].history['loss'], label='Training Fold 1')\n",
    "plt.plot(model_history[1].history['loss'], label='Training Fold 2')\n",
    "plt.plot(model_history[2].history['loss'], label='Training Fold 3')\n",
    "plt.legend()\n",
    "plt.show()"
Lafnoune Imane's avatar
Lafnoune Imane committed
697
698
699
700
701
702
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
703
704
705
706
707
708
709
710
711
712
713
714
715
716
    "# F - Postprocessing : Evaluation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "from keras.models import load_model\n",
    "from efficientnet.tfkeras import EfficientNetB1\n",
    "\n",
    "model = None\n",
    "model = load_model('clean_notebooks/cnn_transfer_learning_weights.h5')"
Lafnoune Imane's avatar
Lafnoune Imane committed
717
718
719
720
   ]
  },
  {
   "cell_type": "code",
721
   "execution_count": 10,
Lafnoune Imane's avatar
Lafnoune Imane committed
722
723
724
725
726
727
728
729
   "metadata": {},
   "outputs": [],
   "source": [
    "from postprocessing.evaluate import evaluate_cnn, compute_score"
   ]
  },
  {
   "cell_type": "code",
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def evaluate_cnn(model,df, trainImagesX, trainY,sc):\n",
    "    logging.info(\"predicting ...\")\n",
    "    preds = model.predict(trainImagesX)\n",
    "    diff = preds.flatten() - trainY\n",
    "    percentDiff = (diff / (trainY)) * 100\n",
    "    absPercentDiff = np.abs(percentDiff)\n",
    "    mean = np.mean(absPercentDiff)\n",
    "    std = np.std(absPercentDiff)\n",
    "    print(\"avg. FVC: {}, std FVC {}\".format(df[\"FVC\"].mean(), df[\"FVC\"].std()))\n",
    "    print(\"mean difference : {:.2f}%, std: {:.2f}%\".format(mean, std))\n",
    "    return preds,diff"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
Lafnoune Imane's avatar
Lafnoune Imane committed
750
751
752
753
754
755
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
756
757
      "INFO:predicting ...\n",
      "INFO:NumExpr defaulting to 8 threads.\n"
Lafnoune Imane's avatar
Lafnoune Imane committed
758
759
760
761
762
763
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
764
765
      "avg. FVC: 2772.7329545454545, std FVC 835.8620202226257\n",
      "mean difference : 100.37%, std: 10.44%\n"
Lafnoune Imane's avatar
Lafnoune Imane committed
766
     ]
767
768
769
770
771
772
773
774
775
776
    },
    {
     "data": {
      "text/plain": [
       "1.0000517762438685"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
Lafnoune Imane's avatar
Lafnoune Imane committed
777
778
779
    }
   ],
   "source": [
780
781
    "preds_train,diff = evaluate_cnn(model, df, trainImagesX, trainY, sc)\n",
    "np.sqrt(np.mean(diff*diff))"
Lafnoune Imane's avatar
Lafnoune Imane committed
782
783
784
785
   ]
  },
  {
   "cell_type": "code",
786
   "execution_count": 13,
Lafnoune Imane's avatar
Lafnoune Imane committed
787
788
789
790
791
792
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
793
      "5/5 [==============================] - ETA: 15s - loss: 0.82 - ETA: 7s - loss: 1.0142 - ETA: 4s - loss: 0.947 - ETA: 2s - loss: 1.012 - ETA: 0s - loss: 1.000 - 12s 2s/step - loss: 1.0001\n"
Lafnoune Imane's avatar
Lafnoune Imane committed
794
795
796
797
798
     ]
    },
    {
     "data": {
      "text/plain": [
799
       "1.0001035928726196"
Lafnoune Imane's avatar
Lafnoune Imane committed
800
801
      ]
     },
802
     "execution_count": 13,
Lafnoune Imane's avatar
Lafnoune Imane committed
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.evaluate(trainImagesX, trainY)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Test set"
   ]
  },
  {
   "cell_type": "code",
820
   "execution_count": 14,
Lafnoune Imane's avatar
Lafnoune Imane committed
821
822
823
824
825
826
827
828
829
830
831
832
833
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:predicting ...\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
834
835
      "avg. FVC: 2772.7329545454545, std FVC 835.8620202226257\n",
      "mean difference : 100.72%, std: 3.12%\n"
Lafnoune Imane's avatar
Lafnoune Imane committed
836
837
838
839
     ]
    }
   ],
   "source": [
840
    "preds,diff = evaluate_cnn(model, df, testImagesX, testY, sc)"
Lafnoune Imane's avatar
Lafnoune Imane committed
841
842
843
844
   ]
  },
  {
   "cell_type": "code",
845
   "execution_count": 15,
Lafnoune Imane's avatar
Lafnoune Imane committed
846
847
848
849
850
851
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
852
      "2/2 [==============================] - ETA: 2s - loss: 0.802 - ETA: 0s - loss: 0.814 - 3s 365ms/step - loss: 0.8140\n"
Lafnoune Imane's avatar
Lafnoune Imane committed
853
854
855
856
857
     ]
    },
    {
     "data": {
      "text/plain": [
858
       "0.8139927387237549"
Lafnoune Imane's avatar
Lafnoune Imane committed
859
860
      ]
     },
861
     "execution_count": 15,
Lafnoune Imane's avatar
Lafnoune Imane committed
862
863
864
865
866
867
868
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.evaluate(testImagesX, testY)"
   ]
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# G - Postprocessing : Competition score"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Dropout 0.5"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Train set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "from postprocessing.dropout_predictions import create_dropout_predict_function\n",
    "import tensorflow as tf\n",
    "import matplotlib.pyplot as plt\n",
    "from postprocessing.evaluate import compute_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(140, 240, 240, 4)"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trainImagesX.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(36, 240, 240, 4)"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "testImagesX.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<tf.Tensor 'input_2_2:0' shape=(None, 240, 240, 4) dtype=float32>]\n"
     ]
    }
   ],
   "source": [
    "tf.compat.v1.disable_eager_execution()\n",
    "\n",
    "dropout = 0.5\n",
    "num_iter = 20\n",
    "input_data = trainImagesX\n",
    "input_data = np.asarray(input_data).reshape(140,240,240,4)\n",
    "num_samples = input_data.shape[0]\n",
    "\n",
    "predict_with_dropout = create_dropout_predict_function(model, dropout)\n",
    "\n",
    "predictions = np.zeros((num_samples, num_iter))\n",
    "for i in range(num_iter):\n",
    "    predictions[:,i] = predict_with_dropout([input_data,1])[0].reshape(-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "FVC_pred = sc.inverse_transform(predictions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAANy0lEQVR4nO3df4xlZ13H8fdHFlB+xLbuuNa261QsmEKkNGOtqRJ+iS0lFBJj2hCosckSAwqGaBZIFP8rClRNtLrQ2qq1iFCkAUTqSiQkUtzW0m4ptRUW2GbbXcJPNQEKX/+4Z8PNMLNzZ+6dufPdvF/Jzb3nOefe83322f3smeeecyZVhSSpnx+YdwGSpI0xwCWpKQNckpoywCWpKQNckprasZU727lzZy0uLm7lLiWpvTvuuONLVbWwvH1LA3xxcZEDBw5s5S4lqb0kn1+p3SkUSWrKAJekpgxwSWrKAJekpgxwSWrKAJekpgxwSWrKAJekpgxwSWpqS6/E1Pos7v3gTD/v0NWXzvTzJM2XR+CS1JQBLklNGeCS1JQBLklNGeCS1JQBLklNGeCS1JQBLklNGeCS1JQBLklNGeCS1NSaAZ7krCQfTfLpJPcmee3Q/uYkDyW5a3i8aPPLlSQdN8nNrB4FXl9VdyZ5MnBHktuGdddU1Vs3rzxJ0mrWDPCqOgIcGV5/I8l9wBmbXZgk6cTWdTvZJIvAs4DbgYuA1yR5JXCA0VH6V1Z4zx5gD8Du3bunrXdmZn2rVvB2rZK21sRfYiZ5EvBe4HVV9XXgWuApwHmMjtDfttL7qmpfVS1V1dLC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X8TCjy/U7OBs4BvzVMCX0ziRPBHZV1ZFhm4eBXXOrcJ2q6iFGRwlfYBTcXwPuoO8YjVttXFa6PUS3/v068E/D67b9SXIZ8FBVfWrZqq59eirwi8P0478l+dmhfar+zCXAk7wYOFpVd8xj/5tgB3A+cG1VPQv4X5ZNl9TofM0252wO88KXMfrP6ceBJ7LCj7nddRuXE0nyJuBR4KZ51zKNJE8A3gj83rxrmaEdwGnAhcDvAO8eZh2mMq8j8IuAlyQ5xOguhs9jNId8yvDjOvS6NP8wcLiqbh+W38Mo0B85/uPd8Hx0lfdvRy8APldVx6rq28AtjMat6xiNW21c2t4eIsmvAS8GXl7fu7ija3+ewujA4VNDRpwJ3Jnkx+jbp8PALcPUzycZzTzsZMr+zCXAq+oNVXVmVS0ymsD/16p6OfBR4FeGza4E3j+P+tarqh4GvpjkaUPT84FPM7q1wJVDW5v+DL4AXJjkCcORwvE+tRyjZVYbl1uBVw5nOlwIfG1sqmXbSnIxo+nIl1TV/42tuhW4PMnjk5zN6Iu/T86jxvWoqnuq6keranHIiMPA+cO/s5ZjBPwj8FyAJE8FHsfojoTTjVFVzfUBPAf4wPD6J4fiHwT+AXj8vOtbRz/OAw4Adw+DdSqjef39wAPAvwCnzbvOdfbpD4DPAAeBvwEe322MgJsZzeF/m1EQXLXauABh9EtK/hu4h9EZOHPvwwT9eZDRPOpdw+MvxrZ/09Cf+4FL5l3/pH1atv4QsLP5GD0O+Nvh39KdwPNmMUZeSi9JTc37PHBJ0gYZ4JLUlAEuSU0Z4JLUlAEuSU0Z4JLUlAEuSU39P7b965r0DOiBAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist(np.std(FVC_pred, axis = 1), bins=15)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image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nNO95uPABd305cBbt3p8XS2/AJwN3AAMR9q3zRhXGfeq42jhAbwIeAFwaKTtfcDubnr3yL/XdX8fW3+4Bj6BqvrWyNOnAD/Y87sL+GgtuQk4KckzgFcAB6rq0ar6L+AAsLOb97SquqmW/mV9FHjtpg1kFVV1fVU93j29iaVj+mFpfB+rqu9W1deAe1m6hMKKl1Ho/pp4KXB19/qP8CQYH0BV3VlVK50FvG3GuIqmL3lRVTcCjy5r3sXS5w5P/PzX9X3c8OI3gQE+oSTvSfIN4PXAu7vmlS4ncPqY9iMrtD+ZvIWltRhY//h+Bvjvkf8MnozjW267j3G1cbTstKp6sJt+CDitm17v77J5G34qfSuSfBZ4+gqz9lTVp6pqD7AnyaXA24DLNrXAGY0bX9dnD/A4cOVm1taXScao7aWqKsmP7LHQBninql4+YdcrgX9iKcBXu5zAA8CLl7Xf0LWfsUL/DTdufEneBLwaeFm3eQfWvlzCSu3/ydKfrTu6NdRNvbzCOn6Ho5oa4xS24yUvHk7yjKp6sNtEcrRrX+/3sXluQplAkrNGnu4C7uqmrwXe2O39Phf4Zven3WeA85Kc3O0hPw/4TDfvW0nO7balvhHY8jXDJDuBS4DXVNV3RmZdC1yQ5IQkZwJnsbQTdsXLKHTB/3ngdd3rL+JJML4xtvsYt+MlL65l6XOHJ37+6/o+bnbRG2Kr96K28AA+ARwCbgP+ATi9aw9LN7W4D7idJx7d8BaWdojdC7x5pH3Yvdd9wIfozobd4vHdy9I2wlu7x+Uj8/Z0td7NyBEzLO3x/2o3b89I+7NZCsB7gb8DTtjq8XV1/TZL2z6/CzzM0n+o22qMa4x9xXG08ACuAh4Evtf9/i5maT/E54B7gM8Cp3R91/19bP3hqfSS1Cg3oUhSowxwSWqUAS5JjTLAJalRBrgkNcoAl6RGGeCS1Kj/Bzc9tDzGFGzSAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "diff_fvc = (np.mean(FVC_pred,axis=1) - sc.inverse_transform(trainY))\n",
    "diff = (np.mean(predictions,axis=1) - trainY)\n",
    "plt.hist(diff_fvc, bins=30)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  729022.4136899854\n",
      "RMSE :  853.8280937577455\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff_fvc*diff_fvc)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  1.0075450948128797\n",
      "RMSE :  1.0037654580692044\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff*diff)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-22.941164792749078"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "compute_score(trainY,np.mean(FVC_pred,axis=1),np.std(FVC_pred,axis=1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Test set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "input_data = testImagesX\n",
    "input_data = np.asarray(input_data).reshape(36,240,240,4)\n",
    "num_samples = input_data.shape[0]\n",
    "\n",
    "predictions = np.zeros((num_samples, num_iter))\n",
    "for i in range(num_iter):\n",
    "    predictions[:,i] = predict_with_dropout([input_data,1])[0].reshape(-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "FVC_pred = sc.inverse_transform(predictions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAALvUlEQVR4nO3cb4xld13H8ffH3RJkbaztjk1tGacEUkOa9A+TKik2siq2bFMSg9IGDDHoPMHY+idkeeADHpi0iVF8YIybFjXRFhHZYHZjaVNKEIPV3bbobpdVUhbYprA0yJ9qgmz9+uCe6Q6Taefu7r0z3zv7fiWTmTP39Ob76+199+y552yqCklSXz+w2QNIkl6eoZak5gy1JDVnqCWpOUMtSc1tn8aT7ty5sxYWFqbx1JK0JR06dOi5qppb67GphHphYYGDBw9O46klaUtK8qWXesxTH5LUnKGWpOYMtSQ1Z6glqTlDLUnNGWpJam6sy/OSHAe+A7wAnKqqxWkOJUk67Uyuo35zVT03tUkkSWvy1IckNTfuEXUBDyUp4M+qau/qHZIsAUsA8/Pzk5tQGsPCngMTfb7jd++e6PNJ52LcI+o3VdX1wC3Ae5PctHqHqtpbVYtVtTg3t+bt6pKkszBWqKvqmeH7SWAfcMM0h5IknbZuqJPsSHLh8s/AW4DD0x5MkjQyzjnqS4F9SZb3v7+qHpzqVJKkF60b6qp6GrhmA2aRJK3By/MkqTlDLUnNGWpJas5QS1JzhlqSmjPUktScoZak5gy1JDVnqCWpOUMtSc0ZaklqzlBLUnOGWpKaM9SS1JyhlqTmDLUkNWeoJak5Qy1JzRlqSWrOUEtSc4Zakpoz1JLUnKGWpOYMtSQ1Z6glqTlDLUnNGWpJas5QS1JzhlqSmjPUktScoZak5gy1JDU3dqiTbEvyRJL90xxIkvT9zuSI+k7g6LQGkSStbaxQJ7kC2A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yhlqTmDLUkNff/Ae+KTCyZ69QAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist(np.std(FVC_pred, axis = 1), bins=15)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAARYElEQVR4nO3dfaxkd13H8ffH7VKIIgX2Kpt94Ja0GoHweFNrUNOAYB+wq6EkJZG2CNmE0IiJxrSSVK3/UBPFQAnNShvaamixKq5QUldpRf7olrtl+7AtlQVruptqt9vS2ojV1a9/zClOxpmdc+/OfeiP9ys52XN+5zdzvr87cz8798x5SFUhSXr++4G1LkCSNBsGuiQ1wkCXpEYY6JLUCANdkhpx0lpteNOmTTU/P79Wm5ek56V9+/Y9XlVz49atWaDPz8+zuLi4VpuXpOelJP88aZ27XCSpEQa6JDXCQJekRhjoktQIA12SGmGgS1Ijegd6kg1Jvp7kC2PWnZzk5iQHk+xNMj/TKiVJUy3lE/qHgQcnrHs/8GRVnQZ8DLjqRAuTJC1Nr0BPshU4D/j0hC47gOu7+VuAtyXJiZcnSeqr75mifwT8JvDiCeu3AI8AVNWxJE8BLwceH+6UZCewE2D79u3LKFdaHfOXfbFXv4c/et4KVyL1N/UTepJ3Ao9V1b4T3VhV7aqqhapamJsbeykCSdIy9dnl8hbg/CQPAzcBb03yJyN9DgPbAJKcBLwEODrDOiVJU0wN9Kq6vKq2VtU8cCHw5ar65ZFuu4GLu/kLuj7erFSSVtGyr7aY5Epgsap2A9cCNyY5CDzBIPglSato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": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "diff_fvc = (np.mean(FVC_pred,axis=1) - sc.inverse_transform(testY))\n",
    "diff = (np.mean(predictions,axis=1) - testY)\n",
    "plt.hist(diff_fvc, bins=30)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  595801.4519040688\n",
      "RMSE :  771.8817603131122\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff_fvc*diff_fvc)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  0.8234271252510643\n",
      "RMSE :  0.9074288540988017\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff*diff)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-23.79734668732634"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "compute_score(testY,np.mean(FVC_pred,axis=1),np.std(FVC_pred,axis=1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Dropout 0.4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<tf.Tensor 'input_2_3:0' shape=(None, 240, 240, 4) dtype=float32>]\n"
     ]
    }
   ],
   "source": [
    "tf.compat.v1.disable_eager_execution()\n",
    "\n",
    "dropout = 0.4\n",
    "num_iter = 20\n",
    "input_data = trainImagesX\n",
    "input_data = np.asarray(input_data).reshape(140,240,240,4)\n",
    "num_samples = input_data.shape[0]\n",
    "\n",
    "predict_with_dropout = create_dropout_predict_function(model, dropout)\n",
    "\n",
    "predictions = np.zeros((num_samples, num_iter))\n",
    "for i in range(num_iter):\n",
    "    predictions[:,i] = predict_with_dropout([input_data,1])[0].reshape(-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "FVC_pred = sc.inverse_transform(predictions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD7CAYAAABzGc+QAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAANDklEQVR4nO3dbYxlhV3H8e9PqGhpIyDjZuXBwUpqsLHQTAgGY7BUpaUpNDENpGkxkmxfSKSmiVnaF9Z329gHNVHMtiBokFopCClYiysJaWLR2UpgeRJstxaysEPoA9XEFvj74p5Nx2WGOztz717+M99PMpl7zz1z7//M2Xz3zrlPqSokSf38yKwHkCStjwGXpKYMuCQ1ZcAlqSkDLklNGXBJampswJOcluSeJA8neSjJ1cPyjyZ5Ksn9w9c7pj+uJOmQjHseeJLtwPaq+mqS1wN7gUuB9wDfq6qPT31KSdLLHDtuhao6ABwYTj+f5BHglPXc2Mknn1zz8/Pr+VFJ2rL27t37bFXNHb58bMCXSzIPnAPcB5wPXJXk/cAi8KGq+tYr/fz8/DyLi4tHcpOStOUl+cZKy9f8IGaS1wGfBz5YVd8FrgXeAJzN6B76J1b5uR1JFpMsLi0tHenckqRVrCngSV7DKN43VdWtAFX1TFW9WFUvAZ8Gzl3pZ6tqd1UtVNXC3NzL/gKQJK3TWp6FEuA64JGq+uSy5duXrfZuYN/kx5Mk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y4MAfA78PvDSc/0ng28t28GZ9W4AzgCXgL4fDR59JcjywraoODOs8DWyb2YRTUlVPAR8H/otRuL8D7GVr7PdDVtvPW+1tMX4b+IfhdOtt33IBT/JO4GBV7Z31LDNwLPAW4NqqOgf4bw47XFKjpyVtuqcmDcd7L2H0n9hPA8fz8j+zt4zNup/HSfIR4AXgplnPMglbLuDA+cC7kuxn9A6Kb2V0XPiE4U9rWOVtATaBJ4Enq+q+4fwtjIL+zKE/mYfvB2c03zS9Dfh6VS1V1Q+AWxn9W9gK+/2Q1fbzmt4Wo7skvwW8E3hv/fD50623fcsFvKquqapTq2qe0YMX/1xV7wXuAX5zWO0K4PYZjTg1VfU08M0kbxwWXQg8zOgtEK4Ylm3KbWd06OS8JK8dHvM4tO2bfr8vs9p+vgN4//BslPOA7yw71LIpJLmI0WHTd1XV/yy76A7gsiTHJTmD0QO5/zqLGdelqrbsF3AB8IXh9M8y2nFPAH8HHDfr+aa0zWcDi8ADwN8DJzJ6DGAP8DjwT8BJs55zStv+h8CjwD7gr4HjNut+B25mdKz/B4z+8rpytf0MhNGHs/wn8CCjZ+rMfBsmvO1PMDrWff/w9RfL1v/IsO2PAW+f9fxH8uUrMSWpqS13CEWSNgsDLklNGXBJasqAS1JTBlySmjLgktSUAZekpgy4JDX1fwVSsMvBoc4RAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist(np.std(FVC_pred, axis = 1), bins=15)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMA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uZDvrZporYCZw7o/xrXfmJfdovirnGmORtwMXAed2lJdj/dBj9yp9h+lflQ7sz3gNqjLNYVmMc0iDTmiw3TyU5rqp2dZdmdnfl831fLmteuhmTJKf0bF4CPNKtbwIu7z7lPxt4vvtV8k5gdZKjujsBVgN3dnUvJDm7u857OXBAnGUmOR94H/DGqvppT9Um4NJM/6GZk4FTmP5Aue80Gd0PiK8yPS0GTE+TcUCMcT8OhjEOMq3JctM7DUvv92Be78vF7vTYLfWnwa0swOeBrcCDwH8BJ3TlYfoPtDwOPMSv38nxDqY/1NsGvL2nfLLb1+PAdXRPMC/10vXzSWBLt6zvqbum6++j9NwlxPTdDd/r6q7pKf9dpoNyG/A54MVLPb6uX29m+rrsz4GnmP7h29QY5xh/37EshwW4GdgF/F/3PbyS6c9KvgI8BnwZOLprO+/35XJenAJBkhrnpRtJapxBL0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhr3/6T7+aoDk+tkAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "diff_fvc = (np.mean(FVC_pred,axis=1) - sc.inverse_transform(trainY))\n",
    "diff = (np.mean(predictions,axis=1) - trainY)\n",
    "plt.hist(diff_fvc, bins=30)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  722272.5315726864\n",
      "RMSE :  849.866184509471\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff_fvc*diff_fvc)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  0.9982164233068461\n",
      "RMSE :  0.9991078136551861\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff*diff)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-23.839055431706374"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "compute_score(trainY,np.mean(FVC_pred,axis=1),np.std(FVC_pred,axis=1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Test set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "input_data = testImagesX\n",
    "input_data = np.asarray(input_data).reshape(36,240,240,4)\n",
    "num_samples = input_data.shape[0]\n",
    "\n",
    "predictions = np.zeros((num_samples, num_iter))\n",
    "for i in range(num_iter):\n",
    "    predictions[:,i] = predict_with_dropout([input_data,1])[0].reshape(-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "FVC_pred = sc.inverse_transform(predictions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAANY0lEQVR4nO3df6xk5V3H8ffH3bYKxQJyQxDYXmqQpGmMkBtF22JSUJcfslUbA2krWMzGRBT8EbKExPZParVRY1OyFoQqQiOFlEiqILYSk4LehS0sLBRKt+3iwt6WpDTWSFe//jFnzWW698fOnJ2Zx32/kpt75plz53x4OPvJmefOzE1VIUlqz/dNO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iz3iucGcEM3388AF87audKN3wr8xtC+szTn72CwPPL4snPjokme576VXpIaddQtoUjS/xcWuCQ1ygKXpEZZ4JLUKAtckhplgUtSoyxwSWrU/wJX60zzqoA57gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist(np.std(FVC_pred, axis = 1), bins=15)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAARZUlEQVR4nO3df6xkZ13H8ffH7VKNIAX2Cpv9wS2hGsHIr5tSg5oGBEuLXQ0lKYlQELIJsRETjGkhqVj/ARPBQAnNShtbJFAsiEtbgosUgT+6cLduW9pSWbCmu6l0u4WWBiyufv1jTnEcZnbOvXfuj314v5KTPec5z8x8n3tnPnvumfMjVYUk6eT3U+tdgCRpNgx0SWqEgS5JjTDQJakRBrokNeKU9XrhLVu21Pz8/Hq9vCSdlA4cOPBgVc2NW7dugT4/P8/i4uJ6vbwknZSS/Pukde5ykaRGGOiS1AgDXZIaYaBLUiMMdElqhIEuSY3oHehJNiX5lyQ3jFl3apLrkhxKsj/J/EyrlCRNtZQt9LcCd09Y9ybgO1X1bOC9wLtXWpgkaWl6BXqS7cB5wIcmdNkFXNPNXw+8LElWXp4kqa++Z4r+FfAnwJMmrN8G3AdQVceTPAw8DXhwuFOS3cBugJ07dy6jXLVg/pIbe/W7913nrXIlK9fSWHTym7qFnuRVwANVdWClL1ZVe6pqoaoW5ubGXopAkrRMfXa5vAQ4P8m9wMeAlyb525E+R4A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wkCXpEYY6JLUCANdkhphoEtSIwx0SWrE/wLDH+pNp/fwdQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "diff_fvc = (np.mean(FVC_pred,axis=1) - sc.inverse_transform(testY))\n",
    "diff = (np.mean(predictions,axis=1) - testY)\n",
    "plt.hist(diff_fvc, bins=30)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  597280.1900951569\n",
      "RMSE :  772.8390454002417\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff_fvc*diff_fvc)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  0.825470814694578\n",
      "RMSE :  0.9085542442224228\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff*diff)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-23.613854142459918"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "compute_score(testY,np.mean(FVC_pred,axis=1),np.std(FVC_pred,axis=1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Dropout 0.6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<tf.Tensor 'input_2_4:0' shape=(None, 240, 240, 4) dtype=float32>]\n"
     ]
    }
   ],
   "source": [
    "tf.compat.v1.disable_eager_execution()\n",
    "\n",
    "dropout = 0.6\n",
    "num_iter = 20\n",
    "input_data = trainImagesX\n",
    "input_data = np.asarray(input_data).reshape(140,240,240,4)\n",
    "num_samples = input_data.shape[0]\n",
    "\n",
    "predict_with_dropout = create_dropout_predict_function(model, dropout)\n",
    "\n",
    "predictions = np.zeros((num_samples, num_iter))\n",
    "for i in range(num_iter):\n",
    "    predictions[:,i] = predict_with_dropout([input_data,1])[0].reshape(-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [],
   "source": [
    "FVC_pred = sc.inverse_transform(predictions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAQQUlEQVR4nO3dfYxldX3H8fenCz5EsYBMyYaHDirVkCYuZEppfIjFhyJYwdYYibHblGQ1kQSirV01aTFpE2irtE2MZi3ItkHEqgTiQ+sWscSkYmdxWRYWCuKasll2xwcKpA3twrd/3LPtdZg7c2fm3jvzw/cruZlzf/fM3E/OPfPJueeec0+qCklSe35urQNIklbGApekRlngktQoC1ySGmWBS1Kjjprkk51wwgk1PT09yaeUpObt3Lnzh1U1NX98ogU+PT3N7OzsJJ9SkpqX5AcLjbsLRZIaZYFLUqMscElqlAUuSY2ywCWpURa4JDXKApekRlngktQoC1ySGjXRMzGf7aa3fmWkf2/flReM9O9JenZxC1ySGjV0gSfZkOS7Sb7c3T8tyR1JHkxyY5LnjC+mJGm+5WyBXwbs7bt/FXB1Vb0M+AlwySiDSZIWN1SBJzkZuAD4m+5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klmQbOBO5gHa1j83L1W/N1bIFsI1/P1nuBv7qqzqL3jYfvS/La/ger9x5kTY6DTO/kpbcCf98NfRJ4KbAJOEDvbe+aWsvlM0iSjwCHgeu7oQPAqVV1JvB+4LNJXjTBSOvudZvnYn56I2HiyyvJC4EvApdX1WP9j63x/+CCudbDOrZAtrGsZ+u6wKtqf/fzEHATvbcWB4+8Let+HlqjeG8G7qyqg13Gg1X1VFU9DXyaMb3dHsKg5bPmX32Q5HeBtwDv6v7x6d46/qib3klvH+AvTSrTIq/belheRwG/Bdx4ZGzSyyvJ0fSK6Pqq+lI3vObr2IBc62IdWyjbuNazdVvgSV6Q5Jgj0/Q+oNhD73T9zd1sm4Gb1ybhT28ZzdvX9zZ6WdfCoOVzC/A73ZEC5wD/0fc2eOySnAd8EHhrVf1n3/hUet8tT5KXAKcDD00w16DX7RbgnUmem+S0Ltd3JpWr8wbgvqp6+MjAJJdXt//9GmBvVX2876E1XccG5VoP69gi2caznk3ik9mV3ICX0Pt09i7gHuAj3fiLgVuBB4B/Ao5fg2wvAH4E/Hzf2N8BdwO7uxdl4wRy3EDv7dj/0Nt3dsmg5UPvyIBP0Nv6uBuYmXCuB+nt69vV3T7Vzfvb3eu7C7gT+M0J5xr4ugEf6ZbX/cCbJ5mrG78OeO+8eSe5vF5Nb/fI7r7X7fy1XscWybUe1rFB2caynnkqvSQ1at3uQpEkLc4Cl6RGWeCS1CgLXJIaZYFLUqMscElqlAUuSY36X7vMbR/PCAWtAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist(np.std(FVC_pred, axis = 1), bins=15)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb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JXnBPktu0C9SVb1uxKbXA7cyG/TzTRexDThrTvnXu/JjhrRfEguNMcnbgAuBs7tbS7DnKTGGlT/F7J/MK7qr3iUb4yK+hoOWzfjGNMqUJsvNE0mOrKrt3a2ZHV35Yn8elz1v3UxQkhMGNi8CHurWbwYu6V7tPwN4tvuT8nbgnCSHdk8EnAPc3tU9l+SM7l7vJcB+caWZ5FzgfcAbq+pnA1U3Axdn9p/NHA+cwOwLykOnyuh+QXyN2akxYHaqjP1ijPNofXyjTGmy3AxOwTL4+V/Uz+NSd3qv2NevBre0AF8ANgH3A/8FHN2Vh9l/0vIo8AC/+TTHO5h9YW8z8PaB8unuWI8C19C9i3lfL10/Hwc2dsvagboru/4+zMBTQsw+5fD9ru7KgfLfZTYsNwOfB168H4zvzczem/0F8ASzv3ibGd8CYx86juWwADcA24H/675+lzH7OslXgUeArwCHdW0X/fO43BenQJCkxnnrRpIaZ9BLUuMMeklqnEEvSY0z6CWpcQa9JDXOoJekxv0/Upj9DaUXPWEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "diff_fvc = (np.mean(FVC_pred,axis=1) - sc.inverse_transform(trainY))\n",
    "diff = (np.mean(predictions,axis=1) - trainY)\n",
    "plt.hist(diff_fvc, bins=30)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  720099.4399184444\n",
      "RMSE :  848.586730934702\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff_fvc*diff_fvc)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  0.9952131029758183\n",
      "RMSE :  0.9976036803138901\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff*diff)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-21.05299092690639"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "compute_score(trainY,np.mean(FVC_pred,axis=1),np.std(FVC_pred,axis=1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Test set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "input_data = testImagesX\n",
    "input_data = np.asarray(input_data).reshape(36,240,240,4)\n",
    "num_samples = input_data.shape[0]\n",
    "\n",
    "predictions = np.zeros((num_samples, num_iter))\n",
    "for i in range(num_iter):\n",
    "    predictions[:,i] = predict_with_dropout([input_data,1])[0].reshape(-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [],
   "source": [
    "FVC_pred = sc.inverse_transform(predictions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW8AAAD4CAYAAAAjKGdbAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAO0klEQVR4nO3dfaxkdX3H8ffHXZ6lIjJaBW4vbZXEmBToLcVqbQS1IEb6h39gqsVWcxNSrRBTs9Skxv/wIfYhMdqND8VKsRahNW60aIs1JmXp7gq4sFARVlhEWWJ8bCNiv/1jzsq43XvnLMy5c3/X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BS6n+8Q9b0meDHwSuKyqvjf53hNdhzZyee8D9lXV9u71tYzL/FsHPo50Px9a4d+vhZcA91bV/qr6MXAd8ALGH5kOXEC1nr6OYKWxW3dfoZDkdcArgN/vVhJYPzl/hfF/2Lcm2dvl2JXkF1k/GQ/YB1zXfZy/Gfhfxl+qtN5yXsJ4/QH4Rx7bhTO3nEmOYFzcV1fVgWwzW4c2bHlX1TeB+5Oc3k06D7iD8aX9l3TTLgH+eQ7xDrgPOCfJsd3WzIGMNwKv6uaZd8ZJK43dp4A/6I6YnwN8d+Kj4ZpLcj7jfcmvrKr/nnjrU8DFSY5KchrwbODmtc5XVV+pqqdX1WJVLTIuyLO6v9l1NZbAPzE+aEmS5zA+8P8w62QsJ3wD+J3u+bnAV7vncxnPbn3+ELCnqt478dbs1qG1OPI6rwdwBrADuI3xH+FTgacB/8r4l/t54MQ5Z3wHcCewG/g7xkfvf5nxinA3462Io+aQ6xrG++F/zLhcXr/S2DE+Qv4+xmccfAVYmnPOuxnvP7yle3xgYv63dTnvojs7YR4ZD3p/L4+dbbLexvJI4GPd3+cu4Nx5juUqOV/I+HjRrYz3Lf/6PMezy1Nd9xz4O3z5LNchL4+XpAZt2N0mkrSRWd6S1CDLW5IaZHlLUoMsb0lqkOUtSQ2yvCWpQf8Hz8tYfhXjBIcAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist(np.std(FVC_pred, axis = 1), bins=15)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWX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ytV4na+FU7XuaZ4QgV5Vv7aCn3kMeKybP5DBBcd+hsFlDrYPdR2+FMK/JdlaVfd3f7I9cHKV/1BNM4+DE1+6YVz7MQZ/cp7WfUofd6mHuek7piR/Bny2W5x1TBtFn8tobChVdaT794Ekf8lgt9Gk1/lGH9+sdR8Bzh1p/9Ia1Lli7nKZIMlCBteCJ8mzgLOAb3d/sj2S5Jxuf/Prgcc/HQ9fAuGSofb1tBe4OIObkJzJYBxfZcIlHbrvBW5mcAkHWMdxjOx//U3g8SMWZhrTWtY8xUav7/9J8uNJnvz4PPByBs/BpNf5XuD13VEj5wAPD+3i2AhmrfsLwMuTPLXb3ffyrm3jWu9vZdd7YhAUhxl8Gv834Atd+6uBO4GDwK3Arw/9zBKDF/a3gKv4vzNunw78HfBN4G+Bp633OLp17+hqvYfuiJyu/Xzgn7p17xhqfxaDgDwE/AVw+jo9Nx8F7gBuZ/Cm27rSMW2UaaPXN1LrsxgciXNb9154R9c+9nXO4CiRD3Zju4Oho63WofaPM9ht+t/d++JNK6mbwS6+Q930xvV+TqZNnvovSY1wl4skNcJAl6RGGOiS1AgDXZIaYaBLUiMMdElqhIEuSY34X/em7pqBPxjhAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "diff_fvc = (np.mean(FVC_pred,axis=1) - sc.inverse_transform(testY))\n",
    "diff = (np.mean(predictions,axis=1) - testY)\n",
    "plt.hist(diff_fvc, bins=30)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  592639.5397791845\n",
      "RMSE :  769.8308514077521\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff_fvc*diff_fvc)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE :  0.8190572060389354\n",
      "RMSE :  0.9050177932167607\n"
     ]
    }
   ],
   "source": [
    "MSE = np.mean(diff*diff)\n",
    "RMSE = np.sqrt(MSE)\n",
    "print(\"MSE : \",MSE)\n",
    "print(\"RMSE : \", RMSE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-21.401370131357226"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "compute_score(testY,np.mean(FVC_pred,axis=1),np.std(FVC_pred,axis=1))"
   ]
Lafnoune Imane's avatar
Lafnoune Imane committed
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
1841
   "version": "3.7.4"
Lafnoune Imane's avatar
Lafnoune Imane committed
1842
1843
1844
1845
1846
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}