dataloader

Base Dataloader class(es) used in graphnet.

graphnet.data.dataloader.collate_fn(graphs)[source]

Remove graphs with less than two DOM hits.

Should not occur in “production.

Return type:

Batch

Parameters:

graphs (List[Data])

graphnet.data.dataloader.do_shuffle(selection_name)[source]

Check whether to shuffle selection with name selection_name.

Return type:

bool

Parameters:

selection_name (str)

class graphnet.data.dataloader.DataLoader(dataset, batch_size, shuffle, num_workers, persistent_workers, collate_fn=<function collate_fn>, prefetch_factor, **kwargs)[source]

Bases: DataLoader

Class for loading data from a Dataset.

Construct DataLoader.

Parameters:
  • dataset (Dataset[T_co])

  • batch_size (int | None)

  • shuffle (bool)

  • num_workers (int)

  • persistent_workers (bool)

  • collate_fn (Callable)

  • prefetch_factor (int | None)

  • kwargs (Any)

classmethod from_dataset_config(config, **kwargs)[source]

Construct DataLoader`s based on selections in `DatasetConfig.

Return type:

Union[DataLoader, Dict[str, DataLoader]]

Parameters: