Ejemplo n.º 1
0
def test_uniform(backend):
    space = Space(backend=backend)

    for discrete in [True, False]:
        for log in [True, False]:
            for q in [None, 0.01, 1]:
                space.uniform(f'a_{discrete}_{log}_{q}', 1, 2,
                              discrete=discrete,
                              log=log,
                              quantization=q)

    print(space.sample())
Ejemplo n.º 2
0
def test_forbid_and():
    space = Space('ConfigSpace')

    a = space.uniform('a', 1, 2, quantization=0.01)
    a.forbid_equal(1)
    a.forbid_in([1, 2])
    print(space.sample())
Ejemplo n.º 3
0
from sspace import Space


space = Space()
space.uniform('lr', 0, 1)
space.ordinal('epoch', [1, 2, 3])


s1 = space.sample(seed=0)
s2 = space.sample(seed=1)
s1p = space.sample(seed=0)


print(s1)
print(s2)
print(s1p)

# [OrderedDict([('epoch', 1), ('optimizer', 'adam')])]
# [OrderedDict([('epoch', 2), ('optimizer', 'adam')])]
# [OrderedDict([('epoch', 1), ('optimizer', 'adam')])]