Last active
April 8, 2023 20:43
-
-
Save doleron/a60f53e06051a9a6ae8f4900c85dab53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tensorflow.keras import backend as K | |
def euclidean_distance(x, y): | |
sum_square = K.sum(K.square(x - y), axis=1, keepdims=True) | |
return K.sqrt(K.maximum(sum_square, K.epsilon())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment