optuna.distributions.DiscreteUniformDistribution
- class optuna.distributions.DiscreteUniformDistribution(low, high, q)[source]
A discretized uniform distribution in the linear domain.
This object is instantiated by
suggest_float()
withstep
argument, and passed tosamplers
in general.Note
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.
- Parameters:
low (float) – Lower endpoint of the range of the distribution.
low
is included in the range.low
must be less than or equal tohigh
.high (float) – Upper endpoint of the range of the distribution.
high
is included in the range.high
must be greater than or equal tolow
.q (float) – A discretization step.
q
must be larger than 0.
- 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.
Warning
Deprecated in v3.0.0. This feature will be removed in the future. The removal of this feature is currently scheduled for v6.0.0, but this schedule is subject to change. See https://github.com/optuna/optuna/releases/tag/v3.0.0.
Use
FloatDistribution
instead.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.
Attributes
Discretization step.
- property q: float
Discretization step.
DiscreteUniformDistribution
is a subtype ofFloatDistribution
. This property is a proxy for itsstep
attribute.
- 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.