Code Monkey home page Code Monkey logo

ctgcn's Introduction

CTGCN

K-Core based Temporal Graph Convolutional Network for Dynamic Graphs

Requirements:

Directory:

CTGCN/  
  CTGCN/  
    baseline/                    (implemented baselines, i.e. GCN, GAT, EvolveGCN, timers)  
    evaluation/                  (evaluation tasks, i.e. link prediction, node classification)  
    preprocessing/               (preprocessing tasks, i.e. k-core decomposition, random walk)  
    embedding.py                 (data loader and different kinds of embedding)  
    graph.py                     (dynamic graph generation for static graphs and scalability data generation)  
    layers.py                    (All layers used in CTGCN)  
    metrics.py                   (Loss function)  
    models.py                    (All models of CTGCN)  
    train.py                     (main file used to train different embedding methods)  
    utils.py                     (utility functions)  
  data/  
    facebook/  
      0. input/                  (raw data)  
      1. format/                 (formatted dynamic graph data)  
      2. embedding/              (embedding results)  
      nodes_set/                 (node list file)  
      CTGCN/                     (intermediate data, i.e. k-core data, random walk data)  
    enron/
      ......

Commands:

  1. compile 'preprocessing/helper.pyx' file.

    cd preprocessing  
    python3 setup.py build_ext --inplace  
    
  2. preprocess dynamic graphs to generate k-core data and random walk data.

    python3 preprocessing/__init__.py
    
  3. train graph embedding methods

    python3 train.py
    

Baselines:

  1. GCN, GAT, EvolveGCN, timers
    https://github.com/jhljx/CTGCN/tree/master/CTGCN/baseline
  2. DeepWalk, node2vec, struc2vec
    https://github.com/shenweichen/GraphEmbedding
  3. DynGEM
    https://github.com/palash1992/DynamicGEM/blob/master/dynamicgem/embedding/dynSDNE.py

Notes

  1. Origin graph file names must be timestamp format or integer number format(other wise when training dynamic embedding, sorted(f_list) may reture a wrong order of files)
  2. Weighted random walk are set as default in the 'get_walk_info' function of 'CTGCN/preprocessing/walk_generation.py' file.
  3. The original graph edge data don't need to have a reverse edge for each edge, the procedure will add reverse edges in 'get_sp_adj_mat' / 'get_nx_graph' function of 'CTGCN/utils.py' file. All graph data sets are read by these two functions.
  4. The original graph file header must be 'from_id, to_id, weight', or you will modify the 'get_nx_graph' function of 'CTGCN/utils.py' file. 'get_sp_adj_mat' don't care the concrete header name, as long as the first 2 columns are node idxs and the last column is edge weight.

Reference

ctgcn's People

Contributors

jhljx avatar xuchang-x avatar

Stargazers

 avatar

Watchers

 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.