Comments (5)
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.
Thank you for your timely reply. Could you kindly suggest how to set node attribute?
from deephypergraph.
If you don't have the node attribute, you can try the following ways:
- initialize the vertex feature with the normal distribution and set it as trainable parameters. (Common in recommender system)
- initialize the vertex feature with the normal distribution.
- 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)
- 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.
Thanks. If I want to set a numeric vector (degree) as node attribute. How to assign the numbers to nodes?
from deephypergraph.
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)
- 如何利用DHG实现整图分类任务 HOT 4
- About Directed Hypergraph HOT 1
- adaptive fusion和coequal fusion的文档问题 HOT 2
- How to use HGNN+ for RL
- mini-batches training for node classification on hypergraph
- Unable to install dhg using pip HOT 2
- CoauthorshipCora dataset label error HOT 1
- 请帮忙看一下画图代码draw_hypergraph()的参数无法调整如v_line_width和e_line_width,限制输入的格式错了,修改也没变化。 HOT 2
- 我针对你的超图写了个邻接矩阵的接口,想请老哥帮忙看看写的对不对?我自己也做了个些测试,输出的挺对,你介意合并不? HOT 2
- 中文文档有误
- 大型图的处理
- torch.topk 函数设置 largest=False 是为了找到最小的距离,即最近的邻居。这种方法可能比转换张量为 numpy 数组并使用 scipy.spatial.cKDTree 更有效,因为它避免了 CPU 和 GPU 之间的数据传输。 HOT 1
- 如何获取训练后节点的向量?
- e_weight=None,agg='softmax' 时Graph类v2v中x=torch.sparse.mm(P,dim=1)应该是x=torch.sparse.softmax(P,dim=1)
- Didn't concat node's vector with hyperedge's vector before computing the attention of UniGATConv
- How to get a directed hypergraph HOT 2
- 超图实现具有不同超边权重的超图卷积模型
- 关于UniGCN在计算超边的度的平均值,这是否是一个bug
- 您好在使用dhg.models.HGNN出现torch.sparse_coo_tensor的索引超出我的张量尺寸范围,具体的bug如下 HOT 1
- Can we generate a corresponding hypergraph dataset based on a real-world GNN graph embedding dataset?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deephypergraph.