-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Limit the maximum number of trials to be added for the quicker first response #719
Limit the maximum number of trials to be added for the quicker first response #719
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #719 +/- ##
==========================================
+ Coverage 68.96% 69.07% +0.10%
==========================================
Files 35 35
Lines 2388 2393 +5
==========================================
+ Hits 1647 1653 +6
+ Misses 741 740 -1 ☔ View full report in Codecov by Sentry. |
f4aafb7
to
e50288c
Compare
@c-bata However, I think it would be better to separate this PR into smaller PRs as this PR has multiple modifications:
I will count on you for the decision, but if you believe it is better to split this PR, please tell me which modifications should be bundled. |
12ec631
to
b4f9ca9
Compare
a7a21ce
to
a7edb1c
Compare
@c-bata @keisuke-umezawa The PR is ready for reviews as the PR#727 was merged:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some nits and questions. Overall it seems good to me, but how did you assure the quality of code? If possible, you can add some unit test to guarantee it, or at least I would like to check it with some scripts.
569bfea
to
1562c12
Compare
@keisuke-umezawa I added some tests") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on it! LGTM.
@c-bata |
More specifically, this PR makes the following changes: 1. Add query param for limit, 2. Update studyDetails only if there is no study with the specified study_id or the fetched trials has a positive length, 3. Shorten the waiting interval when there is a leftover in the server side, and 4. Adapt the flake8 setup to the Optuna repo.
00ea9e5
to
c10be8f
Compare
import optuna
def objective_many_trials_imbalance_importances(trial: optuna.Trial) -> float:
if (trial.number + 1) % 500 == 0:
print(f"Evaluate Trial#{trial.number}")
x1 = trial.suggest_float("x1", 0, 10)
x2 = trial.suggest_float("x2", 0, 10)
x3 = trial.suggest_categorical("x3", ["foo", "bar"])
return (x1 - 2) ** 2 + (x2 - 5) ** 2
storage = optuna.storages.InMemoryStorage()
study = optuna.create_study(study_name="test", storage=storage, sampler=optuna.samplers.RandomSampler())
study.optimize(objective_single, n_trials=10000) |
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.
Reference Issues/PRs
As the first response becomes significantly slower as the number of trials increases, this PR limits the number of trials to be added at the first response.
More specifically, each
GET
can take onlyn=limit
trials.What does this implement/fix? Explain your changes.
I added a query parameter for
GET
of trials.