|
41 | 41 | #' codomain = ps(y1 = p_dbl(tags = "minimize"), y2 = p_dbl(tags = "minimize")) |
42 | 42 | #' objective = ObjectiveRFun$new(fun = fun, domain = domain, codomain = codomain) |
43 | 43 | #' |
44 | | -#' instance = OptimInstanceMultiCrit$new( |
| 44 | +#' instance = OptimInstanceBatchMultiCrit$new( |
45 | 45 | #' objective = objective, |
46 | 46 | #' terminator = trm("evals", n_evals = 5)) |
47 | 47 | #' |
@@ -175,20 +175,20 @@ adjust_gh_data = function(gh_data, mu, sigma, r) { |
175 | 175 | idx = as.matrix(expand.grid(rep(list(1:n), n_obj))) |
176 | 176 | nodes = matrix(gh_data[idx, 1L], nrow = nrow(idx), ncol = n_obj) |
177 | 177 | weights = apply(matrix(gh_data[idx, 2L], nrow = nrow(idx), ncol = n_obj), MARGIN = 1L, FUN = prod) |
178 | | - |
179 | | - # pruning with pruning rate r |
| 178 | + |
| 179 | + # pruning with pruning rate r |
180 | 180 | if (r > 0) { |
181 | 181 | weights_quantile = quantile(weights, probs = r) |
182 | 182 | nodes = nodes[weights > weights_quantile, ] |
183 | 183 | weights = weights[weights > weights_quantile] |
184 | 184 | } |
185 | | - |
| 185 | + |
186 | 186 | # rotate, scale, translate nodes with error catching |
187 | 187 | # rotation will not have an effect unless we support surrogate models modelling correlated objectives |
188 | 188 | # for now we still support this more general case and scaling is useful anyways |
189 | 189 | nodes = tryCatch( |
190 | 190 | { |
191 | | - eigen_decomp = eigen(sigma) |
| 191 | + eigen_decomp = eigen(sigma) |
192 | 192 | rotation = eigen_decomp$vectors %*% diag(sqrt(eigen_decomp$values)) |
193 | 193 | nodes = t(rotation %*% t(nodes) + mu) |
194 | 194 | }, error = function(ec) nodes |
|
0 commit comments