cogdl.data.dataloader

Module Contents

Classes

DataLoader

Data loader which merges data objects from a

DataListLoader

Data loader which merges data objects from a

DenseDataLoader

Data loader which merges data objects from a

class cogdl.data.dataloader.DataLoader(dataset, batch_size=1, shuffle=True, **kwargs)[source]

Bases: torch.utils.data.DataLoader

Data loader which merges data objects from a cogdl.data.dataset to a mini-batch.

Args:

dataset (Dataset): The dataset from which to load the data. batch_size (int, optional): How may samples per batch to load.

(default: 1)

shuffle (bool, optional): If set to True, the data will be

reshuffled at every epoch (default: True)

class cogdl.data.dataloader.DataListLoader(dataset, batch_size=1, shuffle=True, **kwargs)[source]

Bases: torch.utils.data.DataLoader

Data loader which merges data objects from a cogdl.data.dataset to a python list.

Note

This data loader should be used for multi-gpu support via cogdl.nn.DataParallel.

Args:

dataset (Dataset): The dataset from which to load the data. batch_size (int, optional): How may samples per batch to load.

(default: 1)

shuffle (bool, optional): If set to True, the data will be

reshuffled at every epoch (default: True)

class cogdl.data.dataloader.DenseDataLoader(dataset, batch_size=1, shuffle=True, **kwargs)[source]

Bases: torch.utils.data.DataLoader

Data loader which merges data objects from a cogdl.data.dataset to a mini-batch.

Note

To make use of this data loader, all graphs in the dataset needs to have the same shape for each its attributes. Therefore, this data loader should only be used when working with dense adjacency matrices.

Args:

dataset (Dataset): The dataset from which to load the data. batch_size (int, optional): How may samples per batch to load.

(default: 1)

shuffle (bool, optional): If set to True, the data will be

reshuffled at every epoch (default: True)