-
Notifications
You must be signed in to change notification settings - Fork 5
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
Provide default/good hyperparameters to start search #53
Comments
Thank you @JohnGiorgi for raising the interesting issue. You would like to set a fixed parameter set like the following?: import optuna
def objective(trial):
x = trial.suggest_float("x", 0, 10)
return x ** 2
study = optuna.create_study()
study.enqueue_trial({"x": 5}) # set a parameter x=5 for the first trial
study.enqueue_trial({"x": 0}) # then set x=0 for the next trial
study.optimize(objective, n_trials=2)
assert study.trials[0].params == {"x": 5} # x=5 in the first trial
assert study.trials[1].params == {"x": 0} # x=0 in the second trial If my understanding is correct, the answer is (partially) yes. 1. create study and set manual hyperparameters in Python> python
>> import optuna
>> study = optuna.craete_study(storage="sqlite:///sample.db", study_name="some_name")
>> study.enqueue_trial({"x1": your_awesome_parameter, "x2": your_awesome_parameter})
>> exit() 2. use the study in allennlp-optunaallennlp tune ... --study some_name --storage sqlite:///sample.db --skip-if-exists |
@himkt That's great! This is exactly what I was looking for. I will try this out :) |
@JohnGiorgi Let me close this issue. Please feel free to reopen if you need! 👋 |
Is there any way to provide a set of default hyperparameters to start the search?
The motivation would be that you already have a sense of "good" hyperparameters, so beginning the search with them may be far more efficient, especially when using a sampler.
The text was updated successfully, but these errors were encountered: