seanhacks commited on
Commit
f549b40
Β·
verified Β·
1 Parent(s): 261fe74

model: graph_conv-rotate_h128_l3_edge_prediction | (graph_conv-rotate_h128_l3) | WandB: xpa2bgz2

Browse files
Files changed (1) hide show
  1. README.md +150 -0
README.md ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags: ['napistu', 'napistu-torch', 'graph-neural-networks', 'biological-networks', 'pytorch', 'graph_conv', 'rotate', 'edge_prediction', 'relation-aware']
3
+ library_name: napistu-torch
4
+ license: mit
5
+ metrics:
6
+ - auc
7
+ - average_precision
8
+ ---
9
+
10
+ # graph_conv-rotate_h128_l3_edge_prediction
11
+
12
+ This model was trained using [Napistu-Torch](https://www.shackett.org/napistu_torch/), a PyTorch framework for training graph neural networks on biological pathway networks.
13
+
14
+ The dataset used for training is the 8-source ["Octopus" human consensus network](https://www.shackett.org/octopus_network/), which integrates pathway data from STRING, OmniPath, Reactome, and others. The network encompasses ~50K genes, metabolites, and complexes connected by ~8M interactions.
15
+
16
+ ## Task
17
+
18
+ This model performs **edge prediction** on biological pathway networks. Given node embeddings,
19
+ the model predicts the likelihood of edges (interactions) between biological entities such as
20
+ genes, proteins, and metabolites. This is useful for:
21
+
22
+ - Discovering novel biological interactions
23
+ - Validating experimentally observed interactions
24
+ - Completing incomplete pathway databases
25
+ - Predicting functional relationships between genes/proteins
26
+
27
+ The model learns to score potential edges based on learned embeddings of source and target nodes,
28
+ optionally incorporating relation types for relation-aware prediction.
29
+
30
+ ## Model Description
31
+
32
+ - **Encoder**
33
+ - Type: `graph_conv`
34
+ - Hidden Channels: `128`
35
+ - Number of Layers: `3`
36
+ - Dropout: `0.2`
37
+ - Edge Encoder: βœ“ (dim=32)
38
+ - **Head**
39
+ - Type: `rotate`
40
+ - Relation-Aware: βœ“
41
+
42
+ **Training Date**: 2026-01-01
43
+
44
+ For detailed experiment and training settings see this repository's `config.json` file.
45
+
46
+ ## Performance
47
+
48
+ | Metric | Value |
49
+ |--------|-------|
50
+ | Validation relation-weighted AUC | 0.8105 |
51
+ | Test relation-weighted AUC | 0.8193 |
52
+ | Validation AUC | 0.7859 |
53
+ | Test AUC | 0.8089 |
54
+ | Validation AP | 0.7918 |
55
+ | Test AP | 0.8126 |
56
+
57
+
58
+ ## Links
59
+
60
+ - πŸ“Š [W&B Run](https://wandb.ai/napistu/napistu-experiments/runs/xpa2bgz2)
61
+ - 🌐 [Napistu](https://napistu.com)
62
+ - πŸ’» [GitHub Repository](https://github.com/napistu/Napistu-Torch)
63
+ - πŸ“– [Read the Docs](https://napistu-torch.readthedocs.io/en/latest)
64
+ - πŸ“š [Napistu Wiki](https://github.com/napistu/napistu/wiki)
65
+
66
+ ## Usage
67
+
68
+ ### 1. Setup Environment
69
+
70
+ To reproduce the environment used for training, run the following commands:
71
+
72
+ ```bash
73
+ pip install torch==2.8.0
74
+ pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/2.8.0+cpu.html
75
+ pip install 'napistu==0.8.5'
76
+ pip install 'napistu-torch[pyg,lightning]==0.3.4'
77
+ ```
78
+
79
+ ### 2. Setup Data Store
80
+
81
+ First, download the Octopus consensus network data to create a local `NapistuDataStore`:
82
+ ```python
83
+ from napistu_torch.load.gcs import gcs_model_to_store
84
+
85
+ # Download data and create store
86
+ napistu_data_store = gcs_model_to_store(
87
+ napistu_data_dir="path/to/napistu_data",
88
+ store_dir="path/to/store",
89
+ asset_name="human_consensus",
90
+ # Pin to stable version for reproducibility
91
+ asset_version="20250923"
92
+ )
93
+ ```
94
+
95
+ ### 3. Load Pretrained Model from HuggingFace Hub
96
+ ```python
97
+ from napistu_torch.ml.hugging_face import HFModelLoader
98
+
99
+ # Load checkpoint
100
+ loader = HFModelLoader("seanhacks/relation_prediction_rotate_128e")
101
+ checkpoint = loader.load_checkpoint()
102
+
103
+ # Load config to reproduce experiment
104
+ experiment_config = loader.load_config()
105
+ ```
106
+
107
+ ### 4. Use Pretrained Model for Training
108
+
109
+ You can use this pretrained model as initialization for training via the CLI:
110
+ ```bash
111
+ # Create a training config that uses the pretrained model
112
+ cat > my_config.yaml << EOF
113
+ name: my_finetuned_model
114
+
115
+ model:
116
+ use_pretrained_model: true
117
+ pretrained_model_source: huggingface
118
+ pretrained_model_path: seanhacks/relation_prediction_rotate_128e
119
+ pretrained_model_freeze_encoder_weights: false # Allow fine-tuning
120
+
121
+ data:
122
+ sbml_dfs_path: path/to/sbml_dfs.pkl
123
+ napistu_graph_path: path/to/graph.pkl
124
+ napistu_data_name: edge_prediction
125
+
126
+ training:
127
+ epochs: 100
128
+ lr: 0.001
129
+ EOF
130
+
131
+ # Train with pretrained weights
132
+ napistu-torch train my_config.yaml
133
+ ```
134
+
135
+ ## Citation
136
+
137
+ If you use this model, please cite:
138
+ ```bibtex
139
+ @software{napistu_torch,
140
+ title = {Napistu-Torch: Graph Neural Networks for Biological Pathway Analysis},
141
+ author = {Hackett, Sean R.},
142
+ url = {https://github.com/napistu/Napistu-Torch},
143
+ year = {2025},
144
+ note = {Model: graph_conv-rotate_h128_l3_edge_prediction}
145
+ }
146
+ ```
147
+
148
+ ## License
149
+
150
+ MIT License - See [LICENSE](https://github.com/napistu/Napistu-Torch/blob/main/LICENSE) for details.