data.dataset

Module Contents

Classes

Dataset

Dataset base class for creating graph datasets.

Functions

to_list(x)

files_exist(files)

data.dataset.to_list(x)[source]
data.dataset.files_exist(files)[source]
class data.dataset.Dataset(root, transform=None, pre_transform=None, pre_filter=None)[source]

Bases: torch.utils.data.Dataset

Dataset base class for creating graph datasets. See here for the accompanying tutorial.

Args:

root (string): Root directory where the dataset should be saved. transform (callable, optional): A function/transform that takes in an

cogdl.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 cogdl.data.Data object and returns a transformed version. The data object will be transformed before being saved to disk. (default: None)

pre_filter (callable, optional): A function that takes in an

cogdl.data.Data object and returns a boolean value, indicating whether the data object should be included in the final dataset. (default: None)

property raw_file_names(self)[source]

The name of the files to find in the self.raw_dir folder in order to skip the download.

property processed_file_names(self)[source]

The name of the files to find in the self.processed_dir folder in order to skip the processing.

abstract download(self)[source]

Downloads the dataset to the self.raw_dir folder.

abstract process(self)[source]

Processes the dataset to the self.processed_dir folder.

abstract __len__(self)[source]

The number of examples in the dataset.

abstract get(self, idx)[source]

Gets the data object at index idx.

property num_features(self)[source]

Returns the number of features per node in the graph.

property raw_paths(self)[source]

The filepaths to find in order to skip the download.

property processed_paths(self)[source]

The filepaths to find in the self.processed_dir folder in order to skip the processing.

_download(self)[source]
_process(self)[source]
__getitem__(self, idx)[source]

Gets the data object at index idx and transforms it (in case a self.transform is given).

__repr__(self)[source]