Skip to content

Commit

Permalink
performance: save models on worker only when requested
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Nov 28, 2024
1 parent e63423f commit 431592c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,4 @@ revdep/
Meta/
attic/
inst/docd
Rplots.pdf
6 changes: 1 addition & 5 deletions R/ObjectiveTuningAsync.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ObjectiveTuningAsync = R6Class("ObjectiveTuningAsync",
self$learner$param_set$set_values(.values = private$.xs, .insert = FALSE)

# resample hyperparameter configuration
private$.resample_result = resample(self$task, self$learner, self$resampling, store_models = TRUE, allow_hotstart = TRUE, clone = character(0))
private$.resample_result = resample(self$task, self$learner, self$resampling, store_models = self$store_models, allow_hotstart = TRUE, clone = character(0))
call_back("on_eval_after_resample", self$callbacks, self$context)

# aggregate performance
Expand All @@ -51,10 +51,6 @@ ObjectiveTuningAsync = R6Class("ObjectiveTuningAsync",
}

# add benchmark result and models
if (!self$store_models) {
lg$debug("Discarding models.")
private$.resample_result$discard(models = TRUE)
}
if (self$store_benchmark_result) {
lg$debug("Storing resample result.")
private$.aggregated_performance = c(private$.aggregated_performance, list(resample_result = list(private$.resample_result)))
Expand Down

0 comments on commit 431592c

Please sign in to comment.