Merge pull request #815 from COLDTURNIP/fix/optimizer_progress_bar_counter

optimizer: correct progress bar counter & ETA calculation
This commit is contained in:
Yo-An Lin 2022-07-13 13:35:34 +08:00 committed by GitHub
commit 647182e575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,6 +236,8 @@ func (o *GridOptimizer) Run(executor Executor, configJson []byte) (map[string][]
close(taskC) // this will shut down the executor
for result := range resultsC {
bar.Increment()
if result.Report == nil {
log.Errorf("no summaryReport found for params: %+v", result.Params)
continue
@ -244,7 +246,6 @@ func (o *GridOptimizer) Run(executor Executor, configJson []byte) (map[string][]
for metricKey, metricFunc := range valueFunctions {
var metricValue = metricFunc(result.Report)
bar.Set("log", fmt.Sprintf("params: %+v => %s %+v", result.Params, metricKey, metricValue))
bar.Increment()
metrics[metricKey] = append(metrics[metricKey], Metric{
Params: result.Params,