optuna.distributions.FloatDistribution

class optuna.distributions.FloatDistribution(low, high, log=False, step=None)[源代码]

浮点数上的分布。

此对象由 suggest_float() 实例化,通常传递给 samplers

备注

When step is not None, if the range \([\mathsf{low}, \mathsf{high}]\) is not divisible by \(\mathsf{step}\), \(\mathsf{high}\) will be replaced with the maximum of \(k \times \mathsf{step} + \mathsf{low} < \mathsf{high}\), where \(k\) is an integer.

参数:
low

Lower endpoint of the range of the distribution. low is included in the range. low must be less than or equal to high. If log is True, low must be larger than 0.

high

分布范围的上限。high 包含在范围内。high 必须大于或等于 low

log

If log is True, this distribution is in log-scaled domain. In this case, all parameters enqueued to the distribution must be positive values. This parameter must be False when the parameter step is not None.

step

A discretization step. step must be larger than 0. This parameter must be None when the parameter log is True.

方法

single()

测试此分布的范围是否仅包含一个值。

to_external_repr(param_value_in_internal_repr)

将参数值的内部表示转换为外部表示。

to_internal_repr(param_value_in_external_repr)

将参数值的外部表示转换为内部表示。

single()[源代码]

测试此分布的范围是否仅包含一个值。

返回:

True if the range of this distribution contains just a single value, otherwise False.

返回类型:

bool

to_external_repr(param_value_in_internal_repr)

将参数值的内部表示转换为外部表示。

参数:

param_value_in_internal_repr (float) – Optuna 内部表示的参数值。

返回:

Optuna 的参数值的外部表示。

返回类型:

Any

to_internal_repr(param_value_in_external_repr)[源代码]

将参数值的外部表示转换为内部表示。

参数:

param_value_in_external_repr (float) – Optuna 的参数值的外部表示。

返回:

Optuna 内部表示的参数值。

返回类型:

float