Skip to content

Commit

Permalink
Merge branch 'save-embeddings' into optimisations
Browse files Browse the repository at this point in the history
  • Loading branch information
krivit committed May 31, 2024
2 parents c835edc + c788a75 commit 371c89e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions MCRS_GAT.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ def L_BGNN(data, criteria, user_id_map, item_id_map):
# Calculate vector of degrees
margins = np.maximum(np.sum(adj_matrix, axis=0), 1.0)

# TODO: Check if using sqrt(margins) would be better here.
# Normalise the matrix using the degrees
normalized_matrix = adj_matrix / margins[:, None] / margins[None, :]
# Divide the matrix by the harmonic mean of its margins.
normalized_matrix = (adj_matrix / margins[:, None] + adj_matrix / margins[None, :]) / 2

matrices.append(normalized_matrix)

Expand Down

0 comments on commit 371c89e

Please sign in to comment.