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_choice(label, options):
    ch = scope.hyperopt_param(label, scope.randint(len(options)))
    return scope.switch(ch, *options)
Esempio n. 7
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. 8
0
def hp_choice(label, options):
    ch = scope.hyperopt_param(label,
        scope.randint(len(options)))
    return scope.switch(ch, *options)