Learn R Programming

torchdatasets (version 0.3.1)

dogs_vs_cats_dataset: Dog vs cats dataset

Description

Prepares the dog vs cats dataset available in Kaggle here

Usage

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

Value

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

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.

Examples

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

Run the code above in your browser using DataLab