synthcity.plugins.core.dataset module
- class ConditionalDataset(data: torch.utils.data.dataset.Dataset, cond: Optional[torch.Tensor] = None)
Bases:
torch.utils.data.dataset.Dataset
Helper dataset for wrapping existing datasets with custom tensors
- Parameters
data – torch.Dataset
cond – Optional Tensor
- class FlexibleDataset(data: torch.utils.data.dataset.Dataset, transform: Optional[torch.nn.modules.module.Module] = None, indices: Optional[list] = None)
Bases:
torch.utils.data.dataset.Dataset
Helper dataset wrapper for post-processing or transforming another dataset. Used for controlling the image sizes for the synthcity models.
The class supports adding custom transforms to existing datasets, and to subsample a set of indices.
- Parameters
data – torch.Dataset
transform – An optional list of transforms
indices – An optional list of indices to subsample
- filter_indices(indices: List[int]) synthcity.plugins.core.dataset.FlexibleDataset
- labels() numpy.ndarray
- numpy() Tuple[numpy.ndarray, numpy.ndarray]
- shape() Tuple
- tensors() Tuple[torch.Tensor, torch.Tensor]
- class NumpyDataset(X: numpy.ndarray, y: numpy.ndarray)
Bases:
torch.utils.data.dataset.Dataset
Helper class for wrapping Numpy arrays in torch Datasets :param X: np.ndarray :param y: np.ndarray