|
11 | 11 | import struct
|
12 | 12 | import tensorflow.contrib.keras as keras
|
13 | 13 |
|
14 |
| -# NOTE: |
15 |
| -# ================================================ |
16 |
| -# If you have TensorFlow >= v1.4 installed |
17 |
| -# you can use the keras API directly instead |
18 |
| -# of importing it from the contrib module |
19 |
| -# for instance, in this code cell, you can skip |
20 |
| -# the import, and following code cells, |
21 |
| -# you can use |
22 |
| -# `tf.keras.utils.to_categorical(y_train)` |
23 |
| -# instead of `keras.utils.to_categorical(y_train)` |
24 |
| -# and so forth. |
25 |
| - |
26 |
| - |
27 |
| - |
28 | 14 | # *Python Machine Learning 2nd Edition* by [Sebastian Raschka](https://sebastianraschka.com) and Vahid Mirjalili, Packt Publishing Ltd. 2017
|
29 | 15 | #
|
30 | 16 | # Code Repository: https://github.com/rasbt/python-machine-learning-book-2nd-edition
|
@@ -479,6 +465,18 @@ def create_batch_generator(X, y, batch_size=128, shuffle=False):
|
479 | 465 |
|
480 | 466 |
|
481 | 467 |
|
| 468 | +# NOTE: |
| 469 | +# ================================================ |
| 470 | +# If you have TensorFlow >= v1.4 installed |
| 471 | +# you can use the keras API directly instead |
| 472 | +# of importing it from the contrib module |
| 473 | +# for instance, in this code cell, you can skip |
| 474 | +# the import, and following code cells, |
| 475 | +# you can use |
| 476 | +# `tf.keras.utils.to_categorical(y_train)` |
| 477 | +# instead of `keras.utils.to_categorical(y_train)` |
| 478 | +# and so forth. |
| 479 | + |
482 | 480 | np.random.seed(123)
|
483 | 481 | tf.set_random_seed(123)
|
484 | 482 |
|
@@ -682,8 +680,3 @@ def tanh(z):
|
682 | 680 |
|
683 | 681 |
|
684 | 682 |
|
685 |
| - |
686 |
| - |
687 |
| - |
688 |
| - |
689 |
| - |
0 commit comments