-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
How to specify 'hidden' parameter in grid search of 'classif.h2o.deeplearning'? #1305
Comments
Hi, in mlr you can set the hyper parameter of a learning like that
For a list of available parameters of a learner you can use All of this is explained in more details in the tutorial: http://mlr-org.github.io/mlr-tutorial/release/html/learner/index.html I'm not sure how to set a list as the number of hidden nodes as you implied, could you provide a reproducable (minimal) example what you are trying to do? EDIT: Ah, I just overread that you want to do a grid search |
Unfortunately, we currently don't support this. We require parameters to have a certain type and supporting parameters that can have several types is tricky. You could just redeclare the learner with |
Thank you a lot.
I missunderstood that "par.vals" can only have scalar arguments.
|
You probably refer to If you had still the version where you can really pass a list it would look something like that lrn$par.set$pars$hidden = makeUntypedLearnerParam(id = "hidden")
lrn = setHyperPars(lrn, par.vals = list(hidden = list(c(10,10), c(20,20,20), c(30,30,30)))) Otherwise a bit tideous but most flexible: library(mlr)
lrn = makeLearner("classif.h2o.deeplearning")
hyperparm = list(c(10,10), c(20,20,20), c(30,30,30))
lrns = lapply(hyperparm, function(x) {
lrn2 = setHyperPars(lrn, par.vals = list(hidden = x))
lrn2$id = paste0(lrn$id,":",paste0(x, collapse = "."))
return(lrn2)
})
bmrs = benchmark(learners = lrns, tasks = iris.task) Another may be more elegant approach: ps = makeParamSet(
makeDiscreteParam(id = "hidden", values = list(a = c(10,10), b = c(20,20,20), c = c(30,30,30)))
)
lrn = makeLearner("classif.h2o.deeplearning")
des = generateGridDesign(ps)
tune.res = tuneParams(learner = lrn, task = iris.task, resampling = makeResampleDesc("Holdout"), measures = acc, control = makeTuneControlDesign(design = des), par.set = ps)
tune.res |
I appreciate you for detailed examples.
|
In h2o package, I can specify hyper parameters as belows:
mlr seems to support this usage with 'makeDiscreteVectorParam'.
Below is an usage of the function :
How I can put 'hidden = list( c(10,10), c(20,20,20), c(30,30,30))' into 'makeDiscreteVectorParm' ?
The text was updated successfully, but these errors were encountered: