Scaling Optuna with Dask
Project description
Dask-Optuna
Dask-Optuna helps improve integration between Optuna and Dask
by leveraging Optuna's existing distributed optimization capabilities to run
optimization trials in parallel on a Dask cluster. It does this by providing a
Dask-compatible dask_optuna.DaskStorage
storage class which wraps an
Optuna storage class (e.g. Optuna's in-memory or sqlite storage) and can be used
directly by Optuna. For example:
import optuna
import joblib
import dask.distributed
import dask_optuna
def objective(trial):
x = trial.suggest_uniform("x", -10, 10)
return (x - 2) ** 2
with dask.distributed.Client() as client:
# Create a study using Dask-compatible storage
storage = dask_optuna.DaskStorage()
study = optuna.create_study(storage=storage)
# Optimize in parallel on your Dask cluster
with joblib.parallel_backend("dask"):
study.optimize(objective, n_trials=100, n_jobs=-1)
print(f"best_params = {study.best_params}")
Documentation
See the Dask-Optuna documentation for more information.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dask-optuna-0.0.1.tar.gz
(26.3 kB
view hashes)
Built Distribution
Close
Hashes for dask_optuna-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b259907e6eca45f51def2bd084b2527282c7042b5d1a709373145e551e6465e3 |
|
MD5 | c95698b258f3351177ebc7eb55348ffa |
|
BLAKE2b-256 | 81aafaf6d1810a927fb05ca9049bd46f8bfd9f6e2f18597e75cdd899933addb5 |