Git Product home page Git Product logo

gnnrecover's Introduction

Graph Neural Networks can Recover the Hidden Features Solely from the Graph Structure (ICML 2023)

arXiv

We proved that GNNs can create completely new and useful node features even when the input node fatures are uninformative, by absorbing information from the graph structure.

Paper: https://arxiv.org/abs/2301.10956

✨ Summary

Traditional View of GNNs: GNNs filter features by mixing them with neighboring nodes.

Traditional View of GNNs: If the features are garbage, the outputs are also garbage.

Our Results: We showed that GNNs create informative node features by themselves even when the input features are uninformative by absorbing information from the underlying graph. Therefore, GNNs work even when the input node features are uninformative.

Problem Setting: We generate the input graph from hidden node features. We show that GNNs can recover them solely from the vanilla graph structure.

💿 Dependency

Please install dependencies by pip install -r requirements.txt.

PyTorch may not be installed due to GPU issues. Then please install it from the official website (e.g., by cpuonly flag).

📂 Files

  • shortest_path_plot.py reproduces Figure 2.
  • semi_moon.py reproduces the upper panel of Figure 3.
  • semi_adult.py reproduces the lower panel of Figure 3.
  • ind_moon.py reproduces Figure 4.
  • accuracy_of_recovered_features.py reproduces Table 1.

🗃️ Download Dataset

Please run the following command in the root directory before the execution of semi_adult.py.

$ wget https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data

🧪 Evaluation

Reproduce the results by the following commands.

$ python shortest_path_plot.py
$ python semi_moon.py
$ python semi_adult.py
$ python ind_moon.py
$ python accuracy_of_recovered_features.py

The results are saved in imgs directiory.

Results

▲ GNNs succeed in recovering the hidden features.

▲ GNNs succeed in recovering the hidden features even in the inductive setting.

Cora CiteSeer PubMed Coauthor CS Coauthor Physics Amazon Computers Amazon Photo
Baseline $\boldsymbol{x}^{\text{syn}}_v$ 0.122 0.231 0.355 0.066 0.307 0.185 0.207
Recovered Feature $\hat{\boldsymbol{z}}_v$ 0.671 0.640 0.653 0.492 0.745 0.528 0.566

▲ These results show that the recovered features $\hat{\boldsymbol{z}}_v$ by GNNs are informative for downstream tasks while the input node features $\boldsymbol{x}^{\text{syn}}_v$ are not at all. This indicates that GNNs extract meaningful information solely from the graph structure. We stress that this problem setting where no node features are available is extremely challenging for GNNs, and the results above show that GNNs work well (somewhat unexpectedly) in such a challenging situation.

Please refer to the paper for more details.

🖋️ Citation

@inproceedings{sato2023graph,
  author    = {Ryoma Sato},
  title     = {Graph Neural Networks can Recover the Hidden Features Solely from the Graph Structure},
  booktitle = {International Conference on Machine Learning, {ICML}},
  year      = {2023},
}

gnnrecover's People

Contributors

joisino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gnnrecover's Issues

Don't understand in util.py reconstruct_full function

Dear author,
I read your paper that mentioned the use of Graph Neural Networks (GNN) to recover hidden features, but when I looked at your code in the "util.py reconstruct_full function", it seems like you only used the MSD method to obtain results. Have I misunderstood something?

def reconstruct_full(dim, deg, pr, n, m, fr, to):
selected = np.random.choice(np.arange(n), m, replace=False)
unselected = np.array(list(set(np.arange(n)) - set(selected)))
s = (deg / (pr * n * n)) ** 0.25
W = csr_matrix(([s[x] for x in fr], (fr, to)))
spd = shortest_path(W, indices=selected)
pos_inf = (spd == np.inf)
spd[pos_inf] = 0
spd[pos_inf] = spd.max()
selected_spd = spd[:, selected]
sspd = (selected_spd + selected_spd.T) / 2
sspd = sspd ** 2
H = np.eye(m) - np.ones(m) / n
Ker = - H @ sspd @ H / 2
w, v = np.linalg.eigh(Ker)
rec_unnormalized = v[:, -dim:] @ np.diag(w[-dim:])
rec_orig = np.zeros((n, dim))
rec_orig[selected] = rec_unnormalized
rec_orig[unselected] = rec_unnormalized[spd[:, unselected].argmin(0)]
return rec_orig

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.