Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebffischer committed Jul 27, 2023
1 parent b5710f1 commit 102b5e1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions R/CallbackSetHistory.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ CallbackSetHistory = R6Class("CallbackSetHistory",
stopf("No eligible measures to plot for set '%s'.", set)
}


epoch = score = measure = NULL
if (ncol(data) == 2L) {
ggplot2::ggplot(data = data, ggplot2::aes(x = epoch, y = !!rlang::sym(measures))) +
Expand All @@ -84,7 +83,7 @@ CallbackSetHistory = R6Class("CallbackSetHistory",
theme
} else {
data = melt(data, id.vars = "epoch", variable.name = "measure", value.name = "score")
ggplot2::ggplot(data = data, ggplot2::aes_string(x = epoch, y = score, color = measure)) +
ggplot2::ggplot(data = data, ggplot2::aes(x = epoch, y = score, color = measure)) +
viridis::scale_color_viridis(discrete = TRUE) +
ggplot2::geom_line() +
ggplot2::geom_point() +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ devtools::load_all()

dir = tempfile()
ci = col_info(tsk("tiny_imagenet")$backend$backend)
saveRDS(ci, "./data/col_info/tiny_imagenet.rds")
saveRDS(ci, "./inst/col_info/tiny_imagenet.rds")
Binary file modified inst/col_info/tiny_imagenet.rds
Binary file not shown.
4 changes: 3 additions & 1 deletion tests/testthat/test_TaskClassif_tiny_imagenet.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ skip_on_cran()
test_that("tiny_imagenet task works", {
withr::local_options(mlr3torch.cache = TRUE)
task = tsk("tiny_imagenet")
dt = task$data()

expect_true("tiny-imagenet-200" %in% list.files(file.path(get_cache_dir(), "datasets", "tiny_imagenet", "raw")))
expect_true("data.rds" %in% list.files(file.path(get_cache_dir(), "datasets", "tiny_imagenet")))

dt = task$data()

expect_equal(task$backend$nrow, 120000)
expect_equal(task$backend$ncol, 4)
expect_data_table(dt, ncols = 2, nrows = 100000)
Expand Down

0 comments on commit 102b5e1

Please sign in to comment.