Description
Problem:
Current behavior: Trainer.search use max_epoch
specified in Trainer.__init__
for the training in each trial.
Correct behavior: Trainer.search
should use the max_epoch
specified in the Trainer.search
arguments. https://github.com/intel-analytics/BigDL/blob/main/python/nano/src/bigdl/nano/automl/pytorch/hposearcher.py#L39 https://github.com/intel-analytics/BigDL/blob/main/python/nano/src/bigdl/nano/automl/pytorch/hposearcher.py#L103
Run this test case you will be able to see the problem.
This line does not take effect https://github.com/intel-analytics/BigDL/blob/main/python/nano/test/automl/pytorch/test_trainer.py#L93. Search still uses the max_epoch defined at https://github.com/intel-analytics/BigDL/blob/main/python/nano/test/automl/pytorch/test_trainer.py#L84
Solution:
explicitly use the max_epochs obtained from search and pass it to objective.