为非hp.choice选择器设置Hyperopt条件空间

问题描述

我在keras模型上使用hyperopt模块。我以编程方式构建净层深度和每个深度的数量节点。每个深度的节点数取决于循环所处的深度。由于使用了构建器循环,node_scale(决定特定深度的节点数)必须至少为net_depth + 1。

如何使node_scale取决于选定的net_depth值,以便hp.quniform为node_scale选择的值始终至少比net_depth大1?

下面是我目前拥有的,这不好,因为我想测试出node_scale的较小值:

depth_min = 2
depth_max = depth_min + 5
scale_min = depth_max
scale_max = scale_min + 3
search_space = {
               'net_depth': hp.quniform('net_depth',depth_min,depth_max,1),'node_scale': hp.quniform('node_scale',scale_min,scale_max,1)
               }

我想要的是这样的

depth_min = 2
depth_max = depth_min + 4
search_space = {
                'net_depth': hp.quniform('net_depth',(net_depth + 1),(depth_max + 2),1)
               }

这种条件结构可以被黑在一起吗,或者有适当的方法来实现这一目的?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...