Coder Social home page Coder Social logo

anrl's Introduction

ANRL

ANRL: Attributed Network Representation Learning via Deep Neural Networks (IJCAI-18)

This is a Tensorflow implementation of the ANRL algorithm, which learns a low-dimensional representations for each node in a network. Specifically, ANRL consists of two modules, i.e., neighbor enhancement autoencoder and attribute-aware skip-gram model, to jointly capture the node attribute proximity and network topology proximity.

Requirements

  • python2.7 or python3.6
  • tensorflow
  • networkx
  • numpy
  • scipy
  • scikit-learn

All required packages are defined in requirements.txt. To install all requirement, just use the following commands:

pip install -r requirements.txt

Basic Usage

Input Data

For node classification, each dataset contains 3 files: edgelist, features and labels.

1. citeseer.edgelist: each line contains two connected nodes.
node_1 node_2 (weight)
node_2 node_3 (weight)
...

2. citeseer.feature: this file has n+1 lines.
The first line has the following format:
node_number feature_dimension
The next n lines are as follows: (each node per line ordered by node id)
(for node_1) feature_1 feature_2 ... feature_n
(for node_2) feature_1 feature_2 ... feature_n
...

3. citeseer.label: each line represents a node and its class label.
node_1 label_1
node_2 label_2
...

For link prediction, each dataset contains 3 files: training edgelist, features and test edgelist.

1. xxx_train.edgelist: each line contains two connected nodes.
node_1 node_2 (weight)
node_2 node_3 (weight)
...

2. xxx.feature: this file has n+1 lines.
The first line has the following format:
node_number feature_dimension
The next n lines are as follows: (each node per line ordered by node id)
(for node_1) feature_1 feature_2 ... feature_n
(for node_2) feature_1 feature_2 ... feature_n
...

3. xxx_test.edgelist: each line contains two connected nodes.
node_1 node_2 1 (positive sample)
node_2 node_3 0 (negative sample)
...

Output Data

The output file has n+1 lines as the input feature files. The first line has the following format:

node_number embedding_dimension

The next n lines are as follows: node_id dim_1, dim_2, ... dim_d

Run

To run ANRL, just execute the following command for node classification task:

python main.py

Note: As for simulating random walks, we directly use the code provided in node2vec, which levearges alias sampling to faciliate the procedure.

Citing

If you find ANRL useful for your research, please consider citing the following paper:

@inproceedings{ijcai2018-438,
  title     = {ANRL: Attributed Network Representation Learning via Deep Neural Networks},
  author    = {Zhen Zhang and Hongxia Yang and Jiajun Bu and Sheng Zhou and Pinggang Yu and Jianwei Zhang and Martin Ester and Can Wang},
  booktitle = {Proceedings of the Twenty-Seventh International Joint Conference on
               Artificial Intelligence, {IJCAI-18}},
  publisher = {International Joint Conferences on Artificial Intelligence Organization},             
  pages     = {3155--3161},
  year      = {2018},
  month     = {7},
  doi       = {10.24963/ijcai.2018/438},
  url       = {https://doi.org/10.24963/ijcai.2018/438},
}

anrl's People

Contributors

cszhangzhen avatar dependabot[bot] avatar

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.