quniform#

ray.tune.quniform(lower: float, upper: float, q: float)[source]#

Sample a quantized float value uniformly between lower and upper.

Sampling from tune.quniform(1, 10, 0.5) is equivalent to sampling from np.random.uniform(1, 10) and rounding to a multiple of 0.5.

The value will be quantized, i.e. rounded to an integer increment of q. Quantization makes the upper bound inclusive.

Parameters:
  • lower (float) – Lower boundary of the output interval.

  • upper (float) – Upper boundary of the output interval.

  • q (float) – Quantization number. The result will be rounded to an integer increment of this value.

Returns:

A Float domain that samples uniformly and quantizes by q.