捷徑

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, optional) – 如果為 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) – 索引

Returns(返回值):

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

Return type(返回類型):

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(查看資源)