捷徑

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 (字串) – 資料集有 6 種不同的分割方式:byclassbymergebalancedlettersdigitsmnist。此引數指定要使用哪一種。

  • train (bool, optional) – 若為 True,則從 training.pt 建立資料集,否則從 test.pt 建立。

  • download (bool, optional) – 若為 True,則從網路下載資料集並放入根目錄。若資料集已下載,則不會再次下載。

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

  • target_transform (callable, optional) – 一個函數/轉換,接受目標並轉換它。

特殊成員:

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

index (int) – 索引

返回值:

(image, target),其中 target 是目標類別的索引。

返回類型:

tuple

文件

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources