Skip to content

Commit

Permalink
test ch13 on Tf 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
rasbt committed Jul 24, 2018
1 parent ef6c60f commit 8c9237b
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 153 deletions.
235 changes: 101 additions & 134 deletions code/ch13/ch13.ipynb

Large diffs are not rendered by default.

31 changes: 12 additions & 19 deletions code/ch13/ch13.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@
import struct
import tensorflow.contrib.keras as keras

# NOTE:
# ================================================
# If you have TensorFlow >= v1.4 installed
# you can use the keras API directly instead
# of importing it from the contrib module
# for instance, in this code cell, you can skip
# the import, and following code cells,
# you can use
# `tf.keras.utils.to_categorical(y_train)`
# instead of `keras.utils.to_categorical(y_train)`
# and so forth.



# *Python Machine Learning 2nd Edition* by [Sebastian Raschka](https://sebastianraschka.com) and Vahid Mirjalili, Packt Publishing Ltd. 2017
#
# Code Repository: https://github.com/rasbt/python-machine-learning-book-2nd-edition
Expand Down Expand Up @@ -479,6 +465,18 @@ def create_batch_generator(X, y, batch_size=128, shuffle=False):



# NOTE:
# ================================================
# If you have TensorFlow >= v1.4 installed
# you can use the keras API directly instead
# of importing it from the contrib module
# for instance, in this code cell, you can skip
# the import, and following code cells,
# you can use
# `tf.keras.utils.to_categorical(y_train)`
# instead of `keras.utils.to_categorical(y_train)`
# and so forth.

np.random.seed(123)
tf.set_random_seed(123)

Expand Down Expand Up @@ -682,8 +680,3 @@ def tanh(z):








0 comments on commit 8c9237b

Please sign in to comment.