@@ -5,27 +5,27 @@ library(data.table)
55library(torchvision )
66
77# cached
8- constructor_cifar10 = function (path ) {
9- require_namespaces(" torchvision" )
10-
11- torchvision :: cifar10_dataset(root = path , download = TRUE )
12-
13- train_files = file.path(path , " cifar-10-batches-bin" , sprintf(" data_batch_%d.bin" , 1 : 5 ))
14- test_file = file.path(path , " cifar-10-batches-bin" , " test_batch.bin" )
15-
16- # TODO: convert these to the meaningful names
17- train_labels = unlist(map(train_files , read_cifar_labels_batch , type = 10 ))
18-
19- data.table(
20- class = factor (c(train_labels , rep(NA , times = 10000 ))),
21- file = c(rep(train_files , each = 10000 ),
22- rep(test_file , 10000 )),
23- idx_in_file = c(rep(1 : 10000 , 5 ),
24- 1 : 10000 ),
25- split = factor (rep(c(" train" , " test" ), c(50000 , 10000 ))),
26- ..row_id = seq_len(60000 )
27- )
28- }
8+ # constructor_cifar10 = function(path) {
9+ # require_namespaces("torchvision")
10+ #
11+ # torchvision::cifar10_dataset(root = path, download = TRUE)
12+ #
13+ # train_files = file.path(path, "cifar-10-batches-bin", sprintf("data_batch_%d.bin", 1:5))
14+ # test_file = file.path(path, "cifar-10-batches-bin", "test_batch.bin")
15+ #
16+ # # TODO: convert these to the meaningful names
17+ # train_labels = unlist(map(train_files, read_cifar_labels_batch, type = 10))
18+ #
19+ # data.table(
20+ # class = factor(c(train_labels, rep(NA, times = 10000))),
21+ # file = c(rep(train_files, each = 10000),
22+ # rep(test_file, 10000)),
23+ # idx_in_file = c(rep(1:10000, 5),
24+ # 1:10000),
25+ # split = factor(rep(c("train", "test"), c(50000, 10000))),
26+ # ..row_id = seq_len(60000)
27+ # )
28+ # }
2929
3030path <- here :: here(" cache" )
3131
0 commit comments