QMNIST¶
- class torchvision.datasets.QMNIST(root: Union[str, Path], what: Optional[str] = None, compat: bool = True, train: bool = True, **kwargs: Any)[源代码]¶
QMNIST 数据集。
- 参数:
root (str 或
pathlib.Path
) – 数据集的根目录,其raw
子目录包含数据集的二进制文件。what (string,optional) – 可以是 ‘train’, ‘test’, ‘test10k’, ‘test50k’, 或 ‘nist’,分别对应于与 MNIST 兼容的训练集、60k 的 QMNIST 测试集、匹配 MNIST 测试集的 10k QMNIST 示例、剩余的 50k QMNIST 测试示例,或所有 NIST 数字。默认是根据兼容性参数 ‘train’ 选择 ‘train’ 或 ‘test’。
compat (bool,optional) – 一个布尔值,指示每个示例的目标是类号(为了与 MNIST 数据加载器兼容)还是包含完整 QMNIST 信息的 torch 向量。默认为 True。
train (bool,optional,compatibility) – 当未指定 ‘what’ 参数时,此布尔值决定加载训练集还是测试集。默认为:True。
download (bool, optional) – 如果为 True,则从互联网下载数据集并将其放入根目录。如果数据集已下载,则不会再次下载。
transform (callable, optional) – 一个函数/变换,接受 PIL 图像并返回转换后的版本。例如,
transforms.RandomCrop
target_transform (可调用对象, 可选) – 一个函数/变换,接受目标并对其进行变换。
- 特殊成员: