Use sum instead of mean in cosine_proximity
@@ -71,7 +71,7 @@ def poisson(y_true, y_pred):
def cosine_proximity(y_true, y_pred):
y_true = K.l2_normalize(y_true, axis=-1)
y_pred = K.l2_normalize(y_pred, axis=-1)
- return -K.mean(y_true * y_pred, axis=-1)
+ return -K.sum(y_true * y_pred, axis=-1)
# Aliases.
