taskdataloaders

function defined in module FastAI


			taskdataloaders(data, task[, batchsize])
taskdataloaders(traindata, validdata, task[, batchsize; shuffle = true, dlkwargs...])

Create training and validation DataLoaders 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.

Arguments

Positional:

  • batchsize = 16

Keyword:

  • shuffle = true: Whether to shuffle the training data container

  • validbsfactor = 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
			 
			=
			 
			

			taskdataloaders
			(
			data
			,
			 
			task
			,
			 
			128
			)

Explicit validation data container and no shuffling of training container:


			
			
			
			
			traindl
			,
			 
			validdl
			 
			=
			 
			

			taskdataloaders
			(
			traindata
			,
			 
			validdata
			,
			 
			task
			,
			 
			
			shuffle
			=
			false
			)

Customizing the DataLoader


			
			
			
			
			traindl
			,
			 
			validdl
			 
			=
			 
			

			taskdataloaders
			(
			data
			,
			 
			task
			,
			 
			
			parallel
			=
			false
			,
			 
			
			buffered
			=
			false
			)