optuna.distributions.DiscreteUniformDistribution
- class optuna.distributions.DiscreteUniformDistribution(low, high, q)[源代码]
A discretized uniform distribution in the linear domain.
This object is instantiated by
suggest_uniform()
withstep
argument andsuggest_discrete_uniform()
, and passed tosamplers
in general.备注
If the range \([\mathsf{low}, \mathsf{high}]\) is not divisible by \(q\), \(\mathsf{high}\) will be replaced with the maximum of \(k q + \mathsf{low} < \mathsf{high}\), where \(k\) is an integer.
- 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 in the range.
- q
A discretization step.
- 引发
ValueError – If
low
value is larger thanhigh
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.
- to_external_repr(param_value_in_internal_repr)
Convert internal representation of a parameter value into external representation.