layer' outputs and the current layer' weightsand add the bias to these values at the last hidden layerwe will apply dropout operation using our keep_prob value of the final step in building the graph is to define the loss function that we want to optimize popular choice of loss function in tensorflow programs is cross-entropyalso known as log-losswhich quantifies the difference between two probability distributions (the predictions and the labelsa perfect classification would result in cross-entropy of with the loss completely minimized we also need to choose the optimization algorithm which will be used to minimize the loss function process named gradient descent optimization is common method for finding the (localminimum of function by taking iterative steps along the gradient in negative (descendingdirection there are several choices of gradient descent optimization algorithms already implemented in tensorflowand in this tutorial we will be using the adam optimizer this extends upon gradient descent optimization by using momentum to speed up the process through computing an exponentially weighted average of the gradients and using that in the adjustments add the following code to your filemain py cross_entropy tf reduce_meantf nn softmax_cross_entropy_with_logitslabels=ylogits=output_layer )