run at least one epoch
This commit is contained in:
parent
2cde540645
commit
3a7056ea1b
@ -361,9 +361,10 @@ class Hyperopt(Backtesting):
|
|||||||
logger.info(f'Found {cpus} CPU cores. Let\'s make them scream!')
|
logger.info(f'Found {cpus} CPU cores. Let\'s make them scream!')
|
||||||
|
|
||||||
opt = self.get_optimizer(cpus)
|
opt = self.get_optimizer(cpus)
|
||||||
|
EVALS = max(self.total_tries//cpus, 1)
|
||||||
try:
|
try:
|
||||||
with Parallel(n_jobs=cpus) as parallel:
|
with Parallel(n_jobs=cpus) as parallel:
|
||||||
for i in range(self.total_tries//cpus):
|
for i in range(EVALS):
|
||||||
asked = opt.ask(n_points=cpus)
|
asked = opt.ask(n_points=cpus)
|
||||||
f_val = self.run_optimizer_parallel(parallel, asked)
|
f_val = self.run_optimizer_parallel(parallel, asked)
|
||||||
opt.tell(asked, [i['loss'] for i in f_val])
|
opt.tell(asked, [i['loss'] for i in f_val])
|
||||||
|
Loading…
Reference in New Issue
Block a user