Git Product home page Git Product logo

dsnr's Introduction

DSNR

DSNR: Deep Semantic Network Representation

This a Tensorflow implementation of the DSNR algorithm, which learns a low-dimensional representations for each node in a network. DSNR explores the implicit semantic information of nodes and captures the high-order semantic proximity. Specifically, to make the model effective, DSNR consist of three module, i.e., semantic aware module which models the implicit semantic information of nodes and gets the enhanced semantic feature representation by a deep autoencoder, embedding module which fuses the enhanced semantic feature in node identity sequence generated by the truncated random walk to generate node semantic sequence, and high-order structure aware module which translate the network from the node semantic sequence to the node identity sequence by the attention-enhanced seq2seq framework.

Motivation

An example of node with implicit semantic information. All Bob’close friends are explorer. Thus, Bob should also like expedition.The same goes for Tom. Furthermore, Bob and Tom have the similar implicit semantic information, but they are far apart in the network. However, their node representations in the latent space should be similar.

The framework of DSNR

The framework of DSNR consists of three major modules. For the semantic aware module, we propose a heuristic method to get the implicit semantic of nodes by integrating node neighbors’ semantic information. We then use a deep autoencoder to encode and decode the inherent semantic information of nodes. Finally, we reconstruct the implicit semantic feature of nodes instead of its inherent semantic feature. For the embedding module, we construct the node semantic sequence by fusing the enhanced semantic feature vector of nodes and the node identity sequence generated by a truncated random walk. For the high-order structure aware module, we translate network from the node semantic sequence to the node identity sequence by an attention-enhanced seq2seq framework.

Requirement:

python 3.6.4
Tensorflow 1.0
Numpy
networkx
Sklearn
The develop tool is PyCharm Community Edition 2019.3.1

Dataset:

Cora, Citeseer and Wiki datasets are given.

Including:

1.cora.edgelist
2.cora.features (node original semantic feature vector representations: attributes of nodes have been processed as TFIDF vector)
3.cora.svd (node original semantic feature vector representations: TFIDF matrix on node attributes is decomposed by SVD, and then      the left singular matrix obtained is taken as the input feature)
4.cora.sequence (it has been processed by truncated random walk)
In this paper, we select node TFIDF feature vector as the original semantic feature of nodes

Basic Usage

Input Data

For node classification, each dataset contain 4 files: edgelist,feature, labels and node sequence

cora.edgelist: each line contains two connected nodes

node_1 node_2
node_2 node_2
  ...

cora.feature: this file has n lines.

the n lines are as follows:(each node per line ordered by node id)
(for node_1) feature_1 feature_2...feature_n
(for node_1) feature_1 feature_2...feature_n
...

cora.label: each line represents a node and its class label.

node_1 label_1
node_1 label_1
...

cora.sequence: has been processed by truncated random walk

node_1 node_2 node_2...node_10

output: the Micro-F1 for node classification

Run

python main.py

The result of node classification

dsnr's People

Contributors

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