View source: R/005_HyperparameterCandidates.R
| tune_over | R Documentation |
Declares that a hyperparameter is searched over. It is the only way to express a search space: a bare vector is always a value, so nothing has to be inferred from how many elements it happens to have.
tune_over(...)
... |
The candidates to search over: one per argument, or a single list or vector read against the type the hyperparameter declares. |
Give it the candidates. Several arguments are one candidate each; a single argument holding several values is the candidates, so a grid you computed can be passed straight in:
setup_LightRF(max_depth = tune_over(3L, 4L, 5L)) setup_LightRF(lambda_l2 = tune_over(10^seq(-4, 0, length.out = 5))) setup_MLP(hidden_units = tune_over(c(12L, 6L, 2L), c(14L, 12L, 6L, 2L)))
For a vector-valued hyperparameter one candidate is itself a vector, so
pass the candidates as separate arguments or as a list –
tune_over(list(c(12L, 6L), c(24L, 12L))). A single bare vector there would
be one architecture, and is an error saying so.
Passing it to a hyperparameter that is not tunable is an error: that hyperparameter accepts a value only.
HyperparameterCandidates object.
EDG
hp <- setup_LightRF(max_depth = tune_over(3L, 4L, 5L))
hp@max_depth
# A bare vector is a value, never a search space.
setup_LightRF(max_depth = 3L)@max_depth
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.