Update hyperopt.py
This commit is contained in:
parent
fca93d8dfe
commit
2733aa33b6
@ -430,6 +430,7 @@ class Hyperopt:
|
|||||||
asked_non_tried: List[List[Any]] = []
|
asked_non_tried: List[List[Any]] = []
|
||||||
while i < 100 and len(asked_non_tried) < n_points:
|
while i < 100 and len(asked_non_tried) < n_points:
|
||||||
if i < 3:
|
if i < 3:
|
||||||
|
self.opt.cache_ = {}
|
||||||
asked = self.opt.ask(n_points=n_points)
|
asked = self.opt.ask(n_points=n_points)
|
||||||
else:
|
else:
|
||||||
asked = self.opt.space.rvs(n_samples=n_points * 5)
|
asked = self.opt.space.rvs(n_samples=n_points * 5)
|
||||||
@ -438,7 +439,7 @@ class Hyperopt:
|
|||||||
and x not in asked_non_tried]
|
and x not in asked_non_tried]
|
||||||
i += 1
|
i += 1
|
||||||
if asked_non_tried:
|
if asked_non_tried:
|
||||||
return asked_non_tried[:n_points]
|
return asked_non_tried[:min(len(asked_non_tried), n_points)]
|
||||||
else:
|
else:
|
||||||
return self.opt.ask(n_points=n_points)
|
return self.opt.ask(n_points=n_points)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user