本文整理汇总了Python中pyll.scope.hyperopt_param函数的典型用法代码示例。如果您正苦于以下问题:Python hyperopt_param函数的具体用法?Python hyperopt_param怎么用?Python hyperopt_param使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hyperopt_param函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: hp_pchoice
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: hp_pchoice
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)
示例3: hp_qlognormal
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)))
示例4: hp_randint
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))
示例5: hp_choice
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: hp_loguniform
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)))
示例7: hp_normal
def hp_normal(label, *args, **kwargs):
return scope.float(
scope.hyperopt_param(label,
scope.normal(*args, **kwargs)))
示例8: hp_qloguniform
def hp_qloguniform(label, *args, **kwargs):
return scope.float(
scope.hyperopt_param(label,
scope.qloguniform(*args, **kwargs)))
示例9: hp_quniform_int
def hp_quniform_int(label, *args, **kwargs):
return scope.int(
scope.hyperopt_param(label,
scope.quniform(*args, **kwargs)))
示例10: hp_randint
def hp_randint(label, *args, **kwargs):
return scope.hyperopt_param(label,
scope.randint(*args, **kwargs))
示例11: hp_choice
def hp_choice(label, options):
ch = scope.hyperopt_param(label,
scope.randint(len(options)))
return scope.switch(ch, *options)