Skip to content

Nano HPO: max_epoch in Trainer.search does not take effect (pytorch)  #4876

Open
@shane-huang

Description

@shane-huang

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions