Deep Learning, Machine Learning, Artificial Intelligence, Loss Function, Neural Networks.
labels as integers and predicted probabilities as a tensor y_true = tf.constant([1, 2, 0]) y_pred = tf.constant([[0.1, 0.8, 0.1], [0.3, 0.2, 0.5], [0.4, 0.3, 0.3]]) # calculate the loss loss = sparse_categorical_crossentropy(y_true, y_pred) # print the loss print(loss.numpy()) In this