nlintz / TensorFlow-Tutorials

Simple tutorials using Google's TensorFlow Framework
6k stars 1.52k forks source link

Please help me with understanding of 04_modern_net.py #75

Closed ruzrobert closed 7 years ago

ruzrobert commented 7 years ago

Hello! @nlintz , your TensorFlow tutorials are very good, and they are also compact, comparing to other Tutorials/Examples on github.

But I need some help with understanding of 4 modern net. Please help me understand these lines:

  1. 30 line: w_h = init_weights([784, 625]) So, 784 is 28x28, which is flatten image data array. But what is 625 ? We also have next line: w_h2 = init_weights([625, 625]) Is 625 something related to batches/hidden layer units ?

  2. 47 line: for i in range(100): What is 100 in that line? Is that epoches count ?

  3. 48 line: for start, end in zip(range(0, len(trX), 128), range(128, len(trX)+1, 128)): Cannot understand how that is working at all. Could you please explain what we are doing here? Is that 128 - batch size ? What range of mnist.train.images we are taking? All 55k ?

Thank you!

I hope to get an answer

ruzrobert commented 7 years ago

Okay, so I figured out, that for

  1. yes, it is epoches count
  2. yes, 128 is batch size, and range is length of trX, which is 55 000.

But I still don't know what 625 in the first question is. And thoughts? Hidden layer connection count / units count ?

hunkim commented 7 years ago

625 is something arbitrary.

w_h = init_weights([784, XXX]) #784 input w_h2 = init_weights([XXX, YYY]) w_h3 = init_weights([YYY, ZZZ]) w_h4 = init_weights([ZZZ, 1]) # one output

The input and output are fixed, but others are your hyperparameters.

ruzrobert commented 7 years ago

Okay, so looks like this is something like hidden layer units count. Thank you!