| mnist_dataset | R Documentation |
Prepares various MNIST-style image classification datasets and optionally downloads them. Images are thumbnails images of 28 x 28 pixels of grayscale values encoded as integer.
mnist_dataset(
root = tempdir(),
train = TRUE,
transform = NULL,
target_transform = NULL,
download = FALSE
)
kmnist_dataset(
root = tempdir(),
train = TRUE,
transform = NULL,
target_transform = NULL,
download = FALSE
)
qmnist_dataset(
root = tempdir(),
split = "train",
transform = NULL,
target_transform = NULL,
download = FALSE
)
fashion_mnist_dataset(
root = tempdir(),
train = TRUE,
transform = NULL,
target_transform = NULL,
download = FALSE
)
emnist_collection(
root = tempdir(),
split = "test",
dataset = "balanced",
transform = NULL,
target_transform = NULL,
download = FALSE
)
emnist_dataset(kind, ...)
root |
Root directory for dataset storage. The dataset will be stored under |
train |
Logical. If TRUE, use the training set; otherwise, use the test set. Not applicable to all datasets. |
transform |
Optional. A function that takes an image and returns a transformed version (e.g., normalization, cropping). |
target_transform |
Optional. A function that transforms the label. |
download |
Logical. If TRUE, downloads the dataset to |
split |
Character. Used in |
dataset |
one of "byclass", "bymerge", "balanced" representing the subset of emnist collection
made of a set of classes. You can look at dataset attribute |
kind |
the |
... |
the other |
MNIST: Original handwritten digit dataset.
Fashion-MNIST: Clothing item images for classification.
Kuzushiji-MNIST: Japanese cursive character dataset.
QMNIST: Extended MNIST with high-precision NIST data.
EMNIST: A collection of letters and digits with multiple datasets and splits.
A torch dataset object, where each items is a list of x (image) and y (label).
kmnist_dataset(): Kuzushiji-MNIST cursive Japanese character dataset.
qmnist_dataset(): Extended MNIST dataset with high-precision test data (QMNIST).
fashion_mnist_dataset(): Fashion-MNIST clothing image dataset.
emnist_collection(): EMNIST collection with digits and letters arranged in multiple datasets.
emnist_dataset(): Deprecated. Please use emnist_collection.
datasets for emnist_collection()"byclass": 62 classes (digits + uppercase + lowercase)
"bymerge": 47 classes (merged uppercase and lowercase)
"balanced": 47 classes, balanced digits and letters
"letters": 26 uppercase letters
"digits": 10 digit classes
"mnist": Standard MNIST digit classes
splits for qmnist_dataset()"train": 60,000 training samples (MNIST-compatible)
"test": Extended test set
"nist": Full NIST digit set
Other classification_dataset:
caltech_dataset,
cifar10_dataset(),
eurosat_dataset(),
fer_dataset(),
fgvc_aircraft_dataset(),
flowers102_dataset(),
image_folder_dataset(),
lfw_dataset,
oxfordiiitpet_dataset(),
places365_dataset(),
tiny_imagenet_dataset(),
whoi_plankton_dataset(),
whoi_small_coralnet_dataset()
## Not run:
ds <- mnist_dataset(download = TRUE)
item <- ds[1]
item$x # image
item$y # label
qmnist <- qmnist_dataset(split = "train", download = TRUE)
item <- qmnist[1]
item$x
item$y
emnist <- emnist_collection(dataset = "balanced", split = "test", download = TRUE)
item <- emnist[1]
item$x
item$y
kmnist <- kmnist_dataset(download = TRUE, train = FALSE)
fmnist <- fashion_mnist_dataset(download = TRUE, train = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.