optuna.distributions.DiscreteUniformDistribution

class optuna.distributions.DiscreteUniformDistribution(low, high, q)[source]

線形領域における離散化一様分布

このオブジェクトは suggest_float() 関数の step 引数によって生成され、 一般に samplers モジュールに渡されます。

Note

範囲 \([\mathsf{low}, \mathsf{high}]\)\(q\) で割り切れない場合、 \(\mathsf{high}\)\(k q + \mathsf{low} < \mathsf{high}\) の最大値に置き換えられます。 ここで \(k\) は整数です。

Parameters:
  • low (float) – 分布の範囲の下限。low は範囲に含まれます。 lowhigh 以下でなければなりません。

  • high (float) – 分布の範囲の上限。high は範囲に含まれます。 highlow 以上でなければなりません。

  • q (float) – 離散化ステップ。q は 0 より大きい値でなければなりません。

low

分布の範囲の下限。low は範囲に含まれます。

high

分布の範囲の上限。high は範囲に含まれます。

Warning

v3.0.0 で非推奨となりました。この機能は将来的に削除される予定です。 現在の削除予定は v6.0.0 ですが、変更される可能性があります。 https://github.com/optuna/optuna/releases/tag/v3.0.0 を参照してください。

FloatDistribution を使用してください。

メソッド

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.

属性

q

Discretization step.

property q: float

離散化ステップ。

DiscreteUniformDistributionFloatDistribution のサブクラスです。 このプロパティは step 属性のプロキシです。

single()

この分布の範囲が単一の値のみを含むかどうかをテストします。

Returns:

この分布の範囲が単一の値のみを含む場合は True、 それ以外の場合は False を返します。

Return type:

bool

to_external_repr(param_value_in_internal_repr)

パラメータ値の内部表現を外部表現に変換します。

Parameters:

param_value_in_internal_repr (float) – パラメータ値の Optuna 内部表現。

Returns:

パラメータ値の Optuna 外部表現。

Return type:

Any

to_internal_repr(param_value_in_external_repr)

パラメータ値の外部表現を内部表現に変換します。

Parameters:

param_value_in_external_repr (float) – パラメータ値の Optuna 外部表現。

Returns:

パラメータ値の Optuna 内部表現。

Return type:

float