コード例 #1
0
ファイル: vectorize.py プロジェクト: darthsuogles/hyperopt
 def build_idxs(self):
     for node in reversed(self.dfs_nodes):
         node_idxs = self.idxs_memo[node]
         if node.name == "one_of":
             n_options = len(node.pos_args)
             choices = scope.randint(n_options, size=scope.len(node_idxs))
             self.choice_memo[node] = choices
             self.merge(node_idxs, choices)
             self.node_id[choices] = "node_%i" % len(self.node_id)
             sub_idxs = scope.vchoice_split(node_idxs, choices, n_options)
             for ii, arg in enumerate(node.pos_args):
                 self.merge(sub_idxs[ii], arg)
         else:
             for arg in node.inputs():
                 self.merge(node_idxs, arg)
コード例 #2
0
ファイル: pyll_utils.py プロジェクト: hitesh915/hyperopt
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))
コード例 #3
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)
コード例 #4
0
ファイル: pyll_utils.py プロジェクト: TankMermaid/ECLAIR
def hp_randint(label, *args, **kwargs):
    return scope.hyperopt_param(label, scope.randint(*args, **kwargs))
コード例 #5
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)
コード例 #6
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))
コード例 #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_randint(label, *args, **kwargs):
    return scope.hyperopt_param(label,
        scope.randint(*args, **kwargs))
コード例 #9
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)