optuna.distributions.IntLogUniformDistribution

class optuna.distributions.IntLogUniformDistribution(low, high, step=1)[源代码]

对数域上的均匀整数分布.

一般情况下, 该对象由 suggest_int() 进行实例化, 然后被传递到 samplers.

low

该分布的取值范围下界. 其中 low 值是包含在取值范围内的.

high

该分布的取值范围上界。其中 high 值是包含在取值范围内的.

step

值之间的步长

警告

在 v2.0.0 中被废弃. 在未来, step 将会被移除. 目前, 这个特性的移除计划在 v4.0.0 中发生, 但是该计划可能会有改变.

Optuna 中的 sampler 和其他依赖这个分布的组件将会忽略这个值并假定 step 永远为1. 在被废弃之前, 用户定义的 sampler 可使用 1 之外的其他值.

引发

ValueError – 如果 low 的值比 high 大, 或者 low 小于 1 的话.

参数
  • low (int) –

  • high (int) –

  • step (int) –

返回类型

None

Methods

single()

测试该分布是否仅包含单一值.

to_external_repr(param_value_in_internal_repr)

将参数的内部表示转化为外部表示.

to_internal_repr(param_value_in_external_repr)

将参数的外部表示转化为内部表示.

Attributes

step

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 对参数值的外部表示

返回类型

int

to_internal_repr(param_value_in_external_repr)[源代码]

将参数的外部表示转化为内部表示.

参数

param_value_in_external_repr (int) – Optuna 对参数值的外部表示

返回

Optuna 对参数值的内部表示

返回类型

float