Downloads · 30 days
9
21% of all-time downloads
seanhacks/relation_attention_mlp
relation_attention_mlp is a machine learning model from seanhacks. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for napistu-torch. The card lists the license as mit.
This model was trained using Napistu-Torch, a PyTorch framework for training graph neural networks on biological pathway networks.
Downloads · 30 days
9
21% of all-time downloads
All-time downloads
42
Public
Repo size
2.1 MB
Likes
0
Public
Click a slice to open those files.
.ckpt2.1 MB · 100%
From the Hugging Face model README
This model was trained using Napistu-Torch, a PyTorch framework for training graph neural networks on biological pathway networks.
The dataset used for training is the 8-source "Octopus" human consensus network, which integrates pathway data from STRING, OmniPath, Reactome, and others. The network encompasses ~50K genes, metabolites, and complexes connected by ~8M interactions.
This model performs edge prediction on biological pathway networks. Given node embeddings, the model predicts the likelihood of edges (interactions) between biological entities such as genes, proteins, and metabolites. This is useful for:
The model learns to score potential edges based on learned embeddings of source and target nodes, optionally incorporating relation types for relation-aware prediction.
graph_conv12830.2relation_attention_mlpTraining Date: 2025-12-14
For detailed experiment and training settings see this repository's config.json file.
| Metric | Value |
|---|---|
| Validation AUC | 0.8187 |
| Test AUC | 0.8186 |
| Validation AP | 0.8205 |
| Test AP | 0.8204 |
To reproduce the environment used for training, run the following commands:
pip install torch==2.8.0
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/2.8.0+cpu.html
pip install 'napistu==0.8.2'
pip install 'napistu-torch[pyg,lightning]==0.2.14'
First, download the Octopus consensus network data to create a local NapistuDataStore:
from napistu_torch.load.gcs import gcs_model_to_store
# Download data and create store
napistu_data_store = gcs_model_to_store(
napistu_data_dir="path/to/napistu_data",
store_dir="path/to/store",
asset_name="human_consensus",
# Pin to stable version for reproducibility
asset_version="20250923"
)
from napistu_torch.ml.hugging_face import HuggingFaceLoader
# Load checkpoint
loader = HuggingFaceLoader("seanhacks/relation_attention_mlp")
checkpoint = loader.load_checkpoint()
# Load config to reproduce experiment
experiment_config = loader.load_config()
You can use this pretrained model as initialization for training via the CLI:
# Create a training config that uses the pretrained model
cat > my_config.yaml << EOF
name: my_finetuned_model
model:
use_pretrained_model: true
pretrained_model_source: huggingface
pretrained_model_path: seanhacks/relation_attention_mlp
pretrained_model_freeze_encoder_weights: false # Allow fine-tuning
data:
sbml_dfs_path: path/to/sbml_dfs.pkl
napistu_graph_path: path/to/graph.pkl
napistu_data_name: edge_prediction
training:
epochs: 100
lr: 0.001
EOF
# Train with pretrained weights
napistu-torch train my_config.yaml
If you use this model, please cite:
@software{napistu_torch,
title = {Napistu-Torch: Graph Neural Networks for Biological Pathway Analysis},
author = {Hackett, Sean R.},
url = {https://github.com/napistu/Napistu-Torch},
year = {2025},
note = {Model: graph_conv-relation_attention_mlp_h128_l3_edge_prediction}
}
MIT License - See LICENSE for details.