Esempio n. 1
0
def hp_pchoice(label, p_options):
    """
    label: string
    p_options: list of (probability, option) pairs
    """
    p, options = zip(*p_options)
    n_options = len(options)
    ch = scope.hyperopt_param(label, scope.categorical(p, upper=n_options))
    return scope.switch(ch, *options)
Esempio n. 2
0
def hp_pchoice(label, p_options):
    """
    label: string
    p_options: list of (probability, option) pairs
    """
    p, options = zip(*p_options)
    n_options = len(options)
    ch = scope.hyperopt_param(label, scope.categorical(p, upper=n_options))
    return scope.switch(ch, *options)
Esempio n. 3
0
def hp_pchoice(label, p_options):
    """
    label: string
    p_options: list of (probability, option) pairs
    """
    if not isinstance(label, basestring):
        raise TypeError('require string label')
    p, options = zip(*p_options)
    n_options = len(options)
    ch = scope.hyperopt_param(label, scope.categorical(p, upper=n_options))
    return scope.switch(ch, *options)
Esempio n. 4
0
def hp_pchoice(label, p_options):
    """
    label: string
    p_options: list of (probability, option) pairs
    """
    if not isinstance(label, basestring):
        raise TypeError("require string label")
    p, options = zip(*p_options)
    n_options = len(options)
    ch = scope.hyperopt_param(label, scope.categorical(p, upper=n_options))
    return scope.switch(ch, *options)
Esempio n. 5
0
def hp_choice(label, options):
    if not isinstance(label, basestring):
        raise TypeError("require string label")
    ch = scope.hyperopt_param(label, scope.randint(len(options)))
    return scope.switch(ch, *options)
Esempio n. 6
0
def hp_loguniform(label, *args, **kwargs):
    if not isinstance(label, basestring):
        raise TypeError('require string label')
    return scope.float(
            scope.hyperopt_param(label,
                scope.loguniform(*args, **kwargs)))
Esempio n. 7
0
def hp_lognormal(label, *args, **kwargs):
    return scope.float(
        scope.hyperopt_param(label, scope.lognormal(*args, **kwargs)))
Esempio n. 8
0
def hp_qloguniform(label, *args, **kwargs):
    return scope.float(
        scope.hyperopt_param(label, scope.qloguniform(*args, **kwargs)))
Esempio n. 9
0
def hp_randint(label, *args, **kwargs):
    return scope.hyperopt_param(label, scope.randint(*args, **kwargs))
Esempio n. 10
0
def hp_quniform_int(label, *args, **kwargs):
    return scope.int(
            scope.hyperopt_param(label,
                scope.quniform(*args, **kwargs)))
Esempio n. 11
0
def hp_choice(label, options):
    ch = scope.hyperopt_param(label,
        scope.randint(len(options)))
    return scope.switch(ch, *options)
Esempio n. 12
0
def hp_qlognormal(label, *args, **kwargs):
    if not isinstance(label, basestring):
        raise TypeError('require string label')
    return scope.float(
        scope.hyperopt_param(label, scope.qlognormal(*args, **kwargs)))
Esempio n. 13
0
def hp_randint(label, *args, **kwargs):
    if not isinstance(label, basestring):
        raise TypeError('require string label')
    return scope.hyperopt_param(label, scope.randint(*args, **kwargs))
Esempio n. 14
0
def hp_choice(label, options):
    if not isinstance(label, basestring):
        raise TypeError('require string label')
    ch = scope.hyperopt_param(label, scope.randint(len(options)))
    return scope.switch(ch, *options)
Esempio n. 15
0
def hp_normal(label, *args, **kwargs):
    return scope.float(
            scope.hyperopt_param(label,
                scope.normal(*args, **kwargs)))
Esempio n. 16
0
def hp_qloguniform(label, *args, **kwargs):
    return scope.float(
            scope.hyperopt_param(label,
                scope.qloguniform(*args, **kwargs)))
Esempio n. 17
0
def hp_randint(label, *args, **kwargs):
    if not isinstance(label, basestring):
        raise TypeError("require string label")
    return scope.hyperopt_param(label, scope.randint(*args, **kwargs))
Esempio n. 18
0
def hp_choice(label, options):
    ch = scope.hyperopt_param(label, scope.randint(len(options)))
    return scope.switch(ch, *options)
Esempio n. 19
0
def hp_qlognormal(label, *args, **kwargs):
    if not isinstance(label, basestring):
        raise TypeError("require string label")
    return scope.float(scope.hyperopt_param(label, scope.qlognormal(*args, **kwargs)))
Esempio n. 20
0
def hp_randint(label, *args, **kwargs):
    return scope.hyperopt_param(label,
        scope.randint(*args, **kwargs))