autogluon.common.space¶
搜索空间¶
您可以使用 AutoGluon 搜索空间执行 HPO。有关高层概述,请参阅此示例
from autogluon.common import space
categorical_space = space.Categorical('a', 'b', 'c', 'd') # Nested search space for hyperparameters which are categorical.
real_space = space.Real(0.01, 0.1) # Search space for numeric hyperparameter that takes continuous values
int_space = space.Int(0, 100) # Search space for numeric hyperparameter that takes integer values
bool_space = space.Bool() # Search space for hyperparameter that is either True or False.
有关如何使用搜索空间执行 HPO,请查看表格数据深入教程
分类¶
实数¶
- class autogluon.common.space.Real(lower, upper, default=None, log=False)[source]¶
用于取连续值的数值超参数的搜索空间。
- 参数:
lower (float) – 搜索空间的下界(超参数的最小可能值)
upper (float) – 搜索空间的上界(超参数的最大可能值)
default (float (可选)) – 超参数优化期间首先尝试的默认值
log ((True/False)) – 是否在对数而非线性尺度上搜索值。这对于搜索空间跨越多个数量级的数值超参数(例如学习率)非常有用。
示例
>>> learning_rate = Real(0.01, 0.1, log=True)