How it works...

Steps 1 through 4 are, in a way, the default way to launch a new TensorFlow session. In step 4, the variables of weights and biases are initialized, which is mandatory before their optimization. Step 5 is primarily to execute the TensorFlow session for optimization. As we have a large number of training images, it becomes highly difficult (computationally) to calculate the optimum gradient taking all the images at once into the optimizer.

Hence, a small random sample of 128 images is selected to train the activation layer (weights and biases) in each iteration. In the current setup, we run 100 iterations and report training accuracy for every tenth iteration.

However, these can be increased based on the cluster configuration or computational power (CPU or GPU) to obtain higher model accuracy. In addition, a 50% dropout rate is used to train the CNN in each iteration. In step 6, we can evaluate the performance of the trained model on a test data of 10,000 images.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset