在mlr中调整h2o超参数?

时间:2019-04-30 05:58:13

标签: r mlr

Q1:如何调整“ classif.h2o.deeplearning”中的“隐藏”超参数?

我从stackOverFlow获得了不同的方法

makeDiscreteParam("hidden", values = list(one = 10, two = c(10, 5, 10)))
makeDiscreteParam(id = "hidden", values = list(a = c(10,10), b = c(20,20,20), c = c(30,30,30)))
makeDiscreteParam(id = "hidden", values = list(a = c(10,10), b = c(100,100)))
makeIntegerVectorParam("hidden", len = 2, lower = 10, upper = 100)

按照定义

hidden: Specifies the number and size of each hidden layer in the model. For example, if c(100,200,100) is specified, a model with 3 hidden layers is generated. The middle hidden layer will have 200 neurons and the first and third hidden layers will have 100 neurons each. The default is c(200,200). For grid search, use the following format: list(c(10,10), c(20,20)). Refer to the section on Performing a Trial Run for more details.

hidden是“ integervector”,因此我可以使用makeIntegerVectorParam,我是否可以知道以下2种情况的语法(我在getParamSet中隐藏了Def(200,200))

2 hidden layers and 30 neurons in each?
2 hidden layers with different neurons in each say 30,20?

Q2:如果我花很长时间一次调整5个参数,是否应该在makeParamSet中逐个调整一个参数并获得最佳值,那么我是否应该将所有参数与makeParamSet中的特定值结合起来,这是正确的方法吗? / p>

关于Q2:这可能不是正确的方法,先调谐一个超参数然后合并,或者至少不能给出一个起点

Q3:我正在为classif.h2o.deeplearning获得33个超参数,有没有办法选择合适的参数进行调优?

1 个答案:

答案 0 :(得分:0)

最后了解的调整隐藏参数

makeDiscreteParam("hidden", values = list(one = c(30,30), two = c(30, 30, 30), three=c(30, 30, 30, 30)))

适合

一个:2个隐藏层,每个都有30个神经元

两个:3个隐藏层,每个包含30个神经元

三:4个隐藏层,每个都有30个神经元

相关问题