Skip to content

CostFunc returns unexpected results for illegal configuration if objective_higher_is_better==True #314

@stijnh

Description

@stijnh

Currently, if a configuration is illegal and objective_higher_is_better==True, CostFunc will return -sys.float_info.max.

However, all strategies assume that lower is better, meaning they assume that this point is an optimum. Instead of avoiding this configuration, the search strategies will instead purposely move towards this point.

# get numerical return value, taking optimization direction into account
return_value = result[self.tuning_options.objective] or sys.float_info.max
return_value = return_value if not self.tuning_options.objective_higher_is_better else -return_value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions