Shortcuts

Datasets

Collection of useful datasets


Debugging

Use these datasets to debug

DummyDataset

class pl_bolts.datasets.dummy_dataset.DummyDataset(*shapes, num_samples=10000)[source]

Bases: torch.utils.data.Dataset

Generate a dummy dataset

Example

>>> from pl_bolts.datasets import DummyDataset
>>> from torch.utils.data import DataLoader
>>> # mnist dims
>>> ds = DummyDataset((1, 28, 28), (1, ))
>>> dl = DataLoader(ds, batch_size=7)
>>> # get first batch
>>> batch = next(iter(dl))
>>> x, y = batch
>>> x.size()
torch.Size([7, 1, 28, 28])
>>> y.size()
torch.Size([7, 1])
Parameters
  • *shapes – list of shapes

  • num_samples (int) – how many samples to use in this dataset

DummyDetectionDataset

class pl_bolts.datasets.dummy_dataset.DummyDetectionDataset(img_shape=(3, 256, 256), num_boxes=1, num_classes=2, num_samples=10000)[source]

Bases: torch.utils.data.Dataset

Generate a dummy dataset for detection

Example

>>> from pl_bolts.datasets import DummyDetectionDataset
>>> from torch.utils.data import DataLoader
>>> ds = DummyDetectionDataset()
>>> dl = DataLoader(ds, batch_size=7)
Parameters
  • *shapes – list of shapes

  • num_samples (int) – how many samples to use in this dataset

RandomDataset

class pl_bolts.datasets.dummy_dataset.RandomDataset(size, num_samples=250)[source]

Bases: torch.utils.data.Dataset

Generate a dummy dataset

Example

>>> from pl_bolts.datasets import RandomDataset
>>> from torch.utils.data import DataLoader
>>> ds = RandomDataset(10)
>>> dl = DataLoader(ds, batch_size=7)
Parameters
  • size (int) – tuple

  • num_samples (int) – number of samples

RandomDictDataset

class pl_bolts.datasets.dummy_dataset.RandomDictDataset(size, num_samples=250)[source]

Bases: torch.utils.data.Dataset

Generate a dummy dataset with a dict structure

Example

>>> from pl_bolts.datasets import RandomDictDataset
>>> from torch.utils.data import DataLoader
>>> ds = RandomDictDataset(10)
>>> dl = DataLoader(ds, batch_size=7)
Parameters
  • size (int) – tuple

  • num_samples (int) – number of samples

RandomDictStringDataset

class pl_bolts.datasets.dummy_dataset.RandomDictStringDataset(size, num_samples=250)[source]

Bases: torch.utils.data.Dataset

Generate a dummy dataset with strings

Example

>>> from pl_bolts.datasets import RandomDictStringDataset
>>> from torch.utils.data import DataLoader
>>> ds = RandomDictStringDataset(10)
>>> dl = DataLoader(ds, batch_size=7)
Parameters
  • size (int) – tuple

  • num_samples (int) – number of samples

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.