OptunaHub / CMA-ES Sampler

A sampler using cmaes as the backend.

Package: samplers/cmaes
Author: Optuna team
License: MIT License
Verified Optuna version: 3.6.1

Class or Function Names

Installation

pip install cmaes

Example

import optuna
from optuna.samplers import CmaEsSampler


def objective(trial):
    x = trial.suggest_float("x", -1, 1)
    y = trial.suggest_int("y", -1, 1)
    return x**2 + y


sampler = CmaEsSampler()
study = optuna.create_study(sampler=sampler)
study.optimize(objective, n_trials=20)

Others

See the documentation for more details.