Skip to content

Commit

Permalink
Merge branch 'master' into more-distrib-tests-updatest
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdev-5 committed Mar 20, 2024
2 parents d4604e5 + 3d8f3ec commit a368fd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/ignite/metrics/test_cosine_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def update(engine, i):
y_true_np = y_true.cpu().numpy()
y_preds_np = y_preds.cpu().numpy()
y_true_norm = np.clip(np.linalg.norm(y_true_np, axis=1, keepdims=True), 1e-8, None)
y_preds_norm = np.clip(np.linalg.norm(y_preds, axis=1, keepdims=True), 1e-8, None)
y_preds_norm = np.clip(np.linalg.norm(y_preds_np, axis=1, keepdims=True), 1e-8, None)
true_res = np.sum((y_true_np / y_true_norm) * (y_preds_np / y_preds_norm), axis=1)
true_res = np.mean(true_res)

Expand Down

0 comments on commit a368fd8

Please sign in to comment.