Skip to content

Autoencoder Article is modifying .getitem() but actually using .getbatch() #159

Description

@cregouby

Current Situation

The AutoEncoder exemple in

# Modify the MNIST dataset so the target is identical to the input.
mnist_dataset2 <- torch::dataset(
inherit = mnist_dataset,
.getitem = function(i) {
output <- super$.getitem(i)
output$y <- output$x
output
}
)
train_ds <- mnist_dataset2(
dir,
download = TRUE,
transform = transform_to_tensor
)
test_ds <- mnist_dataset2(
dir,
train = FALSE,
transform = transform_to_tensor
)
train_dl <- dataloader(train_ds, batch_size = 128, shuffle = TRUE)
test_dl <- dataloader(test_ds, batch_size = 128)

is modifying the torchvision::mnist_dataset$.getitem() whereas using the torchvision::mnist_dataset$.getbatch() through dataloader(batch_size = 128)

This prevent the development of .getbatch() feature in the torchvision::mnist_dataset() function

Expected Situation

The Autoencoder should switch to reconfiguring the .getbatch() or use dataloaders with (batch_size = 1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions