we've now defined the network and built it out with tensorflow the next step is to feed data through the graph to train itand then test that it has actually learnt something step -training and testing the training process involves feeding the training dataset through the graph and optimizing the loss function every time the network iterates through batch of more training imagesit updates the parameters to reduce the loss in order to more accurately predict the digits shown the testing process involves running our testing dataset through the trained graphand keeping track of the number of images that are correctly predictedso that we can calculate the accuracy before starting the training processwe will define our method of evaluating the accuracy so we can print it out on mini-batches of data while we train these printed statements will allow us to check that from the first iteration to the lastloss decreases and accuracy increasesthey will also allow us to track whether or not we have ran enough iterations to reach consistent and optimal resultmain py correct_pred tf equal(tf argmax(output_layer )tf argmax( )accuracy tf reduce_mean(tf cast(correct_predtf float )in correct_predwe use the arg_max function to compare which images are being predicted correctly by looking at the output_layer