grakelx.graph_from_torch_geometric

grakelx.graph_from_torch_geometric(data, node_one_hot=False, edge_one_hot=False, ignore_y=False)[source][source]

Produces a collection of Graph Objects from a collection of csv files.

A function for helping a user that has a bunch of graph csv files make a collection for grakel input.

Parameters:
dataUnion[torch_geometric.data.Data, torch_geometric.data.batch.DataBatch]

Input should be a torch_geometric data object to be converted.

node_one_hotbool, default=False

Whether each element of data.x should be treated as a one-hot vector.

edge_one_hotbool, default=False

Whether each element of data.edge_attr should be treated as a one-hot vector.

ignore_ybool, default=False

Argument determining whether to return the labels connected to the input graphs.

Returns:
grakel_graphsdict

Returns a dictionary with keys:

  • ‘graph’ : list[grakel.Graph]

    • If input is torch_geometric.data.Data returns a single element.

    • If input is torch_geometric.data.Data returns a list of graphs.

  • ‘y’ : list[int]

    • List of labels of graphs.

    • If ignore_y is True this argument is ommited.