Optuna

Latest version: v4.2.1

Safety actively analyzes 714772 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 19

3.2.0b0

This is the release note of [v3.2.0b0](https://github.com/optuna/optuna-integration/milestone/2).

See the [release note of Optuna v3.2.0](TBD) for more details.

3.1.1

This is the release note of [v3.1.1](https://github.com/optuna/optuna/milestone/56?closed=1).

Enhancements

- [Backport] Import `cmaes` package lazily (4573)

Bug Fixes

- [Backport] Fix botorch dependency (4569)
- [Backport] Fix param_mask for multivariate TPE with constant_liar (4570)
- [Backport] Mitigate a blocking issue while running migrations with SQLAlchemy 2.0 (4571)
- [Backport] Fix bug of CMA-ES with margin on `RDBStorage` or `JournalStorage` (4572)
- [Backport] Fix RDBStorage.get_best_trial when there are `inf`s (4574)
- [Backport] Fix CMA-ES Sampler (4581)

Code Fixes

- [Backport] Add `types-tqdm` for lint (4566)

Other

- Update version number to v3.1.1 (4567)

Thanks to All the Contributors!

This release was made possible by the authors and the people who participated in the reviews and discussions.

HideakiImamura, contramundum53, not522

3.1.0

This is the release note of [v3.1.0](https://github.com/optuna/optuna/milestone/53?closed=1).

This is not something you have to read from top to bottom to learn about the summary of Optuna v3.1. The recommended way is reading [the release blog](https://medium.com/optuna/announcing-optuna-3-1-7b4c5fac227c).

Highlights

New Features

CMA-ES with Margin

> | CMA-ES | CMA-ES with Margin |
> | ------- | -------- |
> | ![CMA-ES](https://user-images.githubusercontent.com/5564044/195026193-467fc1bc-ec4b-4e98-a09f-2b2623d345bc.gif) | ![CMA-ESwM](https://user-images.githubusercontent.com/5564044/195026228-6e9e433b-9652-4bde-8191-2911db83891f.gif) |
>
> “The animation is referred from https://github.com/EvoConJP/CMA-ES_with_Margin, which is distributed under the MIT license.”

CMA-ES achieves strong performance for continuous optimization, but there is still room for improvement in mixed-integer search spaces. To address this, we have added support for the "CMA-ES with Margin" algorithm to our `CmaEsSampler`, which makes it more efficient in these cases. You can see the benchmark results [here](https://github.com/CyberAgentAILab/cmaes/pull/121#issuecomment-1296691448). For more detailed information about CMA-ES with Margin, please refer to the paper “CMA-ES with Margin: Lower-Bounding Marginal Probability for Mixed-Integer Black-Box Optimization - [arXiv](https://arxiv.org/abs/2205.13482)”, which has been accepted for presentation at GECCO 2022.


python
import optuna
from optuna.samplers import CmaEsSampler

def objective(trial):
x = trial.suggest_float("y", -10, 10, step=0.1)
y = trial.suggest_int("x", -100, 100)
return x**2 + y

study = optuna.create_study(sampler=CmaEsSampler(with_margin=True))
study.optimize(objective)


Distributed Optimization via NFS

`JournalFileStorage`, a file storage backend based on `JournalStorage`, supports NFS (Network File System) environments. It is the easiest option for users who wish to execute distributed optimization in environments where it is difficult to set up database servers such as MySQL, PostgreSQL or Redis (e.g. 815, 1330, 1457 and 2216).

python
import optuna
from optuna.storages import JournalStorage, JournalFileStorage

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

storage = JournalStorage(JournalFileStorage("./journal.log"))
study = optuna.create_study(storage=storage)
study.optimize(objective)


For more information on `JournalFileStorage`, see the blog post [“Distributed Optimization via NFS Using Optuna’s New Operation-Based Logging Storage”](https://medium.com/optuna/distributed-optimization-via-nfs-using-optunas-new-operation-based-logging-storage-9815f9c3f932) written by wattlebirdaz.

A Brand-New Redis Storage

We have replaced the Redis storage backend with a `JournalStorage`-based one. The experimental `RedisStorage` class has been removed in v3.1. The following example shows how to use the new `JournalRedisStorage` class.

python
import optuna
from optuna.storages import JournalStorage, JournalRedisStorage

def objective(trial):


storage = JournalStorage(JournalRedisStorage("redis://localhost:6379"))
study = optuna.create_study(storage=storage)
study.optimize(objective)


Dask.distributed Integration

`DaskStorage`, a new storage backend based on [Dask.distributed](https://distributed.dask.org/en/stable/), is supported. It allows you to leverage distributed capabilities in similar APIs with `concurrent.futures`. `DaskStorage` can be used with `InMemoryStorage`, so you don't need to set up a database server. Here's a code example showing how to use `DaskStorage`:

python
import optuna
from optuna.storages import InMemoryStorage
from optuna.integration import DaskStorage
from distributed import Client, wait

def objective(trial):
...

with Client("192.168.1.8:8686") as client:
study = optuna.create_study(storage=DaskStorage(InMemoryStorage()))
futures = [
client.submit(study.optimize, objective, n_trials=10, pure=False)
for i in range(10)
]
wait(futures)
print(f"Best params: {study.best_params}")


Setting up a Dask cluster is easy: install `dask` and `distributed`, then run the `dask scheduler` and `dask worker` commands, as detailed in the [Quick Start Guide](https://distributed.dask.org/en/stable/quickstart.html) in the Dask.distributed documentation.

console
$ pip install optuna dask distributed

$ dark scheduler

3.1.0b0

This is the release note of [v3.1.0-b0](https://github.com/optuna/optuna/milestone/47?closed=1).

Highlights

CMA-ES with Margin support

> | CMA-ES | CMA-ES with Margin |
> | ------- | -------- |
> | ![CMA-ES](https://user-images.githubusercontent.com/5564044/195026193-467fc1bc-ec4b-4e98-a09f-2b2623d345bc.gif) | ![CMA-ESwM](https://user-images.githubusercontent.com/5564044/195026228-6e9e433b-9652-4bde-8191-2911db83891f.gif) |
>
> “The animation is referred from https://github.com/EvoConJP/CMA-ES_with_Margin, which is distributed under the MIT license.”

CMA-ES achieves strong performance for continuous optimization, but there is still room for improvement in mixed-integer search spaces. To address this, we have added support for the "CMA-ES with Margin" algorithm to our CmaEsSampler, which makes it more efficient in these cases. You can see the benchmark results [here](https://github.com/CyberAgentAILab/cmaes/pull/121#issuecomment-1296691448). For more detailed information about CMA-ES with Margin, please refer to the paper “CMA-ES with Margin: Lower-Bounding Marginal Probability for Mixed-Integer Black-Box Optimization - arXiv”, which has been accepted for presentation at GECCO 2022.


python
import optuna
from optuna.samplers import CmaEsSampler

def objective(trial):
x = trial.suggest_float("y", -10, 10, step=0.1)
y = trial.suggest_int("x", -100, 100)
return x**2 + y

study = optuna.create_study(sampler=CmaEsSampler(with_margin=True))
study.optimize(objective)


Distributed Optimization via NFS

`JournalFileStorage`, a file storage backend based on `JournalStorage`, supports NFS (Network File System) environments. It is the easiest option for users who wish to execute distributed optimization in environments where it is difficult to set up database servers such as MySQL, PostgreSQL or Redis (e.g. 815, 1330, 1457 and 2216).

python
import optuna
from optuna.storages import JournalStorage, JournalFileStorage

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

storage = JournalStorage(JournalFileStorage("./journal.log"))
study = optuna.create_study(storage=storage)
study.optimize(objective)


For more information on `JournalFileStorage`, see the blog post [“Distributed Optimization via NFS Using Optuna’s New Operation-Based Logging Storage”](https://medium.com/optuna/distributed-optimization-via-nfs-using-optunas-new-operation-based-logging-storage-9815f9c3f932) written by wattlebirdaz.



Dask Integration

`DaskStorage`, a new storage backend based on [Dask.distributed](https://distributed.dask.org/en/stable/), is supported. It enables distributed computing in similar APIs with `concurrent.futures`. An example code is like the following (The full example code is available in the [optuna-examples](https://github.com/optuna/optuna-examples/blob/main/dask/dask_simple.py) repository).

python
import optuna
from optuna.storages import InMemoryStorage
from optuna.integration import DaskStorage
from distributed import Client, wait

def objective(trial):
...

with Client("192.168.1.8:8686") as client:
study = optuna.create_study(storage=DaskStorage(InMemoryStorage()))
futures = [
client.submit(study.optimize, objective, n_trials=10, pure=False)
for i in range(10)
]
wait(futures)
print(f"Best params: {study.best_params}")


One of the interesting aspects is the availability of `InMemoryStorage`. You don’t need to set up database servers for distributed optimization. Although you still need to set up the Dask.distributed cluster, it’s quite easy like the following. See [Quickstart of the Dask.distributed documentation](https://distributed.dask.org/en/stable/quickstart.html) for more details.

python
$ pip install optuna dask distributed

$ dark-scheduler

3.0.6

This is the release note of [v3.0.6](https://github.com/optuna/optuna/milestone/55?closed=1).

Installation

- Fix a project metadata for scipy version constraint (4494)

Other

- Bump up version number to v3.0.6 (4493)

Thanks to All the Contributors!

This release was made possible by the authors and the people who participated in the reviews and discussions.

c-bata HideakiImamura

3.0.5

This is the release note of [v3.0.5](https://github.com/optuna/optuna/milestone/52?closed=1).

Bug Fixes

- [Backport] Fix bugs in `constant_liar` option (4257)

Other

- Bump up version number to 3.0.5 (4256)


Thanks to All the Contributors!

This release was made possible by the authors and the people who participated in the reviews and discussions.

HideakiImamura, eukaryo, toshihikoyanase

Page 4 of 19

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.