Git Product home page Git Product logo

lds-gnn's Introduction

LDS-GNN

This is the accompany python package for the ICML 2019 paper Learning Discrete Structures for Graph Neural Networks

It implements the method LDS and its variant KNN-LDS and reproduces experiments reported in the paper.

alt text

Requirements

The code is written Python 3.6 and TensorFlow version 1 (tested on versions 1.12 and 1.16). It requires scikit-learn >= 0.21.2 and the python packages

  • FAR-HO, available here (advised branch: final_ICML2019)
  • GCN, available here
Datasets

UCI datasets should be loaded automatically, while graph-based datasets (Cora and Citeseer) are included in the GCN package, available here. Place the relevant files in the folder lds/data.

FMA dataset (we used the small version) should also be downloaded, please email the authors if interested.

Installation (optional)

python setup.py install

The scripts contained in lds.py should work also without installing the package.

Run

Navigate to lds_gnn folder.

The main script is in the file lds.py. The options are

-d: the evaluation dataset. Available datasets are iris, wine, breast_cancer, digits, 20newstrain, 
            20news10, cora, citeseer, fma. Default breast_cancer
-m: the method: lds or knnlds. Default knnlds
-s: the random seed. Default 1
-e: the percentage of missing edges (valid only for cora and citeseer dataset). Default 50

For experiments with incomplete graphs on Cora and Citeseer, run

python lds.py -m lds -e {an integer between 0 and 100} -d {cora or citeseer} -s {if you want to specify random seed}

For experiments in semi-supervised learning (with no input graph), run

python lds.py -m knnlds -d {any available dataset} -s {if you want to specify random seed}

The code will run a small grid search to select some method's parameters such as the (outer) optimization learning rate and the number of truncation steps to compute the hypergradeient. It will output the test accuracy of the best found model, according to the ''early stopping accuracy''. It will also create one log file per single experiment in the folder lds/results, which can be successively loaded (e.g. in a notebook) with the function lds.load_results() for inspection and visualization .

Please note that the package does not include implementations of baseline methods.

Licence

Please take a look at LICENCE.txt

Cite

If you use this package, please cite

@InProceedings{franceschi2019learning,
 title = 	 {Learning Discrete Structures for Graph Neural Networks},
 author = 	 {Luca Franceschi and Mathias Niepert and Massimiliano Pontil and Xiao He},
 booktitle = 	 {Proceedings of the 36th International Conference on Machine Learning},
 year = 	 {2019}
}

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.