-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
moving irace parameters implementation to Paradox #377
Comments
|
P.S. I would be very happy if we can integrate paradox with |
@mb706 Thanks this is very useful!
Maybe it helps to explain a bit how irace generates new solutions. At each generation, the best (elite) configurations found so far are used to either define mean and std dev values for sampling numerical parameters from a truncated normal distribution or to define probabilities to sample values for categorical parameters. I see that Sampler1DCateg already support probabilities, so that problem is solved. Maybe I can use SamplerHierarchical for implementing the irace sampling by pre-calculating all probabilities and mean/sd values and asking it to sample just 1 point, then repeating those steps for each elite configuration. Does that sound like a good idea?
Let me explain a bit more. In irace, if you declare a parameter with values ("very-low", "low", "medium", "high", "very-high") of ordinal type, then the values are treated as 1,2,3,4,5 for sampling purposes, that is, we sample values from a normal distribution, then round to the nearest integer and map back to the corresponding string. The goal is that if you have a good configuration with value "high", then we should sample more of "very-high" than "very-low".
Ah, OK, we also have something equivalent to p <- ps(param1 = p_dbl(0, 1), param2 = p_dbl(0, 1))
p$trafo <- function(x, param_set) { x$param2 <- 1 + (x$param2 * x$param1 * 2 - 1) ; x } Would this example p <- ps(param1 = p_dbl(0, 1), param2 = p_dbl(0, 1), param3 = p_dbl(0,1)
p$trafo <- function(x, param_set) { x$param2 <- 1 + (min(x$param2, x$param1)*x$param3 - 1) ; x } This seems cumbersome for the user to write but relatively easy for
Yes, people use it (we have some questions about this in the google group but I think the major real-user of this for irace is the DEMIURGE project, who where the ones that implemented it in irace). However, our answer in the past was to ask them to write our equivalent of Remember that almost every user of irace uses it via the command-line by providing a textual representation of parameters without knowing any R. Asking them to write a Another example (ACOTSP) is shown here: https://mlopez-ibanez.github.io/irace/reference/readParameters.html#ref-examples
Great! How would this be done? |
Hi, I'm still interested in this but I need some help to figure out how to implement the above using |
I have implemented a paradox-like interface to create parameters here: https://github.com/MLopez-Ibanez/irace/blob/parametersNew/R/parameters.R With this interface, one can do the following: digits <- 4L
x <- parametersNew(
param_cat(name = "algorithm", values = c("as", "mmas", "eas", "ras", "acs"), switch = "--"),
param_cat(name = "localsearch", values = c("0", "1", "2", "3"), switch = "--localsearch "),
param_real(name = "alpha", lower = 0.0, upper=5.0, switch = "--alpha ", digits = digits),
param_real(name = "beta", lower = 0.0, upper = 10.0, switch = "--beta ", digits = digits),
param_real(name = "rho", lower = 0.01, upper = 1.00, switch = "--rho ", digits = digits),
param_int(name = "ants", lower = 5, upper = 100, transf = "log", switch = "--ants "),
param_real(name = "q0", switch = "--q0 ", lower=0.0, upper=1.0, condition = expression(algorithm == "acs")),
param_int(name = "rasrank", switch = "--rasranks ", lower=1, upper=quote(min(ants, 10)), condition = 'algorithm == "ras"'),
param_int(name = "elitistants", switch = "--elitistants ", lower=1, upper=expression(ants), condition = 'algorithm == "eas"'),
param_int(name = "nnls", switch = "--nnls ", lower = 5, upper = 50, condition = expression(localsearch %in% c(1,2,3))),
param_cat(name = "dlb", switch = "--dlb ", values = c(0,1), condition = "localsearch %in% c(1,2,3)"))
}) Can the implementation of the above interface be completely replaced by |
Description
I'm considering replacing irace custom parameter representation with paradox. This will benefit irace since I expect your implementation to be of higher quality and it will benefit mlr3 and any other package that uses both paradox and irace by avoiding awkward conversions between types.
However, there are a few things that irace would need before being able to make the move (incomplete list!):
Reproducible example
The above shows an advanced use of the switch for
algorithm
, various conditions and dependent bounds.The text was updated successfully, but these errors were encountered: