Giter Club home page Giter Club logo

netsmf's Introduction

NetSMF

NetSMF: Large-Scale Network Embedding as Sparse Matrix Factorization

HOWTO

How to install

sudo apt-get install cmake
sudo apt-get install libgflags-dev
sudo apt-get install liblog4cxx-dev
sudo apt-get install libomp-dev
sudo apt-get install libeigen3-dev
https://github.com/xptree/NetSMF.git
cd NetSMF
mkdir build
./configure
cd build
make

How to run

Input

Support undirected networks with edgelist format.

For unweighted networks, each edge should appear twice a b and b a.

For weighted networks, each edge should appear twice a b w and b a w.

You may want to use example/mat2edge.py to translate mat to edgelist.

.mat files can be downloaded here:

Run NetSMF

For unweighted networks, see example/blog.sh for an example.

blog.sh takes three arguments, the first one indicates the input edgelist file, the second one indicates the output file, the third one indicating the origin .mat file containing network and labels.

For exmaple, runing ./blog.sh blogcatalog.edgelist blogcatalog.netsmf blogcatalog.mat will

  • check if blogcatalog.edgelist is a valid file. If not, it calls mat2edge.py to translate mat file blogcatalog.mat to edgelist blogcatalog.edgelist.
  • call NetSMF algorithm, and store the 128-dim embedding at blogcatalog.netsmf_128.npy.
  • call predict.py to evaluate NetSMF at the label classification task.

You can use -weight to switch to weighted networks and use -noweight to switch to unweighted network (default unweighted).

About truncated logarithm

We propose to use truncated logarithm in our WWW'19 paper.

In the code, we provide a new option log1p, i.e., log(1+x). You can use -log1p to turn it on and -nolog1p to turn it off (default off). Empirically speaking, log1p sometimes achieves better performance, for example in wiki dataset.

Acknowledgement

The implementation of randomized singular value decomposition is by redsvd and HPCA.

netsmf's People

Contributors

xptree 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.