快捷方式

EMNIST

class torchvision.datasets.EMNIST(root: Union[str, Path], split: str, **kwargs: Any)[原始碼]

EMNIST 資料集。

引數:
  • root (str 或 pathlib.Path) – 資料集的根目錄,其中包含 EMNIST/raw/train-images-idx3-ubyteEMNIST/raw/t10k-images-idx3-ubyte

  • split (string) – 資料集有 6 種不同的分割方式:byclassbymergebalancedlettersdigitsmnist。此引數指定使用哪一種。

  • train (bool, 可選) – 如果為 True,則從 training.pt 建立資料集,否則從 test.pt 建立。

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

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

  • target_transform (callable, 可選) – 一個函式/轉換,它接收目標並對其進行轉換。

特殊成員:

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

index (int) – 索引

返回:

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

返回型別:

tuple

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深度教程

檢視教程

資源

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

檢視資源