Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
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)))
Example #7
0
def hp_lognormal(label, *args, **kwargs):
    return scope.float(
        scope.hyperopt_param(label, scope.lognormal(*args, **kwargs)))
Example #8
0
def hp_qloguniform(label, *args, **kwargs):
    return scope.float(
        scope.hyperopt_param(label, scope.qloguniform(*args, **kwargs)))
Example #9
0
def hp_randint(label, *args, **kwargs):
    return scope.hyperopt_param(label, scope.randint(*args, **kwargs))
Example #10
0
def hp_quniform_int(label, *args, **kwargs):
    return scope.int(
            scope.hyperopt_param(label,
                scope.quniform(*args, **kwargs)))
Example #11
0
def hp_choice(label, options):
    ch = scope.hyperopt_param(label,
        scope.randint(len(options)))
    return scope.switch(ch, *options)
Example #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)))
Example #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))
Example #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)
Example #15
0
def hp_normal(label, *args, **kwargs):
    return scope.float(
            scope.hyperopt_param(label,
                scope.normal(*args, **kwargs)))
Example #16
0
def hp_qloguniform(label, *args, **kwargs):
    return scope.float(
            scope.hyperopt_param(label,
                scope.qloguniform(*args, **kwargs)))
Example #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))
Example #18
0
def hp_choice(label, options):
    ch = scope.hyperopt_param(label, scope.randint(len(options)))
    return scope.switch(ch, *options)
Example #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)))
Example #20
0
def hp_randint(label, *args, **kwargs):
    return scope.hyperopt_param(label,
        scope.randint(*args, **kwargs))