nfmcclure / tensorflow_cookbook

Code for Tensorflow Machine Learning Cookbook
https://www.packtpub.com/big-data-and-business-intelligence/tensorflow-machine-learning-cookbook-second-edition
MIT License
6.24k stars 2.41k forks source link

chap06 04update - notebook setup and reproducibility #60

Closed jimthompson5802 closed 7 years ago

jimthompson5802 commented 7 years ago

@nfmcclure before you merge this into your master you should review the results. When I set up the code for reproducibility as in the book,

seed = 2
tf.set_random_seed(seed)
np.random.seed(seed)  

the resulting training and test loss values and plot do not match the one in the book. See below. I played around with some other values for seed, seed=29 provides a better look but still not exactly in the book. I suspect there may have been a change in how tf.set_random_seed() function worked from the time you initially wrote the code to how that function behaves in TF 1.0.1. Is there another seed value you'd like me to try?

screen shot 2017-04-15 at 07 49 54
nfmcclure commented 7 years ago

Hi @jimthompson5802 .

Thanks for these notes. I suspect you are correct about the functionality of the random seed in TF. It's probably ok. I'll add a note in the writeup about how results may vary. Thanks for this!