https://github.com/borgwardtlab/motifiesta
Approximate subgraph motif mining through learnable edge contraction.
https://github.com/borgwardtlab/motifiesta
Last synced: 11 months ago
JSON representation
Approximate subgraph motif mining through learnable edge contraction.
- Host: GitHub
- URL: https://github.com/borgwardtlab/motifiesta
- Owner: BorgwardtLab
- License: gpl-3.0
- Created: 2022-05-27T14:06:22.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-08-03T07:00:44.000Z (almost 3 years ago)
- Last Synced: 2023-08-06T08:03:18.862Z (almost 3 years ago)
- Language: Python
- Size: 279 KB
- Stars: 12
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[][1]

# MotiFiesta: Neural Approximate Motif Mining
The repository implements the MotiFiesta algorithm described in the following paper:
>Carlos Oliver, Dexiong Chen, Vincent Mallet, Pericles Philippopoulos, Karsten Borgwardt.
[Approximate Network Motif Mining Via Graph Learning][1]. Preprint 2022.
MotiFiesta is a graph neural network trained to detect over-represented subgraphs in a graph dataset.
## Citation
```bibtex
@article{oliver2022approximate,
title={Approximate Network Motif Mining Via Graph Learning},
author={Oliver, Carlos and Chen, Dexiong and Mallet, Vincent and Philippopoulos, Pericles and Borgwardt, Karsten},
journal={arXiv preprint arXiv:2206.01008},
year={2022}
}
```
## Setup
```
$ pip install .
```
## Build datasets
```
$ build_data_motifiesta
```
## Untar pre-trained models
Download pretrained models [here](https://drive.proton.me/urls/BN2X8ZHQAR#UQFR3LELTwhj) and move the tarball to the root of this repository.
```
$ tar -xzvf models.tar.gz
```
## Training a model
```
$ motifiesta train -h
$ motifiesta train -da -n test
```
## Making motif predictions
This is an example script for assigning each node in a graph to an integer motif ID using a pre-trained model.
You can also launch this with the command `$ motifiesta_example`
```python
from MotiFiesta.training.decode import HashDecoder
model_id = 'barbell-d0.00'
data_id = 'synth-distort-barbell-d0.00'
level = 3
decoder = HashDecoder(model_id, data_id, level)
decoded_graphs = decoder.decode()
for graph in decoded_graphs:
print(f"Motif assignment for each node: {g.motif_pred}")
```
Scripts for generating figures in the paper are in `fig_scripts/`
Output from running [mfinder](https://www.weizmann.ac.il/mcb/UriAlon/sites/mcb.UriAlon/files/uploads/NetworkMotifsSW/mfinder/mfindermanual.pdf) are in `data_mfinder` and `out_mfinder`, the script `minder_benchmark.py` parses this output.
[1]: https://arxiv.org/abs/2206.01008