optuna.distributions.IntDistribution
- class optuna.distributions.IntDistribution(low, high, log=False, step=1)[源]
整数上的分布。
此对象由
suggest_int()实例化,通常传递给samplers。注意
当
step不为None时,如果范围 \([\mathsf{low}, \mathsf{high}]\) 不能被 \(\mathsf{step}\) 整除,则 \(\mathsf{high}\) 将被替换为 \(k \times \mathsf{step} + \mathsf{low} < \mathsf{high}\) 的最大值,其中 \(k\) 是一个整数。- high
分布范围的上限。
high包含在范围内。high必须大于或等于low。
方法
single()测试此分布的范围是否只包含一个值。
to_external_repr(param_value_in_internal_repr)将参数值的内部表示转换为外部表示。
to_internal_repr(param_value_in_external_repr)将参数值的外部表示转换为内部表示。