Optuna Async Helper 0.3.1 | Coderz Product

optuna-async-helper 0.3.1

Last updated:

0 purchases

optuna-async-helper 0.3.1 Image
optuna-async-helper 0.3.1 Images

Free

Languages

Categories

Add to Cart

Description:

optunaasynchelper 0.3.1

Optuna Async Helper
A Helper Library for Optuna Async Optimization
Install
pip install optuna-async-helper

Usage
from optuna_async_helper import SearchSpace, SearchSpec, optimize


def rosenbrock(x: float, y: float) -> float:
return (1 - x) ** 2 + 100 * (y - x**2) ** 2


search_space: SearchSpace = [
SearchSpec(var_name="x", var_type="float", low=-5, high=5),
SearchSpec(var_name="y", var_type="float", low=-5, high=5),
]

with tempfile.TemporaryDirectory() as tempdir:
study = optimize(
study_name="rosenbrock",
storage=f"sqlite:///example.db",
objective_func=rosenbrock,
search_space=search_space,
n_trials=50,
batch_size=4,
)

assert study.best_value < 1.0
assert abs(study.best_params["x"] - 1) < 1.0
assert abs(study.best_params["y"] - 1) < 1.0

For more detail, please check optimize and SearchSpec definitions.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product: (if this is empty don't purchase this product)

Customer Reviews

There are no reviews.