Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add constraints for pareto front #525

Merged
merged 6 commits into from
Jul 25, 2023

Conversation

hrntsm
Copy link
Collaborator

@hrntsm hrntsm commented Jul 21, 2023

Contributor License Agreement

This repository (optuna-dashboard) and Goptuna share common code.
This pull request may therefore be ported to Goptuna.
Make sure that you understand the consequences concerning licenses and check the box below if you accept the term before creating this pull request.

  • I agree this patch may be ported to Goptuna by other Goptuna contributors.

Reference Issues/PRs

Related #316 , Constraints supported for PareteFront.

What does this implement/fix? Explain your changes.

Since the constraint values are used in other plots, I use optuna's _CONSTRAINT_KEY to serialize the constraint values.

The results, reflecting the constraints, are shown below. A feasible trial has a gray line around the edge, while an infasible trial has a gray marker with no edge line.

Screenshot 2023-07-21 at 16 17 55 Screenshot 2023-07-21 at 16 24 39

@hrntsm
Copy link
Collaborator Author

hrntsm commented Jul 21, 2023

In order to work with optuna v2.1, _CONSTRAINT_KEY, which was imported in _serializer.py, is no longer used and is defined as a constant in the file.

@keisuke-umezawa
Copy link
Member

@c-bata

In order to work with optuna v2.1, _CONSTRAINT_KEY, which was imported in _serializer.py, is no longer used and is defined as a constant in the file.

How long should we support optuna v2.1?
If we do not need to support optuna v2.1 anymore, we can upgrade this version. https://github.com/optuna/optuna-dashboard/blob/main/.github/workflows/e2e-tests.yml#L19

@@ -30,6 +30,7 @@ interface TrialResponse {
system_attrs: Attribute[]
note: Note
artifacts: Artifact[]
constraints: number[]
Copy link
Member

Choose a reason for hiding this comment

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

[nits] If we want to align with the other fields such as values?, should it be also an optional field?

@@ -112,6 +112,7 @@ type Trial = {
}[]
user_attrs: Attribute[]
system_attrs: Attribute[]
constraints: number[]
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

Copy link
Member

@keisuke-umezawa keisuke-umezawa left a comment

Choose a reason for hiding this comment

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

I left some minor comments and also request some comments to @c-bata . Overall, almost looks good to me!

@hrntsm
Copy link
Collaborator Author

hrntsm commented Jul 24, 2023

I have updated constraint value to an optional in response to your comment.

@c-bata
Copy link
Member

c-bata commented Jul 24, 2023

@c-bata

In order to work with optuna v2.1, _CONSTRAINT_KEY, which was imported in _serializer.py, is no longer used and is defined as a constant in the file.

How long should we support optuna v2.1? If we do not need to support optuna v2.1 anymore, we can upgrade this version. https://github.com/optuna/optuna-dashboard/blob/main/.github/workflows/e2e-tests.yml#L19

Thank you for asking. I think we can consider dropping Optuna v2 support from the next release 👍 Then, we need to replace this line with "optuna>=3.0.0" as well.

@keisuke-umezawa
Copy link
Member

keisuke-umezawa commented Jul 24, 2023

@hrntsm
Thank you for fixing it. But, I meant that as follows:

Currently, if there are not any constraints, the constraints become []. But, to align with the other fields such as values?, it might be better that the constraints become undefined.

However, I realized that it will introduce a lot of code changes, and there is not so much benefit to change [] to undefined. Sorry for disturbing you, but could you revert or remove this commit?

Afterwards, I will merge it.

@hrntsm
Copy link
Collaborator Author

hrntsm commented Jul 25, 2023

I understand the intent of your comment. Thank you.
The commit itself has been reverted.

@keisuke-umezawa keisuke-umezawa merged commit db0e1cc into optuna:main Jul 25, 2023
12 checks passed
@keisuke-umezawa
Copy link
Member

@hrntsm
Thank you for your quick fix! I merged it.

@hrntsm hrntsm deleted the Add_constraints_for_pareto_front branch July 25, 2023 20:41
@hrntsm hrntsm mentioned this pull request Jul 27, 2023
1 task
@hrntsm hrntsm mentioned this pull request Aug 12, 2023
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.

None yet

3 participants