Shortcuts

pl_bolts.datamodules.vision_datamodule module

class pl_bolts.datamodules.vision_datamodule.VisionDataModule(data_dir=None, val_split=0.2, num_workers=16, normalize=False, batch_size=32, seed=42, shuffle=False, pin_memory=False, drop_last=False, *args, **kwargs)[source]

Bases: pytorch_lightning.LightningDataModule

Parameters
  • data_dir (Optional[str]) – Where to save/load the data

  • val_split (Union[int, float]) – Percent (float) or number (int) of samples to use for the validation split

  • num_workers (int) – How many workers to use for loading data

  • normalize (bool) – If true applies image normalize

  • batch_size (int) – How many samples per batch to load

  • seed (int) – Random seed to be used for train/val/test splits

  • shuffle (bool) – If true shuffles the train data every epoch

  • pin_memory (bool) – If true, the data loader will copy Tensors into CUDA pinned memory before returning them

  • drop_last (bool) – If true drops the last incomplete batch

_data_loader(dataset, shuffle=False)[source]
Return type

DataLoader

_get_splits(len_dataset)[source]

Computes split lengths for train and validation set

Return type

List[int]

_split_dataset(dataset, train=True)[source]

Splits the dataset into train and validation set

Return type

Dataset

abstract default_transforms()[source]

Default transform for the dataset

Return type

Callable

prepare_data(*args, **kwargs)[source]

Saves files to data_dir

Return type

None

setup(stage=None)[source]

Creates train, val, and test dataset

Return type

None

test_dataloader(*args, **kwargs)[source]

The test dataloader

Return type

Union[DataLoader, List[DataLoader]]

train_dataloader(*args, **kwargs)[source]

The train dataloader

Return type

DataLoader

val_dataloader(*args, **kwargs)[source]

The val dataloader

Return type

Union[DataLoader, List[DataLoader]]

EXTRA_ARGS: dict = {}[source]
dataset_cls: type = None[source]

Dataset class to use

dims: tuple = None[source]

A tuple describing the shape of the data

name: str = ''[source]
Read the Docs v: 0.3.0
Versions
latest
stable
0.3.0
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.