- class Graph(*args: Any, **kwargs: Any)
Bases:
InMemoryDataset
Read graph data from txt files and learning structure (denoising) with adjust function. The data can be either one graph or the list of graphs. The data should be located in root/name/raw directory
For one graph, data should contain three files:
attrs.txt with N lines, each line means attributes of corresponding node, attributes separated from each other with ‘,’.
edges.txt consists of two columns of nodes separeted with ‘,’, each row of this table is a pair of vertices connected by an edge.
labels.txt is a column of numbers, meaning labels of nodes. The size of this column is the size of input graph.
For list of graphs, data should contain 3*M similar files, where M is the number of graphs in dataset.
Denoising now is possible for datasets consisting of ONE graph, for Node Classification tasks.
- Parameters:
name – (string) Name of your dataset,
root – (string): Root directory where the raw dataset is located and processed graph should be saved.
transform – (callable, optional): A function/transform that takes in an torch_geometric.data.Data object and returns a transformed version. The data object will be transformed before every access. (default: None)
pre_transform – (callable, optional): A function/transform that takes in an torch_geometric.data.Data object and returns a transformed version. The data object will be transformed before being saved to disk. (default: None)
adjust_flag – (bool): When set to True, the graph is denoised (default: True)
sigma_u – (float): Variance of randomly generated representations of nodes, required if adjust_flag = True (default: 0.7)
sigma_e – (float, optional) Variance of randomly generated noise, required if adjust_flag = True (default: 0.4)
- download() None
Download the data from the link given
- process() None
Process the raw files of the input data
- property processed_file_names: List[str]
Return the name of the file of the processed input graph
return: ([str]): the name of the processed file
- property raw_file_names: List[str]
Find str names of the raw input data files
- Returns:
(list): List of str names