Example #1
0
def make_big_space(backend='ConfigSpace'):
    def make_subspace(sspace):
        sspace.uniform('uniform_float', 0, 1)
        sspace.loguniform('loguniform_float', 2, 3)
        sspace.normal('normal_float', 0, 1)
        sspace.lognormal('lognormal_float', 2, 3)

        sspace.uniform('uniform_float_q', 0, 1, quantization=0.01)
        sspace.loguniform('loguniform_float_q', 2, 3, quantization=0.01)
        sspace.normal('normal_float_q', 0, 1, quantization=0.01)
        sspace.lognormal('lognormal_float_q', 2, 1, quantization=0.01)

        sspace.uniform('uniform_int', 0, 1, discrete=True)
        sspace.loguniform('loguniform_int', 2, 3, discrete=True)
        sspace.normal('normal_int', 0, 1, discrete=True)
        sspace.lognormal('lognormal_int', 2, 3, discrete=True)

        sspace.choices('choices', ['a', 'b', 'c', 'd'])
        sspace.ordinal('ordinal', ['a', 'b', 'c', 'd'])

        sspace.variable('epoch')
        sspace.identity('uid')

        return sspace

    space = Space(backend=backend)
    make_subspace(space)
    make_subspace(space.subspace('sub'))
    return space
Example #2
0
def test_subspace(backend):
    space = Space(backend=backend)

    space.normal('a', 1, 2, quantization=0.01)
    subspace = space.subspace('b')
    subspace.normal('a', 1, 2, quantization=0.01)

    print(space.sample())