Data Core Utils

core classes & helpers

source

DataModule

 DataModule (batch_size:int=64, num_workers:int=0, pin_memory:bool=False,
             persistent_workers:bool=False, shuffle:bool=True)

Helper class that provides a standard way to create an ABC using inheritance.

Type Default Details
batch_size int 64 size of compute batch
num_workers int 0 num_workers equal 0 means that it’s the main process that will do the data loading when needed, num_workers equal 1 is the same as any n, but you’ll only have a single worker, so it might be slow
pin_memory bool False If you load your samples in the Dataset on CPU and would like to push it during training to the GPU, you can speed up the host to device transfer by enabling pin_memory. This lets your DataLoader allocate the samples in page-locked memory, which speeds-up the transfer
persistent_workers bool False
shuffle bool True shuffle training data
Returns None

source

split_train_valid_test

 split_train_valid_test (dataset:torch.utils.data.dataset.Dataset,
                         splits:List[float])