mirror of
https://github.com/microsoft/autogen.git
synced 2026-02-16 18:45:19 -05:00
categorical choice can be ordered or unordered (#677)
* categorical choice can be ordered or unordered * ordered -> order * move choice into utils * version comparison * packaging -> setuptools * import version * version_parse * test order for choice
This commit is contained in:
@@ -4,7 +4,6 @@ from flaml.tune.sample import (
|
||||
Domain,
|
||||
uniform,
|
||||
quniform,
|
||||
choice,
|
||||
randint,
|
||||
qrandint,
|
||||
randn,
|
||||
@@ -14,6 +13,7 @@ from flaml.tune.sample import (
|
||||
lograndint,
|
||||
qlograndint,
|
||||
)
|
||||
from flaml.tune import choice
|
||||
|
||||
|
||||
def test_sampler():
|
||||
@@ -22,6 +22,8 @@ def test_sampler():
|
||||
print(qrandn(2, 10, 2).sample(size=2))
|
||||
c = choice([1, 2])
|
||||
print(c.domain_str, len(c), c.is_valid(3))
|
||||
c = choice([1, 2], order=False)
|
||||
print(c.domain_str, len(c), c.ordered)
|
||||
i = randint(1, 10)
|
||||
print(i.domain_str, i.is_valid(10))
|
||||
d = Domain()
|
||||
|
||||
Reference in New Issue
Block a user