捷徑

FashionMNIST

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

Fashion-MNIST 資料集。

參數:
  • root (str 或 pathlib.Path) – 資料集的根目錄,其中存在 FashionMNIST/raw/train-images-idx3-ubyteFashionMNIST/raw/t10k-images-idx3-ubyte

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

  • 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(元組)

文件

取得 PyTorch 的全面開發者文件

檢視文件

教學

取得適合初學者和進階開發者的深入教學

檢視教學

資源

尋找開發資源並獲得問題解答

檢視資源