August 2018
Intermediate to advanced
272 pages
7h 2m
English
Once we have retrieved the data and built the graph, we can start our main training loop, which will continue over 20,000 iterations. In every iteration, a batch of training data is taken using the CPU device, and the __train_step.run method of the AdamOptimizer object is called to run one forward and one backward pass. Every 100 iterations, we run a forward pass over the current training and testing batch to collect training and validation loss, and other summary data. Then, the add_summary method of the FileWriter object wraps the provided TensorFlow summaries: summary_1 and summary_2 in an event protocol buffer and adds it to the event file:
# Train Loop for i in range(20000): batch_train = self.__session.run([iter_train_op]) ...
Read now
Unlock full access