« Back to top page

CMA-ES Sampler

A sampler using cmaes as the backend.

Class or Function Names

  • CmaEsSampler

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.

Package
samplers/cmaes
Author
Optuna team
License
MIT License
Verified Optuna version
  • 3.6.1
Last update
2024-07-05