WARNING
该页面尚未翻译。 以下内容为英文原版。
tensorplay.vision.datasets.mnist
Classes
class MNIST [source]
python
MNIST(root=None, train=True, transform=None, target_transform=None, download=False)Bases: VisionDataset
MNIST <http://yann.lecun.com/exdb/mnist/>_ Dataset.
Args
- root (
string, optional): Root directory of dataset whereMNIST/processed/training.ptandMNIST/processed/test.ptexist. If None, uses default cache directory. - train (
bool, optional): If True, creates dataset fromtraining.pt, otherwise fromtest.pt. - download (
bool, optional): If true, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again. - transform (
callable, optional): A function/transform that takes in an PIL image and returns a transformed version. E.g,transforms.RandomCrop - target_transform (
callable, optional): A function/transform that takes in the target and transforms it.
Methods
__init__(self, root=None, train=True, transform=None, target_transform=None, download=False) [source]
Initialize self. See help(type(self)) for accurate signature.
download(self) [source]
Download the MNIST data if it doesn't exist in processed_folder already.
