捷徑

QMNIST

class torchvision.datasets.QMNIST(root: Union[str, Path], what: Optional[str] = None, compat: bool = True, train: bool = True, **kwargs: Any)[原始碼]

QMNIST 資料集。

參數:
  • root (str 或 pathlib.Path) – 資料集的根目錄,其 raw 子目錄包含資料集的二進位檔案。

  • what (string,optional) – 可以是 ‘train’、‘test’、‘test10k’、‘test50k’ 或 ‘nist’,分別表示與 mnist 相容的訓練集、60k qmnist 測試集、與 mnist 測試集匹配的 10k qmnist 範例、剩餘的 50k qmnist 測試範例,或所有 nist 數字。預設值會根據相容性引數 ‘train’ 選擇 ‘train’ 或 ‘test’。

  • compat (bool,optional) – 一個布林值,表示每個範例的目標是類別編號(為了與 MNIST 資料載入器相容)還是包含完整 qmnist 資訊的 torch 向量。預設值 = True。

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

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

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

  • train (bool,optional,compatibility) – 當未指定引數 'what' 時,此布林值決定是否載入訓練集或測試集。預設值:True。

特殊成員:

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

index (int) – 索引

傳回:

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

傳回類型:

tuple

文件

取得 PyTorch 的完整開發人員文件

檢視文件

教學

取得針對初學者和進階開發人員的深入教學

檢視教學

資源

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

檢視資源