Skip to content

Commit 5ed9c9b

Browse files
committed
avoid printing when we don't know the number of samples the model was trained on.
1 parent 95916ef commit 5ed9c9b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

R/history.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ print.keras_training_history <- function(x, ...) {
1717
validate <- paste0(", validated on ", params[["validation_samples"]], " samples")
1818
else
1919
validate <- ""
20-
str <- paste0("Trained on ", params[["samples"]]," samples", validate, " (batch_size=",
21-
params[["batch_size"]], ", epochs=", params[["epochs"]], ")")
22-
20+
21+
str <- ""
22+
if (!params[["samples"]] == "NULL") {
23+
str <- paste0(str, "Trained on ", params[["samples"]]," samples", validate, " (batch_size=",
24+
params[["batch_size"]], ", epochs=", params[["epochs"]], ")")
25+
}
26+
2327
# last epoch metrics
2428
metrics <- lapply(x$metrics, function(metric) {
2529
metric[[epochs]]

0 commit comments

Comments
 (0)