maxpumperla / deep_learning_and_the_game_of_go

Code and other material for the book "Deep Learning and the Game of Go"
https://www.manning.com/books/deep-learning-and-the-game-of-go
989 stars 390 forks source link

Mismatch between book and implementation #41

Closed cwerner87 closed 5 years ago

cwerner87 commented 5 years ago

I've been reading the book and implementing the code to follow along but I've hit a mismatch between my own runs and the runs reported in the book. Specifically, in chapter 7.3, my accuracy is much lower. The output of 7.22 in the book shows after the first epoch (top of page 168):

Epoch 1/5
12288/12288 ... acc: 0.2834 - val loss: 2.5023 - val_acc: 0.6669

In my implementation it shows:

Epoch 1/5
88/88 [==============================] - 32s 360ms/step - loss: 5.8894 - acc: 0.0023 - val_loss: 5.8884 - val_acc: 0.0025

Furthermore, I tried simply running train_generator.py from this Github and got the same results as my own implementation.

The obvious cause seems to be that the steps per epoch is 12,288 in the book and 88 in my version, so mine is learning hardly anything. I suspect the cause could be:

  1. The downloading of data from KGS has changed and I have fewer records (I don't think this is the case - the generator shows total num games: 179689 which seems fine) or
  2. My versions of the dependencies are different. For reference, I am using Python 3.7.4 and these dependency versions:
Keras==2.2.4
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
tensorflow==1.14.0

Or perhaps there's some reason I'm not seeing. Any help identifying the root cause would be much appreciated.