Skip to content

Commit 2728133

Browse files
committed
Saves mlrMBO state in turbine output
1 parent 3e53ec9 commit 2728133

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

workflows/p2b1_mlrMBO/R/mlrMBO3.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ setwd(r_root)
99

1010
source("mlrMBO_utils.R")
1111

12+
turbine_output <- Sys.getenv("TURBINE_OUTPUT")
13+
1214
# EQ/R based parallel map
1315
parallelMap2 <- function(fun, ...,
1416
more.args = list(),
@@ -57,10 +59,11 @@ simple.obj.fun = function(x){}
5759

5860
main_function <- function(max.budget = 110, max.iterations = 10, design.size=10, propose.points=10){
5961

62+
mlr.save.file <- paste0(turbine_output, "/mlr_run.RData")
6063

6164
surr.rf = makeLearner("regr.randomForest", predict.type = "se")
62-
ctrl = makeMBOControl(n.objectives = 1, save.on.disk.at = c(1,2,3,4,5),
63-
propose.points = min(20, propose.points),
65+
ctrl = makeMBOControl(n.objectives = 1, save.on.disk.at = c(1,2,3,4,5), save.file.path = mlr.save.file,
66+
propose.points = min(20, propose.points),
6467
impute.y.fun = function(x, y, opt.path, ...) .Machine$integer.max * 0.1 )
6568
ctrl = setMBOControlInfill(ctrl, crit=makeMBOInfillCritCB(), interleave.random.points=max(0,propose.points-20))
6669
ctrl = setMBOControlMultiPoint(ctrl, method = "cb")

workflows/p3b1_mlrMBO/R/mlrMBO3.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ if (emews_root == "") {
77
wd <- getwd()
88
setwd(r_root)
99

10+
turbine_output <- Sys.getenv("TURBINE_OUTPUT")
11+
12+
1013
source("mlrMBO_utils.R")
1114

1215
# EQ/R based parallel map
@@ -58,9 +61,11 @@ simple.obj.fun = function(x){}
5861

5962
main_function <- function(max.budget = 110, max.iterations = 10, design.size=10, propose.points=10){
6063

64+
mlr.save.file <- paste0(turbine_output, "/mlr_run.RData")
65+
6166
surr.rf = makeLearner("regr.randomForest", predict.type = "se")
62-
ctrl = makeMBOControl(n.objectives = 1, save.on.disk.at = c(1,2,3,4,5),
63-
propose.points = min(20, propose.points),
67+
ctrl = makeMBOControl(n.objectives = 1, save.on.disk.at = c(1,2,3,4,5), save.file.path = mlr.save.file,
68+
propose.points = min(20, propose.points),
6469
impute.y.fun = function(x, y, opt.path, ...) .Machine$integer.max * 0.1 )
6570
ctrl = setMBOControlInfill(ctrl, crit=makeMBOInfillCritCB(), interleave.random.points=max(0,propose.points-20))
6671
ctrl = setMBOControlMultiPoint(ctrl, method = "cb")

0 commit comments

Comments
 (0)