Regression losses - Keras
keras.io › api › lossesComputes the cosine similarity between labels and predictions. Note that it is a number between -1 and 1. When it is a negative number between -1 and 0, 0 indicates orthogonality and values closer to -1 indicate greater similarity.
Metrics - Keras
keras.io › api › metricsGradientTape as tape: logits = model (x) # Compute the loss value for this batch. loss_value = loss_fn (y, logits) # Update the state of the `accuracy` metric. accuracy. update_state (y, logits) # Update the weights of the model to minimize the loss value. gradients = tape. gradient (loss_value, model. trainable_weights) optimizer. apply ...