快捷方式

KMNIST

class torchvision.datasets.KMNIST(root: Union[str, Path], train: bool = True, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[source]

Kuzushiji-MNIST 数据集。

参数:
  • root (str 或 pathlib.Path) – 数据集的根目录,其中存在 KMNIST/raw/train-images-idx3-ubyteKMNIST/raw/t10k-images-idx3-ubyte

  • train (bool, 可选) – 如果为 True,则从 train-images-idx3-ubyte 创建数据集,否则从 t10k-images-idx3-ubyte 创建。

  • download (bool, 可选) – 如果为 True,则从互联网下载数据集并将其放在根目录中。如果数据集已下载,则不会再次下载。

  • transform (callable, 可选) – 接收 PIL 图像并返回转换后版本的功能/转换。例如,transforms.RandomCrop

  • target_transform (callable, 可选) – 接收目标并转换它的功能/转换。

特殊成员:

__getitem__(index: int) Tuple[Any, Any]
参数:

index (int) – 索引

返回:

(image, target),其中 target 是目标类别的索引。

返回类型:

tuple

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

获取面向初学者和高级开发者的深入教程

查看教程

资源

查找开发资源并获得您的问题解答

查看资源