|
38 | 38 | "os.environ['TF_DETERMINISTIC_OPS'] = '1'"
|
39 | 39 | ]
|
40 | 40 | },
|
| 41 | + { |
| 42 | + "cell_type": "markdown", |
| 43 | + "metadata": {}, |
| 44 | + "source": [ |
| 45 | + "<h2>Experiment 1: run model without fully-connected layers</h2>" |
| 46 | + ] |
| 47 | + }, |
| 48 | + { |
| 49 | + "cell_type": "markdown", |
| 50 | + "metadata": {}, |
| 51 | + "source": [ |
| 52 | + "<h3>1. Initialize the model</h3>" |
| 53 | + ] |
| 54 | + }, |
41 | 55 | {
|
42 | 56 | "cell_type": "markdown",
|
43 | 57 | "metadata": {},
|
|
121 | 135 | "vgg_conv.summary()"
|
122 | 136 | ]
|
123 | 137 | },
|
| 138 | + { |
| 139 | + "cell_type": "markdown", |
| 140 | + "metadata": {}, |
| 141 | + "source": [ |
| 142 | + "<h3>2. Prepare the training data</h3>" |
| 143 | + ] |
| 144 | + }, |
124 | 145 | {
|
125 | 146 | "cell_type": "markdown",
|
126 | 147 | "metadata": {},
|
|
180 | 201 | "cell_type": "markdown",
|
181 | 202 | "metadata": {},
|
182 | 203 | "source": [
|
183 |
| - "Let's explore the train dataset:" |
| 204 | + "<h3>3. Visualize the training dataset</h3>" |
184 | 205 | ]
|
185 | 206 | },
|
186 | 207 | {
|
|
237 | 258 | "plt.title(\"Class name: {}\".format(classes_list[train_image_label_id]))"
|
238 | 259 | ]
|
239 | 260 | },
|
| 261 | + { |
| 262 | + "cell_type": "markdown", |
| 263 | + "metadata": {}, |
| 264 | + "source": [ |
| 265 | + "<h3>4. Obtain model predictions on the train data</h3>" |
| 266 | + ] |
| 267 | + }, |
240 | 268 | {
|
241 | 269 | "cell_type": "markdown",
|
242 | 270 | "metadata": {},
|
|
272 | 300 | "print(\"Train features: {}\".format(train_features_vec.shape))"
|
273 | 301 | ]
|
274 | 302 | },
|
| 303 | + { |
| 304 | + "cell_type": "markdown", |
| 305 | + "metadata": {}, |
| 306 | + "source": [ |
| 307 | + "<h3>5. Prepare the validation data</h3>" |
| 308 | + ] |
| 309 | + }, |
275 | 310 | {
|
276 | 311 | "cell_type": "code",
|
277 | 312 | "execution_count": 9,
|
|
298 | 333 | " shuffle=False)"
|
299 | 334 | ]
|
300 | 335 | },
|
| 336 | + { |
| 337 | + "cell_type": "markdown", |
| 338 | + "metadata": {}, |
| 339 | + "source": [ |
| 340 | + "<h3>6. Visualize the validation dataset</h3>" |
| 341 | + ] |
| 342 | + }, |
301 | 343 | {
|
302 | 344 | "cell_type": "code",
|
303 | 345 | "execution_count": 10,
|
|
352 | 394 | "plt.title(\"Class name: {}\".format(classes_list[val_image_label_id]))"
|
353 | 395 | ]
|
354 | 396 | },
|
| 397 | + { |
| 398 | + "cell_type": "markdown", |
| 399 | + "metadata": {}, |
| 400 | + "source": [ |
| 401 | + "<h3>7. Obtain model predictions on the validation data</h3>" |
| 402 | + ] |
| 403 | + }, |
355 | 404 | {
|
356 | 405 | "cell_type": "code",
|
357 | 406 | "execution_count": 11,
|
|
383 | 432 | "cell_type": "markdown",
|
384 | 433 | "metadata": {},
|
385 | 434 | "source": [
|
386 |
| - "Create your own model and train the network:" |
| 435 | + "<h2>Experiment 2: Create your own model and train the network</h2>" |
| 436 | + ] |
| 437 | + }, |
| 438 | + { |
| 439 | + "cell_type": "markdown", |
| 440 | + "metadata": {}, |
| 441 | + "source": [ |
| 442 | + "<h3>1. Configure and train the model</h3>" |
387 | 443 | ]
|
388 | 444 | },
|
389 | 445 | {
|
|
458 | 514 | " validation_data=(validation_features_vec,validation_labels))"
|
459 | 515 | ]
|
460 | 516 | },
|
| 517 | + { |
| 518 | + "cell_type": "markdown", |
| 519 | + "metadata": {}, |
| 520 | + "source": [ |
| 521 | + "<h3>2. Show the errors</h3>" |
| 522 | + ] |
| 523 | + }, |
461 | 524 | {
|
462 | 525 | "cell_type": "code",
|
463 | 526 | "execution_count": 13,
|
|
514 | 577 | "print(\"Number of errors = {}/{}\".format(len(errors),nVal))"
|
515 | 578 | ]
|
516 | 579 | },
|
517 |
| - { |
518 |
| - "cell_type": "markdown", |
519 |
| - "metadata": {}, |
520 |
| - "source": [ |
521 |
| - "Let us see which images were predicted wrongly:" |
522 |
| - ] |
523 |
| - }, |
524 | 580 | {
|
525 | 581 | "cell_type": "code",
|
526 | 582 | "execution_count": 16,
|
|
0 commit comments