optuna / optuna

A hyperparameter optimization framework
https://optuna.org
MIT License
10.91k stars 1.04k forks source link

Support multi-objective CMA-ES (MOCMAES) sampling algorithm #5375

Open hnanacc opened 7 months ago

hnanacc commented 7 months ago

Motivation

Optuna currently supports only single-objective CMA-ES for sampling, it would be useful to have multi-objective CMA-ES as a lot of tasks need to consider multiple objectives to be optimized together.

This would also be helpful for other HPO/AutoML frameworks that depend on Optuna for their functionality. This issue is particularly motivated from the need to support MOCMAES in kubeflow/katib.

Description

Similar to other multi-objective sampling algorithms, MOCMAES will be able to work with multiple objectives.

# multi-objective function to be optimized.
def multi_objective(trial):
    ...
    return objective_1, objective_2

# use CMA-ES sampler with multi-ojective.
sampler = optuna.samplers.CmaEsSampler()

# specify directions for each objective.
study = optuna.create_study(sampler=sampler, directions=['maximize', 'minimize'])

# execute the optimization process with multi-objective.
study.optimize(multi_objective, n_trials=1000, timeout=1000)

# visualize pareto-front
optuna.visualization.plot_pareto_front(study, target_names=["objective_1", "objective_2"])

Alternatives (optional)

Currently, there are no decent solutions to MOCMAES, which are also maintained in the open-source domain.

Some relevant solutions are chocolate and pycomocma which were both last committed 4 years ago.

An option would be add pycomocma as an optuna-integration and maintain it further.

Additional context (optional)

No response

c-bata commented 7 months ago

@hnanacc (cc: @tenzen-y) Thank you for your feature request!

@nomuramasahir0, the maintainer of cmaes (https://github.com/CyberAgentAILab/cmaes), is planning to work on implementing MOCMAES. However, we do not have a definite schedule for the completion of this task yet. Would it be possible for you (and Katib) to wait until our implementation is completed?

tenzen-y commented 7 months ago

@hnanacc (cc: @tenzen-y) Thank you for your feature request!

@nomuramasahir0, the maintainer of cmaes (https://github.com/CyberAgentAILab/cmaes), is planning to work on implementing MOCMAES. However, we do not have a definite schedule for the completion of this task yet. Would it be possible for you (and Katib) to wait until our implementation is completed?

@hnanacc @c-bata Thank you for pointing this out! Yes, we (katib) can wait for the implementation. It might be better to create a feature request issue in the cmaes (https://github.com/CyberAgentAILab/cmaes) repository to ask cmaes maintainers to raise the priority of MOCMAES. WDYT?

cc: @andreyvelich

y0z commented 1 month ago

@hnanacc @tenzen-y

MO-CMA-ES is now available on OptunaHub!

You can use MoCmaSampler as follows.

import optunahub

sampler = optunahub.load_module("samplers/mocma").MoCmaSampler(popsize=100, seed=42)
tenzen-y commented 1 month ago

@hnanacc @tenzen-y

MO-CMA-ES is now available on OptunaHub!

Thank you for letting us know! @hnanacc Could you take the implementation on the Katib side?