dtorchtree.datasets
Description
This module contains a collection of datasets that can be used with the
dtorchtree
module.
The datasets are all simple to load.
Here’s an example of loading the dtorchtree.datasets.IrisDataset
dataset:
from dtorchtree.datasets import IrisDataset
dataset = IrisDataset()
for sample in dataset:
print(sample)
The datasets are all subclasses of dtorch.dataset.JDataset
.
Datasets
- class IrisDataset(dtorch.dataset.JDataset)
- __init__(root: str = './data', split: Tuple[str] | str = 'train', download: bool = False)
- Parameters:
root – The root directory to store the dataset.
split – The split to use. Can be either
'train'
or'test'
.download – Whether to download the dataset if it doesn’t exist. Will be ignored if the dataset already exists.
- Raises:
ValueError – If
split
is not'train'
or'test'
.
- data: Tuple[torch.Tensor, torch.Tensor]
X, y data.