Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Attract-Repel link prediction model #10105

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tommyly201
Copy link

@tommyly201 tommyly201 commented Mar 9, 2025

Add Attract-Repel Embeddings for Link Prediction

This PR adds an implementation of Attract-Repel embeddings from the paper "Pseudo-Euclidean Attract-Repel Embeddings for Undirected Graphs" by Peysakhovich et al.

Overview

Attract-Repel embeddings address a fundamental limitation in traditional graph embeddings: their inability to effectively represent non-transitive relationships. The method splits node representations into two components:

  • Attract component: nodes with similar attract vectors are likely to connect
  • Repel component: nodes with similar repel vectors are unlikely to connect

Link prediction scores are calculated as: attract_dot_product - repel_dot_product

Implementation

  • Added ARLinkPredictor class that implements the core functionality
  • Added thorough tests to validate the implementation
  • The implementation is minimal and focused on the core concept

Benefits

  • Improves link prediction performance on graphs with non-transitive relationships
  • Requires minimal architectural changes to existing models
  • Provides useful information about graph structure through R-fraction analysis
  • Example PR #10107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant