July 2019
Intermediate to advanced
512 pages
19h 39m
English
Next, we'll define our loss function. We'll use softmax cross-entropy as our loss function. TensorFlow provides the tf.nn.softmax_cross_entropy_with_logits() function for computing softmax cross-entropy loss. It takes two parameters as inputs, logits and labels:
We take the mean of the loss function using tf.reduce_mean():
with tf.name_scope('Loss'): loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=y_hat,labels=Y))
Now, we need to minimize the loss using backpropagation. Don't worry! We don't have to calculate the derivatives ...
Read now
Unlock full access