Input shuffling

Does fastai utilise input shuffling for training as a default?
I have images from a video that are labelled by frame and I want to know whether I need to shuffle them myself (as to avoid correlated images being batched together) or if fastai naturally does this for me?

Yes. By default the shuffle argument is set to true for the training dataset and false to both valid and test datasets.

You can check in the source code (

On line 119, you can see (True,False,False,False) and that corresponds to the argument shuffle=s for the corresponding datasets (train_ds,valid_ds,fix_ds,test_ds)

    def create(cls, train_ds:Dataset, valid_ds:Dataset, test_ds:Optional[Dataset]=None, path:PathOrStr='.', bs:int=64,
               val_bs:int=None, num_workers:int=defaults.cpus, dl_tfms:Optional[Collection[Callable]]=None,
               device:torch.device=None, collate_fn:Callable=data_collate, no_check:bool=False, **dl_kwargs)->'DataBunch':
        "Create a `DataBunch` from `train_ds`, `valid_ds` and maybe `test_ds` with a batch size of `bs`. Passes `**dl_kwargs` to `DataLoader()`"
        datasets = cls._init_ds(train_ds, valid_ds, test_ds)
        val_bs = ifnone(val_bs, bs)
        dls = [DataLoader(d, b, shuffle=s, drop_last=s, num_workers=num_workers, **dl_kwargs) for d,b,s in
               zip(datasets, (bs,val_bs,val_bs,val_bs), (True,False,False,False)) if d is not None]
        return cls(*dls, path=path, device=device, dl_tfms=dl_tfms, collate_fn=collate_fn, no_check=no_check)