private
methoddataloaders
— function
methoddataloaders(data, method)
methoddataloaders(traindata, validdata, method[, batchsize; shuffle = true, dlkwargs...])
Create training and validation DataLoader
s from two data containers (traindata, valdata)
.
If only one container data
is passed, splits it into two with pctgvalid
% of the data
going into the validation split.
Keyword arguments
batchsize = 16
shuffle = true
: Whether to shuffle the training data containervalidbsfactor = 2
: Factor to multiply batchsize for validation data loader with (validation batches can be larger since no GPU memory is needed for the backward pass)
All remaining keyword arguments are passed to DataLoader
.
Examples
Basic usage:
traindl, validdl = methoddataloaders(data, method, 128)
Explicit validation data container and no shuffling of training container:
traindl, validdl = methoddataloaders(traindata, validdata, method, shuffle=false)
Customizing the DataLoader
traindl, validdl = methoddataloaders(data, method, parallel=false, buffered=false)