tf.keras.metrics.CosineSimilarity

Computes the cosine similarity between the labels and predictions.

Inherits From: Mean, Metric, Layer, Module

cosine similarity = (a . b) / ||a|| ||b||

See: Cosine Similarity.

This metric keeps the average cosine similarity between predictions and labels over a stream of data.