
Last chance! 50% off unlimited learning
Sale ends in
This function allow user building the hyper-parameters space used
by sits_tuning()
function search randomly the best parameter
combination.
User should pass the possible values for hyper-parameters as constant or by calling the following random functions:
uniform(min = 0, max = 1, n = 1)
: returns random numbers
from a uniform distribution with parameters min and max.
choice(..., replace = TRUE, n = 1)
: returns random objects
passed to ...
with replacement or not (parameter replace
).
randint(min, max, n = 1)
: returns random integers
from a uniform distribution with parameters min and max.
normal(mean = 0, sd = 1, n = 1)
: returns random numbers
from a normal distribution with parameters min and max.
lognormal(meanlog = 0, sdlog = 1, n = 1)
: returns random
numbers from a lognormal distribution with parameters min and max.
loguniform(minlog = 0, maxlog = 1, n = 1)
: returns random
numbers from a loguniform distribution with parameters min and max.
beta(shape1, shape2, n = 1)
: returns random numbers
from a beta distribution with parameters min and max.
These functions accepts n
parameter to indicate how many values
should be returned.
sits_tuning_hparams(...)
A list containing the hyper-parameter space to be passed to
sits_tuning()
's params
parameter.
Used to prepare hyper-parameter space
if (sits_run_examples()) {
# find best learning rate parameters for TempCNN
tuned <- sits_tuning(
samples_modis_ndvi,
ml_method = sits_tempcnn(),
params = sits_tuning_hparams(
optimizer = choice(
torchopt::optim_adamw,
torchopt::optim_yogi
),
opt_hparams = list(
lr = beta(0.3, 5)
)
),
trials = 4,
multicores = 2,
progress = FALSE
)
}
Run the code above in your browser using DataLab