QMNIST¶
- class torchvision.datasets.QMNIST(root: Union[str, Path], what: Optional[str] = None, compat: bool = True, train: bool = True, **kwargs: Any)[source]¶
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。
train (bool,optional,compatibility) – 當未指定引數 ‘what’ 時,此布林值決定是載入訓練集還是測試集。預設為 True。
download (bool, optional) – 如果為 True,則從網際網路下載資料集並將其放在根目錄中。如果資料集已下載,則不會再次下載。
transform (callable, optional) – 一個函式/變換,接受 PIL 影像並返回變換後的版本。例如,
transforms.RandomCrop。target_transform (callable, optional) – 一個函式/變換,接受目標並對其進行變換。
- 特殊成員: