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

Parameters
  • *shapes – list of shapes

  • num_samples – how many samples to use in this dataset

Example:

from pl_bolts.datasets import DummyDataset

# mnist dims
>>> ds = DummyDataset((1, 28, 28), (1,))
>>> dl = DataLoader(ds, batch_size=7)
...
>>> batch = next(iter(dl))
>>> x, y = batch
>>> x.size()
torch.Size([7, 1, 28, 28])
>>> y.size()
torch.Size([7, 1])

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

Parameters
  • *shapes – list of shapes

  • num_samples – how many samples to use in this dataset

Example:

from pl_bolts.datasets import DummyDetectionDataset

>>> ds = DummyDetectionDataset()
>>> dl = DataLoader(ds, batch_size=7)

RandomDataset

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

Bases: torch.utils.data.Dataset

Generate a dummy dataset

Parameters
  • size – tuple

  • num_samples – number of samples

Example:

from pl_bolts.datasets import RandomDataset

>>> ds = RandomDataset()
>>> dl = DataLoader(ds, batch_size=7)

RandomDictDataset

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

Bases: torch.utils.data.Dataset

Generate a dummy dataset with a dict structure

Parameters
  • size – tuple

  • num_samples – number of samples

Example:

from pl_bolts.datasets import RandomDictDataset

>>> ds = RandomDictDataset()
>>> dl = DataLoader(ds, batch_size=7)

RandomDictStringDataset

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

Bases: torch.utils.data.Dataset

Generate a dummy dataset with strings

Parameters
  • size – tuple

  • num_samples – number of samples

Example:

from pl_bolts.datasets import RandomDictStringDataset

>>> ds = RandomDictStringDataset()
>>> dl = DataLoader(ds, batch_size=7)
Read the Docs v: 0.2.5
Versions
latest
stable
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.1
master_rl
0.1.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.