We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the code snippet below This second example is about loading the dataset as a GNN with random data and classes:
This second example is about loading the dataset as a GNN with random data and classes:
import random from torch_geometric.utils import from_networkx import numpy as np def to_torch_randomdata(dataset, features, classes): for d in dataset: G = d["graph"] for n in G.nodes(): G.nodes[n]['features'] = list(np.random.rand(features).astype(np.float32)) G.nodes[n]['classes'] = random.randint(0,classes - 1) gnn = from_networkx(G) gnn = to_sparse(gnn) yield {"name": d["name"], "gnn": gnn} dataset = to_torch_randomdata(load_dataset("<dataset_folder>"), 10, 2)
The function to_sparse is undefined.
to_sparse
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In the code snippet below
This second example is about loading the dataset as a GNN with random data and classes:
The function
to_sparse
is undefined.The text was updated successfully, but these errors were encountered: