Prepares the dog vs cats dataset available in Kaggle here

dogs_vs_cats_dataset(
  root,
  split = "train",
  download = FALSE,
  ...,
  transform = NULL,
  target_transform = NULL
)

Arguments

root

path to the data location

split

string. 'train' or 'submission'

download

whether to download or not

...

Currently unused.

transform

function that takes a torch tensor representing an image and return another tensor, transformed.

target_transform

function that takes a scalar torch tensor and returns another tensor, transformed.

Value

A torch::dataset() ready to be used with dataloaders.

Examples

if (torch::torch_is_installed() && FALSE) {
dogs_cats <- dogs_vs_cats_dataset("./data", token = "path/to/kaggle.json",
                                  download = TRUE)
length(dogs_cats)
}