MCPcopy
hub / github.com/hyperopt/hyperopt / suggest

Function suggest

hyperopt/rand.py:14–26  ·  view source on GitHub ↗
(new_ids, domain, trials, seed)

Source from the content-addressed store, hash-verified

12
13
14def suggest(new_ids, domain, trials, seed):
15 rng = np.random.default_rng(seed)
16 rval = []
17 for ii, new_id in enumerate(new_ids):
18 # -- sample new specs, idxs, vals
19 idxs, vals = pyll.rec_eval(
20 domain.s_idxs_vals, memo={domain.s_new_ids: [new_id], domain.s_rng: rng}
21 )
22 new_result = domain.new_result()
23 new_misc = dict(tid=new_id, cmd=domain.cmd, workdir=domain.workdir)
24 miscs_update_idxs_vals([new_misc], idxs, vals)
25 rval.extend(trials.new_trial_docs([new_id], [None], [new_result], [new_misc]))
26 return rval
27
28
29def suggest_batch(new_ids, domain, trials, seed):

Callers

nothing calls this directly

Calls 3

miscs_update_idxs_valsFunction · 0.85
new_resultMethod · 0.80
new_trial_docsMethod · 0.80

Tested by

no test coverage detected