gammagl.loader.DataLoader

class DataLoader(dataset: Dataset | List[Graph], batch_size: int = 1, shuffle: bool = False, follow_batch: List[str] | None = None, exclude_keys: List[str] | None = None, **kwargs)[source]

A data loader which merges data objects from a gammagl.data.Dataset to a mini-batch. Data objects can be either of type Graph or HeteroGraph.

Parameters:
  • dataset (dataset) – The dataset from which to load the data.

  • batch_size (int, optional) – How many samples per batch to load. (default: 1)

  • shuffle (bool, optional) – If set to True, the data will be reshuffled at every epoch. (default: False)

  • follow_batch (list[str], optional) – Creates assignment batch vectors for each key in the list. (default: None)

  • exclude_keys (list[str], optional) – Will exclude each key in the list. (default: None)

  • **kwargs (optional) – Additional arguments of tensorlayerx.dataflow.DataLoader.