mlr-org / mlr3tuning

Hyperparameter optimization package of the mlr3 ecosystem
https://mlr3tuning.mlr-org.com/
GNU Lesser General Public License v3.0
55 stars 5 forks source link

fix: internal tuning and parameter transformations #457

Closed sebffischer closed 1 month ago

sebffischer commented 1 month ago

Previously it was not possible to do something like the code below:


mlp = lrn("classif.mlp",
  activation = nn_relu,
  neurons = to_tune(ps(
    n_layers = p_int(lower = 1, upper = 10), latent = p_int(10, 500),
    .extra_trafo = function(x, param_set) {
      list(neurons = rep(x$latent, x$n_layers))
    })
  ),
  epochs = to_tune(upper = 1000L, internal = TRUE),
  patience = 100,
  validate = 0.3,
  ...
)

After this PR: