Skip to content

Commit 4194925

Browse files
committed
Code: add GCN-VAE
1 parent 483cbba commit 4194925

33 files changed

+5483
-1389
lines changed

.DS_Store

0 Bytes
Binary file not shown.

Tutorial.ipynb

Lines changed: 80 additions & 79 deletions
Large diffs are not rendered by default.

semb/methods/gae/LICENCE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2017 Thomas Kipf
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

semb/methods/gae/README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Graph Auto-Encoders
2+
============
3+
4+
This is a TensorFlow implementation of the (Variational) Graph Auto-Encoder model as described in our paper:
5+
6+
T. N. Kipf, M. Welling, [Variational Graph Auto-Encoders](https://arxiv.org/abs/1611.07308), NIPS Workshop on Bayesian Deep Learning (2016)
7+
8+
Graph Auto-Encoders (GAEs) are end-to-end trainable neural network models for unsupervised learning, clustering and link prediction on graphs.
9+
10+
![(Variational) Graph Auto-Encoder](figure.png)
11+
12+
GAEs have successfully been used for:
13+
* Link prediction in large-scale relational data: M. Schlichtkrull & T. N. Kipf et al., [Modeling Relational Data with Graph Convolutional Networks](https://arxiv.org/abs/1703.06103) (2017),
14+
* Matrix completion / recommendation with side information: R. Berg et al., [Graph Convolutional Matrix Completion](https://arxiv.org/abs/1706.02263) (2017).
15+
16+
17+
GAEs are based on Graph Convolutional Networks (GCNs), a recent class of models for end-to-end (semi-)supervised learning on graphs:
18+
19+
T. N. Kipf, M. Welling, [Semi-Supervised Classification with Graph Convolutional Networks](https://arxiv.org/abs/1609.02907), ICLR (2017).
20+
21+
A high-level introduction is given in our blog post:
22+
23+
Thomas Kipf, [Graph Convolutional Networks](http://tkipf.github.io/graph-convolutional-networks/) (2016)
24+
25+
26+
27+
## Installation
28+
29+
```bash
30+
python setup.py install
31+
```
32+
33+
## Requirements
34+
* TensorFlow (1.0 or later)
35+
* python 2.7
36+
* networkx
37+
* scikit-learn
38+
* scipy
39+
40+
## Run the demo
41+
42+
```bash
43+
python train.py
44+
```
45+
46+
## Data
47+
48+
In order to use your own data, you have to provide
49+
* an N by N adjacency matrix (N is the number of nodes), and
50+
* an N by D feature matrix (D is the number of features per node) -- optional
51+
52+
Have a look at the `load_data()` function in `input_data.py` for an example.
53+
54+
In this example, we load citation network data (Cora, Citeseer or Pubmed). The original datasets can be found here: http://linqs.cs.umd.edu/projects/projects/lbc/ and here (in a different format): https://github.com/kimiyoung/planetoid
55+
56+
You can specify a dataset as follows:
57+
58+
```bash
59+
python train.py --dataset citeseer
60+
```
61+
62+
(or by editing `train.py`)
63+
64+
## Models
65+
66+
You can choose between the following models:
67+
* `gcn_ae`: Graph Auto-Encoder (with GCN encoder)
68+
* `gcn_vae`: Variational Graph Auto-Encoder (with GCN encoder)
69+
70+
## Cite
71+
72+
Please cite our paper if you use this code in your own work:
73+
74+
```
75+
@article{kipf2016variational,
76+
title={Variational Graph Auto-Encoders},
77+
author={Kipf, Thomas N and Welling, Max},
78+
journal={NIPS Workshop on Bayesian Deep Learning},
79+
year={2016}
80+
}
81+
```

semb/methods/gae/figure.png

36.8 KB
Loading

semb/methods/gae/gae/.train.py.swp

16 KB
Binary file not shown.

semb/methods/gae/gae/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from __future__ import print_function
2+
from __future__ import division
581 KB
Binary file not shown.
60.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)