Skip to content

Conversation

@eddiebergman
Copy link
Contributor

@eddiebergman eddiebergman commented Nov 22, 2023

NOTE: I will likely merge this soon given I have not heard back from HEBO developers.

DRAFT

This PR implements what I could gather from the HEBO documentation.

So far it seems I could get single objective optimization in and also multi-objective.

There's a few possible issues marked with #TODO, such as HEBO not supporting an unbounded optimal (even if only theoretical) due to it's observe removing non-finite entries. Also tests still need to be added for HEBO space parsing, however it seems to at least function with a basic {"x": (1.0, 10.0)} space.


Some other points:

  • Should leave an issue to explicitly state their optimizers only minimize in the examples. This wasn't immediately clear.
  • Not sure how to really use ref_point in GeneralBO, it seems I can leave it as None and that would seem safer than specifying my own. However if I have the information, it might make GeneralBO more effective to provide it. Not sure how it acts with inf boundaries as the reference point though.

@eddiebergman eddiebergman marked this pull request as ready for review November 25, 2023 17:47
@overload
@classmethod
def worst_possible_cost(cls, metric: Sequence[Metric]) -> list[float]:
...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask if the "..." operator allows execution to simply fall through to the method defined below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ... is essentially just a value, just like writing the number 4. For example,
These are both perfectly valid python code:

def f(x: int):
    4
def f(x: int):
    z = ...

What's making it fall through is the @overload. You can basically think of them as just doc strings that type checkers and language servers can use for better "intellisense". In the example you pointed out, if you pass in a Sequence[Metric], you can expect worst_possible_cost to give you back a list[float]. If you pass in a Metric, you'll get back a float.

Without them, your editor/language server will say, x = worst_possible_cost(single_metric) is either a float or list[float], even though you know it's a float.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants