4.4. Define the loss function, optimizer, accuracy, and predicted class

In [15]:
# Define the loss function, optimizer, and accuracy
loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(labels=target, logits=predictions))

# Create a summary to monitor the cost function
tf.summary.scalar("Loss_function",loss)
Out[15]:
<tf.Tensor 'Loss_function:0' shape=() dtype=string>