THUDM / CogDL

CogDL: A Comprehensive Library for Graph Deep Learning (WWW 2023)
https://cogdl.ai
MIT License
1.73k stars 315 forks source link

How to use cora dataset(or other dataset in the package) in the generate embedding pipeline? #397

Closed Song-xx closed 2 years ago

Song-xx commented 2 years ago

❓ Questions & Help

I am using "cogdl/example/generate_emb.py" to generate embedding(use gnn algorithm). But I can not find out where to set the parameters or how to do this?

It also can be expressed in another way: In the "cogdl/example/generate_emb.py" ,the code

outputs = generator(edge_index, x=np.random.randn(8, 8))

I think the edge_index is the adjacency matrix and x is the feature, how can I use cora to fill into the function.(can I download the cora and fill it by myself?)

thanks a lot

Song-xx commented 2 years ago

I maybe found one possible solution. one can use:

from cogdl.datasets import build_dataset_from_name
cora = build_dataset_from_name('cora')

to get the cora data object. then cora.data.edge_index, cora.data.x is the adjacency matrix and the feature.