Skip to content

Commit 15923ca

Browse files
authored
Merge pull request #1521 from rstudio/ggplot2-3.4.0-compat
Updates for ggplot 3.4.0 with `plot(history, theme_bw = TRUE)`
2 parents 80e9434 + ce35a73 commit 15923ca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

R/history.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ plot.keras_training_history <- function(x, y, metrics = NULL, method = c("auto",
113113
environment(smooth_args$formula) <- baseenv()
114114

115115
if (theme_bw) {
116-
smooth_args$size <- 0.5
116+
smooth_args$linewidth <- 0.5
117117
smooth_args$color <- "gray47"
118118
p <- p +
119119
ggplot2::theme_bw() +

tests/testthat/test-history.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ test_succeeds("as.data.frame works for history with early stopping", {
55

66
early_stop <- callback_early_stopping(monitor = "loss", patience = 1)
77

8-
model <- keras_model_sequential() %>%
9-
layer_dense(1, input_shape = 1)
8+
model <- keras_model_sequential(input_shape = 1) %>%
9+
layer_dense(1)
1010

1111
model %>% compile(loss = "mse", optimizer = "adam")
1212

0 commit comments

Comments
 (0)