optuna.distributions.UniformDistribution

class optuna.distributions.UniformDistribution(low, high)[源代码]

A uniform distribution in the linear domain.

This object is instantiated by suggest_uniform(), and passed to samplers in general.

low

Lower endpoint of the range of the distribution. low is included in the range.

high

Upper endpoint of the range of the distribution. high is included from the range.

引发

ValueError – If low value is larger than high value.

参数
返回类型

None

Methods

single()

Test whether the range of this distribution contains just a single value.

to_external_repr(param_value_in_internal_repr)

Convert internal representation of a parameter value into external representation.

to_internal_repr(param_value_in_external_repr)

Convert external representation of a parameter value into internal representation.

single()[源代码]

Test whether the range of this distribution contains just a single value.

返回

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

返回类型

bool

to_external_repr(param_value_in_internal_repr)

Convert internal representation of a parameter value into external representation.

参数

param_value_in_internal_repr (float) – Optuna’s internal representation of a parameter value.

返回

Optuna’s external representation of a parameter value.

返回类型

Any

to_internal_repr(param_value_in_external_repr)

Convert external representation of a parameter value into internal representation.

参数

param_value_in_external_repr (Any) – Optuna’s external representation of a parameter value.

返回

Optuna’s internal representation of a parameter value.

返回类型

float