Giter Site home page Giter Site logo

benedekrozemberczki / attentionwalk Goto Github PK

View Code? Open in Web Editor NEW
312.0 10.0 48.0 1.28 MB

A PyTorch Implementation of "Watch Your Step: Learning Node Embeddings via Graph Attention" (NeurIPS 2018).

License: GNU General Public License v3.0

Python 100.00%
pytorch torch attention deepwalk node2vec word2vec matrix-factorization deep-learning structural-attention walklet

attentionwalk's Introduction

Benedek A. Rozemberczki/ Homepage / Twitter / GitHub / Google Scholar

Welcome stranger

  • โฐ Currently working on machine learning for drug discovery.
  • ๐Ÿค– I would love to collaborate on the machine learning libraries ChemicalX and RexMex.

Great news

attentionwalk's People

Contributors

benedekrozemberczki avatar neilctwu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

attentionwalk's Issues

Memory Error

I'm getting OOM errors even with small files. The attached file link_network.txt throws the following error:

Adjacency matrix powers: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 4/4 [00:00<00:00, 108.39it/s]
Traceback (most recent call last):
  File "src\main.py", line 79, in <module>
    main()
  File "src\main.py", line 74, in main
    model = AttentionWalkTrainer(args)
  File "E:\AttentionWalk\src\attentionwalk.py", line 70, in __init__
    self.initialize_model_and_features()
  File "E:\AttentionWalk\src\attentionwalk.py", line 76, in initialize_model_and_features
    self.target_tensor = feature_calculator(self.args, self.graph)
  File "E:\AttentionWalk\src\utils.py", line 53, in feature_calculator
    target_matrices = np.array(target_matrices)
MemoryError

I guess this is due to the large indices of the nodes. Any workarounds for this?

miscalculations of normalized adjacency matrix

Thanks for sharing this awesome repo.

The issue is I found that loss_on_target will become extreme big while training from the original code, and I think is due to the miscalculation of normalized_adjacency_matrix .

From your original code, normalized_adjacency_matrix is been calculated by:

normalized_adjacency_matrix = degs.dot(adjacency_matrix)

However while the matrix hasn't been normalize but simply multiple by degree of nodes.
I think the part of normalized_adjacency_matrix should be modified like its original definition:

  normalized_adjacency_matrix = degs.power(-1/2)\
                                    .dot(adjacency_matrix)\
                                    .dot(degs.power(-1/2))

It'll turn out to be more reasonable loss shown below:
image

Am I understand it correctly?

embedding result

Hello! My research interest is link prediction. In def save_embedding(self), can save the embedding result with a vector? How to solve? Thank you

Directed weighted graphs

Is it possible to use the code with directed and weighted graphs? The paper states the attention walk framework for unweighted graphs only, but i'd like to use it for such types of networks.
Thank you for your attention.

Nan parameters

Thanks for your pytorch code. I found that my parameters become Nan during training.
Nan parameters include model.left_factors, model.right_factors, model.attention. All the entries of them become Nan during training. And also the loss.
I'm trying to find the reason. I would appreciate it if you could give me some help or hints.

problem with being killed

Hi, I tried to train the model with new dataset which have about 60000 nodes,
but I have a problem of getting Killed suddenly. Do you have any idea why?
Thanks :)
image

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.