コード例 #1
0
ファイル: pyll_utils.py プロジェクト: TankMermaid/ECLAIR
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)
コード例 #2
0
ファイル: pyll_utils.py プロジェクト: proud/hyperopt
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)
コード例 #3
0
ファイル: pyll_utils.py プロジェクト: hitesh915/hyperopt
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)
コード例 #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)
コード例 #5
0
ファイル: pyll_utils.py プロジェクト: hitesh915/hyperopt
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)
コード例 #6
0
ファイル: pyll_utils.py プロジェクト: TankMermaid/ECLAIR
def hp_choice(label, options):
    ch = scope.hyperopt_param(label, scope.randint(len(options)))
    return scope.switch(ch, *options)
コード例 #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)
コード例 #8
0
ファイル: pyll_utils.py プロジェクト: pstjohn/hyperopt
def hp_choice(label, options):
    ch = scope.hyperopt_param(label,
        scope.randint(len(options)))
    return scope.switch(ch, *options)