ConfigSpace
ConfigSpace copied to clipboard
quantized Normal and Uniform Int/Float have different quantization points
from ConfigSpace import NormalIntegerHyperparameter, UniformIntegerHyperparameter
# Same bounds and q
u = UniformIntegerHyperparameter("u", 1, 10, q=3)
n = NormalIntegerHyperparameter("n", mu=5, sigma=2, q=3, lower=1, upper=10)
set([n.sample(rs) for _ in range(100)])
# {0, 3, 6, 9}
set([u.sample(rs) for _ in range(100)])
# {1, 4, 7, 10}
Given the same boundaries, I imagine the quantization points would be equal
That's a great finding. I think this should be handled as part or after #252.
Bit more discovered while writing docs.
Turns out we have the same for the Float variants as well but it's a little worse with bounding on Normal's.
rs = np.random.RandomState()
u = UniformFloatHyperparameter("u", 1.0, 10.0, q=3)
set({u.sample(rs) for _ in range(100)})
# {1.0, 4.0, 7.0, 10.0}
n = NormalFloatHyperparameter("n", mu=5, sigma=3, q=3, lower=1, upper=10)
set({n.sample(rs) for _ in range(100)})
# {0.0, 3.0, 6.0, 9.0, 12.0}
Closed by #346 which removes quantization