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

Follow the Optuna convention #189

Merged
merged 4 commits into from
Dec 2, 2024
Merged

Conversation

nabenabe0928
Copy link
Contributor

Contributor Agreements

Please read the contributor agreements and if you agree, please click the checkbox below.

  • I agree to the contributor agreements.

Motivation

Let Pyribs follow the Optuna convention.

@nabenabe0928
Copy link
Contributor Author

@btjanaka

I modified your code, so could you take a look if you are fine with these changes?

Copy link
Contributor

@btjanaka btjanaka left a comment

Choose a reason for hiding this comment

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

Hi @nabenabe0928, I think these changes make a lot of sense! I have some mostly minor comments.

"""Returns an objective followed by two measures."""
x = trial.suggest_float("x", -10, 10)
y = trial.suggest_float("y", -10, 10)
return x**2 + y**2, x, y
trial.set_user_attr("x", x)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would set the measure names to be m0 and m1 rather than x and y so that it is more clear that measure names need not be the same as the parameters. For example, we could easily have:

trial.set_user_attr("m0", 2 * x)
trial.set_user_attr("m1", x + y)

"""Returns an objective followed by two measures."""
x = trial.suggest_float("x", -10, 10)
y = trial.suggest_float("y", -10, 10)
return x**2 + y**2, x, y
trial.set_user_attr("x", x)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as in example.py

package/samplers/cmamae/sampler.py Show resolved Hide resolved
@nabenabe0928
Copy link
Contributor Author

@btjanaka
Thank you for the feedback:)
I addressed your comments!

@btjanaka
Copy link
Contributor

@nabenabe0928 It looks good to me! Thank you again!

@c-bata
Copy link
Member

c-bata commented Nov 26, 2024

@gen740 Could you review this PR?

Copy link
Member

@gen740 gen740 left a comment

Choose a reason for hiding this comment

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

LGTM!

@c-bata c-bata merged commit b7297d1 into optuna:main Dec 2, 2024
4 checks passed
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.

4 participants