Skip to content

Conversation

@AMMAS1
Copy link

@AMMAS1 AMMAS1 commented Nov 11, 2025

Add SimplE Knowledge Graph Embedding Model

Summary

Implements the SimplE model for knowledge graph embedding, addressing the independence issue in CP decomposition by leveraging inverse relations.

Changes

  • New model: torch_geometric.contrib.nn.SimplE - A bilinear KGE model that uses two embeddings per entity (head/tail) and two per relation (forward/inverse)
  • Scoring function: 0.5 * (⟨h_e, v_r, t_e⟩ + ⟨h_e, v_r⁻¹, t_e⟩) - Average of CP scores for forward and inverse relations
  • Example script: examples/contrib/simple_fb15k_237.py - Training example on FB15k-237 dataset

Implementation Details

  • Extends KGEModel base class following the same pattern as TransE and RotatE
  • Uses binary cross-entropy loss with logits (same as ComplEx)
  • Xavier uniform initialization for all embeddings

Testing

  • Ran the example on FB15k-237 dataset with successful training and evaluation
  • Results: MRR 0.1969, Hits@10 0.3627 after 5 epochs (improves with more training)

References

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.

2 participants