ragavsachdeva
commited on
Update modelling_magi.py
Browse files- modelling_magi.py +1 -1
modelling_magi.py
CHANGED
@@ -449,7 +449,7 @@ class MagiModel(PreTrainedModel):
|
|
449 |
affinity_matrices = []
|
450 |
for crop_embeddings in crop_embeddings_for_batch:
|
451 |
crop_embeddings = crop_embeddings / crop_embeddings.norm(dim=-1, keepdim=True)
|
452 |
-
affinity_matrix =
|
453 |
affinity_matrices.append(affinity_matrix)
|
454 |
return affinity_matrices
|
455 |
affinity_matrices = []
|
|
|
449 |
affinity_matrices = []
|
450 |
for crop_embeddings in crop_embeddings_for_batch:
|
451 |
crop_embeddings = crop_embeddings / crop_embeddings.norm(dim=-1, keepdim=True)
|
452 |
+
affinity_matrix = crop_embeddings @ crop_embeddings.T
|
453 |
affinity_matrices.append(affinity_matrix)
|
454 |
return affinity_matrices
|
455 |
affinity_matrices = []
|