Skip to content

Commit 4650b3d

Browse files
committed
Updated
1 parent 95228e0 commit 4650b3d

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

.DS_Store

8 KB
Binary file not shown.

README.md

+55
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,57 @@
11
# H2MN
22
H2MN: Graph Similarity Learning with Hierarchical Hypergraph Matching Networks (KDD 2021)
3+
4+
![](https://github.com/cszhangzhen/H2MN/blob/master/fig/model.png)
5+
6+
This is a PyTorch implementation of the H2MN algorithm, which reasons over a pair of graph-structured objects for graph similarity learning. Specifically, the proposed method consist of the following four steps: (1) hypergraph construction, which transforms ordinary graph into hypergraph; (2) hypergraph convolution, which learns the high-order node representations; (3) hyperedge pooling, which coarsens each graph into a coarse graph to accelerate the matching procedure; (4) subgraph matching, which conducts multi-perspective subgraph matching for similarity learning.
7+
8+
9+
## Requirements
10+
* python3.7
11+
* pytorch==1.6.0
12+
* torch_geometric==1.6.1
13+
* torch_scatter==2.0.5
14+
* torch_sparse==0.6.7
15+
* torch_cluster==1.5.7
16+
* sklearn==0.23.1
17+
* numpy==1.16.0
18+
* scipy==1.5.0
19+
* texttable==1.6.2
20+
21+
This code repository is heavily built on [pytorch_geometric](https://github.com/rusty1s/pytorch_geometric), which is a Geometric Deep Learning Extension Library for PyTorch. Please refer [here](https://pytorch-geometric.readthedocs.io/en/latest/) for how to install and utilize the library.
22+
23+
## Graph-Graph Classification Datasets
24+
These two datasets are generated from two popular open-source software FFmpeg and OpenSSL, in which each graph denotes the binary function’s control flow graph. In our experiment, we compile the source code function under various settings such as different compilers (e.g., gcc or clang) and different optimization levels to generate multiple binary function graphs. Thus, we take two binary functions compiled from the same source code as semantically similar to each other.
25+
26+
* fname, the function's name
27+
* features, the node's feature
28+
* n_num, the number of nodes
29+
* succs, each node's successor nodes
30+
31+
More detailed information can be found [here](https://github.com/runningoat/hgmn_dataset).
32+
33+
## Graph-Graph Regression Datasets
34+
In this three datasets, each dataset contains the ground-truth Graph Edit Distance (GED) scores between every pair of graphs. More detailed information can be found [here](https://github.com/yunshengb/SimGNN).
35+
36+
## Run
37+
Just execuate the following command for graph-graph classification task:
38+
```
39+
python main_classification.py --datasets openssl_min50
40+
```
41+
42+
Similarly, execuate the following command for graph-graph regression task:
43+
```
44+
python main_regression.py --datasets AIDS700nef
45+
```
46+
47+
## Citing
48+
If you find H2MN useful for your research, please consider citing the following paper:
49+
```
50+
@article{zhang2021graph,
51+
title={H2MN: Graph Similarity Learning with Hierarchical Hypergraph Matching Networks},
52+
author={Zhang, Zhen and Bu, Jiajun and Ester, Martin and Li, Zhao and Yao, Chengwei and Yu, Zhi and Wang, Can},
53+
journal={KDD},
54+
year={2021}
55+
}
56+
```
57+

fig/.DS_Store

6 KB
Binary file not shown.

fig/model.png

172 KB
Loading

0 commit comments

Comments
 (0)