I understand that I can do distributed optimization with Optuna. However, I don't know if I can do it with multiple models at the same time?
For example:
optuna create-study --study-name "distributed-example1" --storage "sqlite:///example.db"
optuna create-study --study-name "distributed-example2" --storage "sqlite:///example.db"
Then in example1.py:
import optuna
def objective(trial):
x = trial.suggest_uniform('x', -10, 10)
return (x - 2) ** 2
if __name__ == '__main__':
study = optuna.load_study(study_name='distributed-example1', storage='sqlite:///example.db')
study.optimize(objective, n_trials=100)
Then in example2.py:
import optuna
def objective(trial):
x = trial.suggest_uniform('x', -10, 10)
return (x - 2) ** 2
if __name__ == '__main__':
study = optuna.load_study(study_name='distributed-example2', storage='sqlite:///example.db')
study.optimize(objective, n_trials=100)