Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.1%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: mrmrob003
- License: mit
- Language: Python
- Default Branch: main
- Size: 127 KB
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 3
Metadata Files
README.md
APPrOVE: Approximate Personalized Propagation Over Varied Edges
😎 Summary
A PyTorch Geometric implementation of APPrOVE: Approximate Personalized Propagation Over Varied Edges. APPrOVE extends the well-known personalized PageRank algorithm to heterogeneous graphs (graphs with varied edges) and furnishes a message-passing layer that generalises the propagation scheme of "Predict then Propagate: Graph Neural Networks meet Personalized PageRank".
🚀 Installation
The most recent release can be installed from PyPI with:
bash
$ pip install approve
The most recent code can be installed directly from GitHub with:
bash
$ pip install git+https://github.com/mrmrob003/approve.git
🏃 Getting Started
To demonstrate our heterogeneous personalized PageRank algorithm, consider the following toy-model of a citation network consisting of three papers and two venues.
Paper 0 is cited by the other two papers and published by venue 0, while paper 1 is cited by paper 2 and published by venue 1.
We can represent this citation network as a torch.data.HeteroData object as follows:
python
hetero_data = HeteroData()
hetero_data['paper', 'cites', 'paper'].edge_index = torch.tensor(
[[1, 2, 2],
[0, 0, 1]]
)
hetero_data['venue', 'publishes', 'paper'].edge_index = torch.tensor(
[[0, 1],
[0, 1]]
)
hetero_data['paper', 'rev_publishes', 'venue'].edge_index = \
hetero_data['venue', 'publishes', 'paper'].edge_index[[1, 0]]
hetero_data['paper'].num_nodes = 3
hetero_data['venue'].num_nodes = 2
To compute the type-sensitive PageRank score of each node, we uniformly assign an initial fraction (of the total score for a given node type) to all nodes of a given type. For example, since there are three papers and two venues, we assign each paper a third of the total 'paper' score and each venue half of the total 'venue' score.
We can store these initial scores as follows:
python
hetero_data['paper'].x = torch.full((3, 1), 1 / 3)
hetero_data['venue'].x = torch.full((2, 1), 1 / 2)
In addition, we need to add self-loops to 'paper' nodes, and a special edge from paper 2 (which is as-yet-unpublished) to a special 'venue' node, as depicted below.
The addition of the self-loops, the special edge and the special node prevents the total score for each node type from leaking. The approve.models.HeteroAPPr model takes care of all these considerations. The model can be easily used to compute the type-sensitive PageRank score of each node as follows:
python
model = HeteroAPPr(K=30)
output = model(
hetero_data.x_dict,
edge_index_dict=hetero_data.edge_index_dict,
)
output
{'paper': tensor([[0.4605],
[0.3289],
[0.2105]]),
'venue': tensor([[0.4803],
[0.4145],
[0.1053]])}
Unsurprisingly, paper 0 is the most important paper, since it is cited by the other two papers. Venues 0 and 1 have comparable scores; venue 0's score is slighlty larger than venue 1's score, because venue 0 publishes a higher-ranked paper than the paper published by venue 1. Venue 2, the special 'venue' node, has a comparably low score because it relates to the lowest ranked paper.
👋 Attribution
⚖️ License
The code in this package is licensed under the MIT License.
📖 Citation
If you use this software in your work, please cite it using the "Cite this repository" widget located on the sidebar.
Owner
- Name: Robert Moerman-Redding
- Login: mrmrob003
- Kind: user
- Website: https://mrmrob003.github.io/
- Repositories: 2
- Profile: https://github.com/mrmrob003
Data Scientist | PhD in Physics | Visiting Lecturer at the University of Hertfordshire
Citation (CITATION.cff)
cff-version: 1.2.0
title: APPROVE
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Robert
family-names: Moerman
orcid: 'https://orcid.org/0000-0002-6380-9232'
repository-code: 'https://github.com/mrmrob003/approve'
abstract: >-
A PyTorch Geometric implementation of APPROVE: Approximate Personalized Propagation Over Varied Edges. APPROVE extends the well-known personalized PageRank algorithm to heterogeneous graphs (graphs with varied edges).
license: MIT
version: 0.1.0
GitHub Events
Total
Last Year
Packages
- Total packages: 1
-
Total downloads:
- pypi 16 last-month
- Total dependent packages: 0
- Total dependent repositories: 2
- Total versions: 2
- Total maintainers: 1
pypi.org: approve
A PyTorch Geometric implementation of APPrOVE: Approximate Personalized Propagation Over Varied Edges. APPrOVE extends the well-known personalized PageRank algorithm to heterogeneous graphs (graphs with varied edges).
- Documentation: https://approve.readthedocs.io/
- License: MIT
-
Latest release: 0.1.1
published over 2 years ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
- actions/checkout v4 composite
- actions/setup-python v4 composite
- codecov/codecov-action v3 composite
- torch *
- torch_geometric *