Giter Club home page Giter Club logo

Comments (5)

yifanfeng97 avatar yifanfeng97 commented on June 3, 2024

Hi, you can extract the edge list and the number of vertices from G of networkx. Then, you can construct a DHG's Graph with the default construction function https://deephypergraph.readthedocs.io/en/0.9.3/api/dhg.html#dhg.Graph .
We will add the transform function of structures from igraph and networkx libraries in the next version. ^^

from deephypergraph.

wanglu2014 avatar wanglu2014 commented on June 3, 2024

Thank you for your timely reply. Could you kindly suggest how to set node attribute?

from deephypergraph.

yifanfeng97 avatar yifanfeng97 commented on June 3, 2024

If you don't have the node attribute, you can try the following ways:

  1. initialize the vertex feature with the normal distribution and set it as trainable parameters. (Common in recommender system)
  2. initialize the vertex feature with the normal distribution.
  3. initialize the vertex feature with a one-hot encoded vector. (you can encode the degree of each vertex or directly use a identity matrix as the vertex feature)
  4. train a auto encoder: the input is the adjacency matrix A and the output is the same. initialize the vertex feature with the hidden embeddings.

from deephypergraph.

wanglu2014 avatar wanglu2014 commented on June 3, 2024

Thanks. If I want to set a numeric vector (degree) as node attribute. How to assign the numbers to nodes?

from deephypergraph.

yifanfeng97 avatar yifanfeng97 commented on June 3, 2024

You can try to transform the degree to a one-hot vector. Refer to this https://github.com/weihua916/powerful-gnns/blob/master/util.py#L118

from deephypergraph.

Related Issues (20)

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.