快捷方式

KMNIST

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

Kuzushiji-MNIST 資料集。

引數:
  • root (str or pathlib.Path) – 資料集的根目錄,KMNIST/raw/train-images-idx3-ubyteKMNIST/raw/t10k-images-idx3-ubyte 位於此處。

  • train (bool, optional) – 如果為 True,則從 train-images-idx3-ubyte 建立資料集;否則從 t10k-images-idx3-ubyte 建立。

  • transform (callable, optional) – 一個函式/轉換,接受 PIL 影像並返回轉換後的版本。例如,transforms.RandomCrop

  • target_transform (callable, optional) – 一個函式/轉換,接受目標並對其進行轉換。

  • download (bool, optional) – 如果為 True,則從網際網路下載資料集並將其放置在根目錄中。如果資料集已下載,則不會再次下載。

特殊成員:

__getitem__(index: int) Tuple[Any, Any]
引數:

index (int) – 索引

返回:

(影像, 目標)元組,其中目標是目標類別的索引。

返回型別:

tuple

文件

查閱 PyTorch 的完整開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源