The PyG data module, imported from torch_geometric.data, creates, inspects, and manipulates graph data objects for GNN workflows. Its objects can combine node, edge, subgraph, and graph-level attributes. section 8.3.4
Loading a NetworkX graph
Convert an existing NetworkX graph with data = utils.from_networkx(social_graph), or construct Data directly after indexing nodes and edges.
Figure 8.15 Steps to preprocess data in PyG. From raw files, there are essentially two paths to prep data for ingestion by a PyG algorithm. The first path, shown here, directly creates an iterator of data instances, which is used by the dataloader. The second path mimics the first but performs this process within the dataloader class.
Trace the two ingestion paths from raw files to iterable data instances: direct preprocessing or preprocessing inside a dataloader. section 8.3.4
