NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #911 most downloaded on PyPI
A hyperparameter optimization framework
Last release 27 days ago
07 Sep 2026
Ships on a steady schedule
a new release about every 2 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
79 releases · first in 2018
Accordingly, the sampler-specific constraints_func arguments are now deprecated. ( #6736 , #6754 , #6773 )
This is the release note for v5.0.0.
Optuna v5.0 introduces the first major update to its default sampler configuration since v1.5. For single-objective optimization, TPESampler now enables multivariate TPE (#6746) and the constant liar strategy by default (#6738), together with enhanced bandwidth computation (Watanabe 2023). For multi-objective optimization, TPESampler replaces NSGAIISampler as the default sampler (#6766). These settings were selected through comprehensive benchmarking to improve optimization performance.
Constrained optimization is now represented directly in Optuna’s core Trial API. Constraint values can be set inside the objective function using trial.set_constraint() and retrieved through trial.constraints, providing a consistent interface across supported samplers. Accordingly, the sampler-specific constraints_func arguments are now deprecated. (#6736, #6754, #6773)
Optuna v5.0 makes PedAnovaImportanceEvaluator the default evaluator used by optuna.importance.get_param_importances(), replacing f-ANOVA. PED-ANOVA computes parameter importances substantially faster, works with Optuna’s standard dependencies, and now supports conditional search spaces and multi-objective studies. The conditional extension, Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces, was accepted at KDD 2026. (#6682, #6728, #6748)
GPSampler, now a stable API in Optuna v5.0, introduces Monte Carlo-based q-batch acquisition functions that account for trials currently under evaluation. Rather than assigning each running trial a single heuristic pseudo-value, these acquisition functions integrate over possible outcomes sampled from the Gaussian process posterior, allowing predictive uncertainty to inform subsequent suggestions.
The new acquisition functions cover all four major problem settings: qLogEI for unconstrained single-objective optimization, qLogCEI for constrained single-objective optimization, qLogEHVI for unconstrained multi-objective optimization, and qLogCEHVI for constrained multi-objective optimization. This provides a more principled approach to parallel Bayesian optimization across the problem settings supported by GPSampler. (#6715, #6640, #6744, #6792, #6804)
optuna.multi_objective module (#6686)GPSampler (#6715)constant_liar by default (#6738)QMCSampler (#6742, thanks @saivedant169!)TPESampler (#6746)PedAnovaImportanceEvaluator the default importance evaluator (#6748)TPESampler the default sampler for multi-objective optimization (#6766)constraints_func (#6773)RDBStorage and JournalStorage (#6776)axis_order argument from plot_pareto_front (#6781)system_attrs from StudySummary (#6782)categorical_distance_func from TPESampler (#6783)MXNetPruningCallback (optuna/optuna-integration#294)constraints property in BoTorchSampler (optuna/optuna-integration#306)set_system_attr and system_attrs from TorchDistributedTrial (optuna/optuna-integration#309)set_system_attr and system_attrs from Study and Trial (#6834)target is None (#6728)constraints property to Trial (#6736)set_constraint method to Trial (#6754)constraints and set_constraint in TorchDistributedTrial (optuna/optuna-integration#308)qConstrainedLogEI (#6744, thanks @sawa3030!)qLogEHVI (#6792, thanks @sawa3030!)qConstrainedLogEHVI in GPSampler (#6804, thanks @sawa3030!)constraints argument in create_trial (#6816)QMCSampler fallback to independent sampling in distributed setups (#6638, thanks @Rishabh-git10!)BruteForceSampler by avoiding full tree build based on tree size check (#6646)BruteForceSampler (#6649)BruteForceSampler by candidates caching (#6650)BruteForceSampler refactoring [3/3] (#6657)BruteForceSampler for speedup (#6705)ValueError in PedAnovaImportanceEvaluator for multi-objective studies without target (#6716)GPSampler OMP issue (#6753)_get_constraint_funcs to avoid closure bug (optuna/optuna-integration#278, thanks @GopalGB!)JournalStorage to read Rustuna journal files (#6790)CmaEsSampler in constrained optimization (#6802)ValueError in importances (#6720)qehvi_candidates_func and qnehvi_candidates_func (optuna/optuna-integration#302, thanks @adrianhtt!)IntDistribution midpoint bias in _SearchSpaceTransform and add tests (#6771, thanks @yen-0!)metric_names order in trials_dataframe columns (#6786, thanks @rkfshakti!)QMCSampler to TestRelativeSampler coverage and clamp log-float untransform at low bound (#6799, thanks @yen-0!)BruteForceSampler (#6652)CmaEsSampler options (#6694)TPESampler options to the end (#6696)SPXCrossover citation (#6698, thanks @Divyansh-ag14!)TPESampler (#6712)AutoSampler citation path (#6714)n_warmup_steps boundary in MedianPruner and PercentilePruner (#6733, thanks @vin0san!)GCSArtifactStore docstring example (#6815, thanks @maupatel!)optuna.testing (#6765)BoTorchSampler unit test using optuna pytest samplers (optuna/optuna-integration#305, thanks @yen-0!)test_brute_force.py (#6706)gp.py (#6710)params validation in PED-ANOVA (#6729)Literal | StudyDirection (#6762, thanks @yen-0!)optuna/visualization/matplotlib/_rank.py (#6767)qConstrainedLogEI (#6779, thanks @sawa3030!)contextmanager (#6793, thanks @yen-0!)plotly<7 where kaleido<1 is required (#6829)attestations: false to fix release workflow (#6690)5.0.0rc1 (#6784)attestations: false to fix the release workflow (optuna/optuna-integration#291)CODEOWNERS file (optuna/optuna-integration#301)This release was made possible by the authors and the people who participated in the reviews and discussions.
@Alnusjaponica, @Divyansh-ag14, @GopalGB, @Rishabh-git10, @Ryo2611, @ShamikOfficial, @adrianhtt, @c-bata, @gen740, @himkt, @hrntsm, @ishitta-iyer, @kAIto47802, @maupatel, @nabenabe0928, @not522, @porink0424, @rkfshakti, @saivedant169, @sawa3030, @uczltw6, @vin0san, @y0z, @yen-0
One column per quarter.
Along with these new apis, constraints_func argument on samplers is now deprecated.
This is the release note of v5.0.0-rc1.
Since this is a pre-release, do not forget to specify the version number to upgrade Optuna.
pip install optuna==5.0.0rc1
Multivariate TPE with a constant liar strategy and an enhanced bandwidth computation (Watanabe 2023) has become the default algorithm for single-objective optimization. Multi-Objective TPE has been adopted as the new default sampler for multi-objective optimization, replacing NSGA-II. We conducted comprehensive benchmarking, carefully selected default options, and modified implementation details to maximize optimization performance.
Our paper, Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces, has been accepted to the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD 2026)!
Optuna v5.0 now supports this feature and adopts it as the default algorithm for hyperparameter importance.
import optuna
# Starting in Optuna v5.0, the default hyperparameter importance algorithm
# supports conditional search spaces like the one below:
def objective(trial):
classifier_name = trial.suggest_categorical("classifier", ["SVC", "RandomForest"])
if classifier_name == "SVC":
svc_c = trial.suggest_float("svc_c", 1e-10, 1e10, log=True)
classifier_obj = sklearn.svm.SVC(C=svc_c, gamma="auto")
else:
rf_max_depth = trial.suggest_int("rf_max_depth", 2, 32, log=True)
classifier_obj = sklearn.ensemble.RandomForestClassifier(
max_depth=rf_max_depth, n_estimators=10
)
return …
study = optuna.create_study()
study.optimize(objective)
optuna.importance.get_param_importances(study)Starting in Optuna v5.0, the interface for constrained optimization has changed:
trial.set_constraint() is added to set constraint values.trial.constraints is added to get constraints.Along with these new apis, constraints_func argument on samplers is now deprecated.
import optuna
def objective(trial):
trial.set_constraint(“c0”, c0)
trial.set_constraint(“c1”, c1)
…
# The constraints_func argument is now deprecated.
sampler = optuna.samplers.TPESampler()
study = optuna.create_study(sampler=samplera)
study.optimize(objective)
print(study.best_trial.constraints)optuna.multi_objective module (#6686)constant_liar by default (#6738)PedAnovaImportanceEvaluator the default importance evaluator (#6748)constraints_func (#6773)axis_order argument from plot_pareto_front (#6781)system_attrs from StudySummary (#6782)categorical_distance_func from TPESampler (#6783)target is None (#6728)constraints property to Trial (#6736)set_constraint method to Trial (#6754)BruteForceSampler by avoiding full tree build based on tree size check (#6646)BruteForceSampler by candidates caching (#6650)BruteForceSampler refactoring [3/3] (#6657)BruteForceSampler for speedup (#6705)ValueError in PedAnovaImportanceEvaluator for multi-objective studies without target (#6716)TPESampler the default sampler for multi-objective optimization (#6766)ValueError in importances (#6720)BruteForceSampler (#6652)TPESampler (#6712)AutoSampler citation path (#6714)n_warmup_steps boundary in MedianPruner and PercentilePruner (#6733, thanks @vin0san!)test_brute_force.py (#6706)gp.py (#6710)params validation in PED-ANOVA (#6729)optuna/visualization/matplotlib/_rank.py (#6767)attestations: false to fix release workflow (#6690)5.0.0rc1 (#6784)This release was made possible by the authors and the people who participated in the reviews and discussions.
@Alnusjaponica, @Divyansh-ag14, @Rishabh-git10, @Ryo2611, @c-bata, @gen740, @himkt, @hrntsm, @kAIto47802, @nabenabe0928, @not522, @porink0424, @saivedant169, @sawa3030, @vin0san, @y0z, @yen-0
The following features are deprecated in v4.9.0 and scheduled for removal in v6.0.0.
This is the release note of v4.9.0.
@sawa3030 introduces parallelization enhancements to GPSampler, leveraging the Kriging Believer approach for constrained and multi-objective optimization (#6481). This improvement allows for more efficient exploration when multiple trials are running concurrently.
The GP surrogate is updated by assigning temporary objective function values to the running trials.
For more technical details and benchmarks, please check out our blog post: Improving Optuna’s GPSampler Parallelization by Considering Running Trials.
The following features are deprecated in v4.9.0 and scheduled for removal in v6.0.0.
optuna
TPESampler (#6635)
prior_weight, consider_magic_clip, consider_endpoints, gamma, weights, hyperopt_parameters: These internal parameters are being deprecated to simplify the interface, as the default settings are optimal for most use cases.warn_independent_sampling: Deprecated because TPESampler now robustly supports both independent and joint sampling, making this warning obsolete.categorical_distance_func: This advanced feature will be migrated to OptunaHub in the future.x0 and sigma0 options in CmaEsSampler (#6624)
CmaEsSampler's internals to be configured effectively.optuna.terminator module (#6668)
RetryFailedTrialCallback (#6670)
RetryHeartbeatStaleTrialCallback to better reflect its behavior and avoid confusion with general trial retries (#6085).optuna.integration module
optuna.integration module currently acts as a shortcut to the external optuna_integration package for backward compatibility. Please import directly from the optuna_integration package going forward.optuna-integration
PyCmaSampler: Please use Optuna's native CmaEsSampler instead.CometCallback: This feature will be migrated to OptunaHub in the future.MLflowCallback: This feature will be migrated to OptunaHub in the future.TensorBoardCallback: This feature will be migrated to OptunaHub in the future.TrackioCallback: This feature will be migrated to OptunaHub in the future.WeightsAndBiasesCallback: This class has already been migrated to OptunaHub.PyCmaSampler (optuna/optuna-integration#276)CometCallback (optuna/optuna-integration#280)WeightsAndBiasesCallback (optuna/optuna-integration#283)QMCSampler stateless (#6616)x0 and sigma0 options in CmaEsSampler (#6624)TPESampler arguments (#6635)optuna.terminator module (#6668)RetryFailedTrialCallback to RetryHeartbeatStaleTrialCallback (#6670)prior_mu from compute_sigmas (#6574)BruteForceSampler (#6627, thanks @Rishabh-git10!)BruteForceSampler (#6645)BruteForceSampler by using any instead of count (#6647)BruteForceSampler (#6648)BruteForceSampler refactoring [2/3] (#6656)None handling in slice plots (#6621)BruteForceSampler refactoring [2/3] (#6656)best_trial/best_trials in constrained optimization (#6522)QMCSampler docstring (#6631, thanks @RudrenduPaul!)BruteForceSampler and GridSampler information in docs (#6651)broadcast_object_list instead of a custom method (optuna/optuna-integration#274)Axes in visualization functions (#6504, thanks @kvr06-ai!)optuna.samplers._partial_fixed to TYPE_CHECKING (#6527, thanks @t7r0n!)tests/test_distributions.py (#6543, thanks @t7r0n!)datetime import in tests/trial_tests/test_trial.py (#6544, thanks @t7r0n!)TYPE_CHECKING in samplers/_tpe/sampler.py (#6545, thanks @yasumorishima!)TYPE_CHECKING in nsgaii/_crossover.py (#6546, thanks @yasumorishima!)TYPE_CHECKING for imports in importance/_ped_anova/scott_parzen_estimator.py (#6554, thanks @Aliipou!)TYPE_CHECKING in samplers/_nsgaiii/_elite_population_selection_strategy.py (#6557, thanks @Aliipou!)TYPE_CHECKING in samplers/_nsgaiii/_sampler.py (#6558, thanks @Aliipou!)Study import to TYPE_CHECKING in _timeline.py (#6559, thanks @rpathade!)TYPE_CHECKING in nsgaii/_crossovers/_base.py (#6561, thanks @saivedant169!)TYPE_CHECKING in nsgaii/_crossovers/_blxalpha.py (#6562, thanks @saivedant169!)TYPE_CHECKING in nsgaii/_crossovers/_uniform.py (#6563, thanks @saivedant169!)TYPE_CHECKING in tests/test_multi_objective (#6564, thanks @acabellom!)TYPE_CHECKING in nsgaii/_sampler.py (#6565, thanks @saivedant169!)TYPE_CHECKING in optuna.samplers._qmc (#6566, thanks @hnshah!)TYPE_CHECKING in visualization/_rank.py (#6567, thanks @nightcityblade!)TYPE_CHECKING in visualization/_parallel_coordinate.py (#6568, thanks @nightcityblade!)TYPE_CHECKING in visualization/_slice.py (#6569, thanks @nightcityblade!)TYPE_CHECKING in visualization/_intermediate_values.py (#6570, thanks @nightcityblade!)TYPE_CHECKING in visualization/_hypervolume_history.py (#6571, thanks @nightcityblade!)TYPE_CHECKING in visualization/_contour.py (#6572, thanks @saivedant169!)TYPE_CHECKING in visualization/_edf.py (#6575, thanks @saivedant169!)TYPE_CHECKING in visualization/_optimization_history.py (#6576, thanks @saivedant169!)TYPE_CHECKING in visualization/_hypervolume_history.py (#6577, thanks @saivedant169!)TYPE_CHECKING in visualization/_pareto_front.py (#6578, thanks @saivedant169!)TYPE_CHECKING in visualization/_terminator_improvement.py (#6579, thanks @saivedant169!)TYPE_CHECKING in visualization/_rank.py (#6580, thanks @saivedant169!)TYPE_CHECKING in visualization/_slice.py (#6581, thanks @saivedant169!)TYPE_CHECKING in visualization/_parallel_coordinate.py (#6584, thanks @saivedant169!)TYPE_CHECKING in optuna/visualization/matplotlib/_utils.py (#6585, thanks @nightcityblade!)TYPE_CHECKING in optuna/visualization/matplotlib/_edf.py (#6586, thanks @nightcityblade!)TYPE_CHECKING in optuna/visualization/matplotlib/_contour.py (#6587, thanks @nightcityblade!)TYPE_CHECKING in optuna/visualization/matplotlib/_pareto_front.py (#6588, thanks @nightcityblade!)TYPE_CHECKING in optuna/visualization/matplotlib/_param_importances.py (#6589, thanks @nightcityblade!)TYPE_CHECKING in visualization/_intermediate_values.py (#6591, thanks @saivedant169!)TYPE_CHECKING in visualization/matplotlib/_optimization_history.py (#6592, thanks @saivedant169!)TYPE_CHECKING in visualization/matplotlib/_parallel_coordinate.py (#6593, thanks @saivedant169!)TYPE_CHECKING in visualization/matplotlib/_rank.py (#6594, thanks @saivedant169!)optuna.integration.__init__.py (#6597)QMCSampler (#6614)TPESampler with multivariate=True (#6618)optuna.storages._rdb.storage.py (#6672)Note truncated.
Use f-strings in _deprecated.py ( #6443 , thanks @edwiniac !)
This is the release note of v4.8.0.
A constant liar strategy for efficient parallelization has been introduced to GPSampler by @sawa3030. The figures (left: v4.7.0, right: v4.8.0) show that the overlap of search points has decreased, and a wider variety of solutions are being explored. The experiment uses n_jobs = 10 and n_trials = 100. Currently, this feature supports single-objective and unconstrained optimization. Further extensions are coming in v4.9.0.
| v4.7.0 | v4.8.0 |
|---|---|
@yasumorishima introduces the new visualization to OptunaHub. Please refer to https://hub.optuna.org/visualization/plot_beeswarm/ for details.
GPSampler (#6430)PartialFixedSampler and TPESampler with group decomposed search space (#6428)TPESampler with multivariate and constant_liar (#6505)WilcoxonPruner requires scipy (#6477)aim CI (optuna/optuna-examples#353)transformers (optuna/optuna-examples#355)SamplerTestCase class in optuna.testing package (#6424)test_before_trial and test_after_trial_* to test_trial.py and test_study.py, respectively (#6429)_param_importances.py (#6423, thanks @dotz0ver!).format() with f-strings in _parallel_coordinate.py (#6431, thanks @yasumorishima!)TYPE_CHECKING for import in pruners/_base.py (#6434, thanks @yasumorishima!)optuna/storages/_base.py (#6435, thanks @edwiniac!)_contour.py (#6436, thanks @edwiniac!)_intermediate_values.py (#6437, thanks @edwiniac!)cli.py (#6438, thanks @edwiniac!)optuna/testing/storages.py (#6439, thanks @edwiniac!)optuna/storages/journal/_storage.py (#6440, thanks @edwiniac!)_imports.py (#6442, thanks @edwiniac!)_deprecated.py (#6443, thanks @edwiniac!)TYPE_CHECKING for import in pruners/_hyperband.py (#6447, thanks @yasumorishima!)TYPE_CHECKING for typing-only imports in test_timeline.py (#6451, thanks @KRMed!)_convert_positional_args.py (#6483, thanks @toroleapinc!)TYPE_CHECKING block (#6484, thanks @acabellom!)__repr__ in trial/_frozen.py to use f-strings (#6485, thanks @Bhavyag1337!)TYPE_CHECKING in pruners/_threshold.py (#6487, thanks @LuciferDono!)tutorial/10_key_features/005_visualization.py (#6489, thanks @maheer14!)JSONSerializable import to TYPE_CHECKING in study/study.py (#6490, thanks @yasumorishima!)optuna import to TYPE_CHECKING in pruners/_patient.py (#6501, thanks @yasumorishima!)TYPE_CHECKING in pruners/_patient.py (#6502, thanks @nightcityblade!)TYPE_CHECKING in pruners/_successive_halving.py (#6503, thanks @nightcityblade!).format() with f-strings in 002_configurations.py (#6506, thanks @acabellom!)FastAIV2PruningCallback (optuna/optuna-integration#265)NamedTemporaryFilePool (#6417)4.8.0.dev (optuna/optuna-integration#263)This release was made possible by the authors and the people who participated in the reviews and discussions.
@Bhavyag1337, @KRMed, @Lakshman142, @LuciferDono, @ParagEkbote, @Quant-Quasar, @RinZ27, @VedantMadane, @acabellom, @aerosta, @buddy0452004, @c-bata, @dhruvildarji, @dotz0ver, @edwiniac, @gen740, @kAIto47802, @maheer14, @nabenabe0928, @nightcityblade, @not522, @roli-lpci, @ryota717, @sateeshkumarb, @sawa3030, @toroleapinc, @y0z, @yasumorishima
This is the release note of v4.7.0 .
This is the release note of v4.7.0.
@hrntsm introduces two new multi-objective samplers—SPEA-II (Strength Pareto Evolutionary Algorithm 2) and HypE (Hypervolume Estimation Algorithm)—to OptunaHub. SPEA-II is an improved multi-objective evolutionary algorithm that differs from NSGA-II in its selection mechanism. HypE is a fast, hypervolume-based evolutionary algorithm designed for many-objective optimization problems. Please refer to the following pages for more details:
PedAnovaImportanceEvaluator Now Supports Local Hyperparameter Importance ComputationThe target_quantile and region_quantile arguments have been introduced to PedAnovaImportanceEvaluator. This change allows you to investigate local hyperparameter importance rather than the global one with region_quantile < 1.0. See the original paper for the technical details.
JournalStorage lock acquisition is delayed (#6361)TPESampler (#6258)SECURITY.md (#6317)-W option on Sphinx build (#6373)minio version to <=7.2.18 to fix CI & stop daily CI running (optuna/optuna-examples#339).format() with f-string in _setup_studies (#6326, thanks @haitham404!)_upload.py for TYPE_CHECKING (#6327, thanks @satyarth7srivastava!)optuna/samplers/_cmaes.py (#6331, thanks @swativdusane!).format() with f-string in _parallel_coordinate.py (#6333, thanks @satyarth7srivastava!).format with f-strings in optuna/importance/_base (#6342, thanks @VihaanMotwani!)_terminator_improvement.py for TYPE_CHECKING (#6343, thanks @satyarth7srivastava!).format with f-string in _param_importances.py (#6345, thanks @Harshadev-24!).format with f-string in tutorial/20_recipes/004_cli.py (#6350, thanks @RektPunk!).format with f-string in optuna/study/_optimize.py (#6351, thanks @RektPunk!)optuna/ files with Ruff (#6352)tests/ and tutorials/ files with Ruff (#6360)_color_supported() check (#6363)StorageTestCase class in optuna.testing package (#6369)optuna/pruners/_hyperband.py (#6370, thanks @eleannapapaio!)test_study.py to use f-string instead of .format() (#6372, thanks @nepersoned!)_successive_halving.py (#6375, thanks @spenam!)optuna/trial/_frozen.py (#6377, thanks @spenam!)optuna/study/study.py (#6378, thanks @spenam!)tests/study_tests/test_study.py (#6379, thanks @spenam!)TYPE_CHECKING in test_visualizations.py (#6380, thanks @Sip4818!)TYPE_CHECKING in _constrained_optimization.py (#6381, thanks @Sip4818!)TYPE_CHECKING in _multi_objective.py (#6385, thanks @Sip4818!)FrozenTrial import under TYPE_CHECKING for _study_summary.py file (#6386, thanks @Sip4818!)TYPE_CHECKING in optuna/terminator/callback.py (#6388, thanks @Sip4818!).format() (#6389, thanks @Lakshman142!)optuna/_experimental.py (#6390, thanks @Rohan0497!)StorageTestCase scenarios involving trial state and values (#6391)type-hint import inside Type-Checking block in optuna\terminator\erroreval.py (#6395, thanks @Sip4818!)type-check imports to TYPE_CHECKING in optuna\terminator\improvement\emmr.py (#6396, thanks @Sip4818!)TYPE_CHECKING in matplotlib/_slice.py (#6399, thanks @kapishyadav!)logger.warning instead of optuna_warn for lock-acquisition delay notifications (#6400)optuna/samplers/_grid.py (#6401, thanks @kapishyadav!)storages/_in_memory.py to use f-strings (#6404, thanks @jrings!)type-hint imports into type-checking block in optuna\terminator\improvement\evaluator.py (#6405, thanks @Sip4818!)type-hint imports into type-checking block in median_erroreval.py (#6408, thanks @Sip4818!).format() with f-string in _rank.py (#6409, thanks @jwalith!)storage_tests/test_with_server.py (#6330)storage_tests/test_cached_storage.py (#6337)storage_tests/rdb_tests/test_storage.py (#6338)-W option on Sphinx build (#6354)v4.7.0.dev (#6325)formats.sh and tidy up CONTRIBUTING.md (#6353)asv and the speed benchmark workflow (#6393)This release was made possible by the authors and the people who participated in the reviews and discussions.
@Alnusjaponica, @Banjiola, @Harshadev-24, @HideakiImamura, @Kaichi-Irie, @Lakshman142, @Nayil97, @ParagEkbote, @Quant-Quasar, @RektPunk, @Rohan0497, @Sip4818, @VedantMadane, @VihaanMotwani, @c-bata, @eleannapapaio, @fritshermans, @fusawa-yugo, @gadmin7, @gen740, @haitham404, @jiayusu, @jrings, @jwalith, @kAIto47802, @kapishyadav, @nabenabe0928, @nepersoned, @not522, @nzw0301, @satyarth7srivastava, @sawa3030, @sotagg, @spenam, @swativdusane, @toshihikoyanase, @varundevr, @y0z
@yasumorishima introduces the new visualization to OptunaHub. Please refer to https://hub.optuna.org/visualization/plot_beeswarm/ for details.
Add Trackio Integration for Optuna ( optuna/optuna-integration#259 , thanks @ParagEkbote !)
Add constant liar strategy to GPSampler ( #6430 )
Validate artifact_id in FileSystemArtifactStore to prevent path traversal ( #6432 , thanks @RinZ27 !)
fix: correct inverted warning message in pareto front plot ( #6498 , thanks @aerosta !)
Fix shared callback state in parallel OptunaSearchCV with LightGBM ( optuna/optuna-integration#260 , thanks @Quant-Quasar !)
Fix GPSampler crash when torch default device is CUDA ( #6418 , thanks @VedantMadane !)
Fix combination between PartialFixedSampler and TPESampler with group decomposed search space ( #6428 )
Fix TPESampler with multivariate and constant_liar ( #6505 )
Add documentation indicating that WilcoxonPruner requires scipy ( #6477 )
Remove version & language selectors in the sidebar of docs ( #6482 )
Apply black 26.1.0 ( optuna/optuna-examples#348 )
Remove CI workflow for allennlp since no longer maintained ( optuna/optuna-examples#351 )
Reduce the frequency of scheduled CI triggers ( optuna/optuna-examples#352 )
Remove the scheduled trigger for aim CI ( optuna/optuna-examples#353 )
Add constraint to transformers ( optuna/optuna-examples#355 )
Add SamplerTestCase class in optuna.testing package ( #6424 )
Move test_before_trial and test_after_trial_* to test_trial.py and test_study.py , respectively ( #6429 )
Move type-only imports to TYPE_CHECKING in _param_importances.py ( #6423 , thanks @dotz0ver !)
Use future .annotations in matplotlib/_intermediate_values ( #6425 , thanks @Lakshman142 !)
Reformat files with the latest version of ruff ( #6426 )
Replace .format() with f-strings in _parallel_coordinate.py ( #6431 , thanks @yasumorishima !)
Use TYPE_CHECKING for import in pruners/_base.py ( #6434 , thanks @yasumorishima !)
Use f-strings in optuna/storages/_base.py ( #6435 , thanks @edwiniac !)
Use f-strings in _contour.py ( #6436 , thanks @edwiniac !)
Use f-strings in _intermediate_values.py ( #6437 , thanks @edwiniac !)
Use f-strings in cli.py ( #6438 , thanks @edwiniac !)
Use f-strings in optuna/testing/storages.py ( #6439 , thanks @edwiniac !)
Use f-strings in optuna/storages/journal/_storage.py ( #6440 , thanks @edwiniac !)
Use f-strings in _imports.py ( #6442 , thanks @edwiniac !)
Use f-strings in _deprecated.py ( #6443 , thanks @edwiniac !)
Use TYPE_CHECKING for import in pruners/_hyperband.py ( #6447 , thanks @yasumorishima !)
Use TYPE_CHECKING for typing-only imports in test_timeline.py ( #6451 , thanks @KRMed !)
Refactor: Use f string in multi_objective tutorial ( #6455 , thanks @ryota717 !)
refactor: move type-only imports into TYPE_CHECKING in samplers/_grid.py ( #6466 , thanks @dhruvildarji !)
refactor: move BaseDistribution into TYPE_CHECKING in search_space/intersection.py ( #6467 , thanks @dhruvildarji !)
Simplify Union type alias in optuna/samplers/_cmaes.py ( #6478 , thanks @roli-lpci !)
Use f-string in _convert_positional_args.py ( #6483 , thanks @toroleapinc !)
Add acqf import inside a TYPE_CHECKING block ( #6484 , thanks @acabellom !)
Refactor repr in trial/_frozen.py to use f-strings ( #6485 , thanks @Bhavyag1337 !)
Use TYPE_CHECKING in pruners/_threshold.py ( #6487 , thanks @LuciferDono !)
Use f-string in tutorial/10_key_features/005_visualization.py ( #6489 , thanks @maheer14 !)
Move JSONSerializable import to TYPE_CHECKING in study/study.py ( #6490 , thanks @yasumorishima !)
Use f-string and {var_name=} instead of .format and var_name={var_name} ( #6494 , thanks @buddy0452004 !)
Move optuna import to TYPE_CHECKING in pruners/_patient.py ( #6501 , thanks @yasumorishima !)
Move application import to TYPE_CHECKING in pruners/_patient.py ( #6502 , thanks @nightcityblade !)
Move application import to TYPE_CHECKING in pruners/_successive_halving.py ( #6503 , thanks @nightcityblade !)
Replace .format() with f-strings in 002_configurations.py ( #6506 , thanks @acabellom !)
Fix type checking ( #6507 , thanks @sateeshkumarb !)
Fix test for FastAIV2PruningCallback ( optuna/optuna-integration#265 )
Fix windows-test failure due to NamedTemporaryFilePool ( #6417 )
Fix checks-optional CI ( #6422 )
Fix mypy errors in GP module ( #6492 )
Bump up version number to 4.8.0.dev ( optuna/optuna-integration#263 )
Bump the version up to v4.8.0 ( optuna/optuna-integration#269 )
Bump up version to 4.8.0.dev ( #6414 )
Update news section for the v4.7 release ( #6420 )
This release was made possible by the authors and the people who participated in the reviews and discussions.
@Bhavyag1337 , @KRMed , @Lakshman142 , @LuciferDono , @ParagEkbote , @Quant-Quasar , @RinZ27 , @VedantMadane , @acabellom , @aerosta , @buddy0452004 , @c-bata , @dhruvildarji , @dotz0ver , @edwiniac , @gen740 , @kAIto47802 , @maheer14 , @nabenabe0928 , @nightcityblade , @not522 , @roli-lpci , @ryota717 , @sateeshkumarb , @sawa3030 , @toroleapinc , @y0z , @yasumorishima
sateeshkumarb, not522, and 26 other contributors
This is the release note of v4.6.0 .
This is the release note of v4.6.0.
Optuna Dashboard is a web-based tool that helps you easily explore and visualize your Optuna optimization history. The latest release, v0.20.0, introduces LLM integration, enabling the natural language-based Trial filtering and automatic Plotly chart generation. Please refer to the release blog for more details.
GPSamplerGPSampler becomes significantly faster owing to parallelized multi-start acquisition function optimization via PyTorch batching, and to optimized NumPy operations.
We have fully implemented sampler selection rules for multi-objective and constrained optimization in AutoSampler. For more details, please see our blog post, "AutoSampler: Full Support for Multi-Objective & Constrained Optimization."
Robust Bayesian optimization methods have been added to OptunaHub. Robust Bayesian optimization enables suggesting more robust parameters against input perturbations. This is especially helpful for Sim2Real transfer scenarios.
TrialState.__repr__ and TrialState.__str__ (#6281, thanks @ktns!)read_logs (#6144)GPSampler (#6244)TPESampler's sample_relative (#6265)find_or_raise_by_id in _set_trial_value_without_commit (#6266)GPSampler by Batching Acquisition Function Evaluations (#6268, thanks @Kaichi-Irie!)_CachedStorage's get_best_trial (#6270)_set_trial_attr_without_commit for PostgreSQL (#6282, thanks @jaikumarm!)states argument to _read_trials_from_remote_storage (#6288)np.linalg.inv with np.linalg.cholesky to speed up GPSampler for numpy>=2.0.0 (#6296)_CachedStorage's _read_trials_from_remote_storage (#6310)AutoSampler to the sampler comparison table in the API reference (#6260, thanks @Kaichi-Irie!)GPSampler document to reflect support for constrained multi-objective optimization (#6262)TPESampler document (#6263)fit_kernel_params to GPRegressor (#6243)TYPE_CHECKING in _brute_force.py (#6259, thanks @Kaichi-Irie!)_gp/scipy_blas_thread_patch.py (#6269, thanks @Kaichi-Irie!)batched_lbfgsb module compatible with scipy.optimize (#6273, thanks @Kaichi-Irie!)optuna.study._frozen.py (#6275, thanks @GabrielRomaoG!)TYPE_CHECKING in optuna.importance.__init__ (#6278, thanks @euangoodbrand!)FanovaImportanceEvaluator (#6279, thanks @euangoodbrand!)TYPE_CHECKING in /study/_optimize.py (#6280, thanks @euangoodbrand!)TYPE_CHECKING in optuna/pruners/_nop.py (#6297, thanks @AddyM!)TYPE_CHECKING in optuna/samplers/_random.py (#6298, thanks @AddyM!)optuna/distributions.py (#6306)tests/samplers_tests/tpe_tests/test_truncnorm.py (#6307)optuna/study/study.py (#6309, thanks @unKnownNG!).format code to the new f string format in the test_journal.py (#6312, thanks @Zrahay!)visualization/_pareto_front.py (#6314, thanks @dross20!)001_first.py (#6315, thanks @satyarth7srivastava!)_intermediate_values.py (#6316, thanks @nihalsiddiqui7!).format to f-string in _percentile.py (#6323, thanks @Jongwan93!)sklearn.py to fix mypy checks (optuna/optuna-integration#249)test_parallel_optimize_with_sleep (#6241).coveragerc to pyproject.toml (#6292, thanks @ParagEkbote!)Engine (#6303)4.6.0.dev (optuna/optuna-integration#245)__version__ to init (optuna/optuna-integration#247).coveragerc to pyproject.toml (optuna/optuna-integration#252, thanks @ParagEkbote!)This release was made possible by the authors and the people who participated in the reviews and discussions.
@AddyM, @GabrielRomaoG, @Jongwan93, @Kaichi-Irie, @ParagEkbote, @Zrahay, @c-bata, @contramundum53, @dross20, @euangoodbrand, @fusawa-yugo, @gen740, @jaikumarm, @kAIto47802, @ktns, @nabenabe0928, @nihalsiddiqui7, @not522, @satyarth7srivastava, @sawa3030, @toshihikoyanase, @unKnownNG, @y0z
This is the release note of v4.5.0 .
This is the release note of v4.5.0.
GPSampler for constrained multi-objective optimizationGPSampler is now able to handle multiple objective and constraints simultaneously using the newly introduced constrained LogEHVI acquisition function.
The figures below show the difference between GPSampler (LogEHVI, unconstrained) vs GPSampler (constrained LogEHVI, new feature). The 3-dimensional version of the C2DTLZ2 benchmark problem we used is a problem where some areas of the Pareto front of the original DTLZ2 problem are made infeasible by constraints. Therefore, even if constraints are not taken into account, it is possible to obtain the Pareto front. Experimental results show that both LogEHVI and constrained LogEHVI can approximate the Pareto front, but the latter has significantly fewer infeasible solutions, demonstrating its efficiency.
| Optuna v4.4 (LogEHVI) | Optuna v4.5 (Constrained LogEHVI) |
|---|---|
TPESamplerTPESampler is significantly (about 5x as listed in the table below) faster! It enables a larger number of trials in each study. The speedup was achieved through a series of enhancements in constant factors.
The following table shows the speed comparison of TPESampler between v4.4.0 and v4.5.0. The experiments were conducted using multivariate=True on a search space with 3 continuous parameters and 3 numerical discrete parameters. Each row shows the runtime for each number of objectives and each column shows each number of trials to be evaluated. Each runtime is shown along with the standard error over 3 random seeds. The numbers in parentheses represent the speedup factor in comparison to v4.4.0. For example, (5.1x) means the runtime of v4.5.0 is 5.1 times faster than that of v4.4.0.
n_objectives/n_trials
|
500 | 1000 | 1500 | 2000 |
|---|---|---|---|---|
| 1 | 1.4 $\pm$ 0.03 (5.1x) | 3.9 $\pm$ 0.07 (5.3x) | 7.3 $\pm$ 0.09 (5.4x) | 11.9 $\pm$ 0.10 (5.4x) |
| 2 | 1.8 $\pm$ 0.01 (4.7x) | 4.7 $\pm$ 0.02 (4.8x) | 8.7 $\pm$ 0.03 (4.8x) | 13.9 $\pm$ 0.04 (4.9x) |
| 3 | 2.0 $\pm$ 0.01 (4.2x) | 5.4 $\pm$ 0.03 (4.4x) | 10.0 $\pm$ 0.03 (4.6x) | 15.9 $\pm$ 0.03 (4.7x) |
| 4 | 4.2 $\pm$ 0.11 (3.2x) | 12.1 $\pm$ 0.14 (3.9x) | 20.9 $\pm$ 0.23 (4.2x) | 31.3 $\pm$ 0.05 (4.4x) |
| 5 | 12.1 $\pm$ 0.59 (4.7x) | 30.8 $\pm$ 0.16 (5.8x) | 50.7 $\pm$ 0.46 (6.5x) | 72.8 $\pm$ 1.13 (7.1x) |
plot_hypervolume_historyplot_hypervolume_history is essential to assess the performance of multi-objective optimization, but it was unbearably slow when a large number of trials are evaluated on a many-objective (The number of objectives > 3) problem. v4.5.0 addressed this issue by incrementally updating the hypervolume instead of calculating each hypervolume from scratch.
The following figure shows the elapsed times of hypervolume history plot in Optuna v4.4.0 and v4.5.0 using a four-objective problem. The x-axis represents the number of trials and the y-axis represents the elapsed times for each setup. The blue and red lines are the results of v4.4.0 and v4.5.0, respectively.
CmaEsSampler now supports 1D search spaceUp until Optuna v4.4, CmaEsSampler could not handle one-dimensional space and fell back to random search. Optuna v4.5 now allows the CMA-ES algorithm to be used for one-dimensional space.
Now, you can install the optunahub library via conda-forge as follows.
conda install conda-forge::optunahubConstrainedLogEHVI (#6198)GPSampler (#6224)CmaEsSampler (#6228)optuna._lightgbm_tuner module (optuna/optuna-integration#233, thanks @milkcoffeen!)qehvi_candidates_func (optuna/optuna-integration#242, thanks @LukeGT!)tell_with_warning to avoid unnecessary get_trial call (#6133)scipy-stubs in the type-check dependencies (#6174, thanks @jorenham!)GPSampler falls back to RandomSampler (#6179, thanks @sisird864!)GPSampler due to L-BFGS in SciPy v1.15 (#6191)ndtri_exp (#6194)TPESampler (#6200)_log_gauss_mass evaluations (#6202)_BatchedTruncNormDistributions by vectorization (#6220)is_pareto_front and using simple Python loops (#6223)ndtri_exp (#6229)plot_hypervolume_history (#6232)lru_cache to skip HSSP (#6240, thanks @fusawa-yugo!)GPSampler (#6181)TPESampler with multivariate and constant_liar (#6189)GPSampler as a sampler that supports constraints (#6176, thanks @1kastner!)README.md (#6222, thanks @muhammadibrahim313!)test_log_completed_trial_skip_storage_access (#6208)KernelParamsTensor towards cleaner GP-related modules (#6152)KernelParamsTensor to GPRegressor (#6153)v3.0.0.d.py (#6154, thanks @dross20!)optuna/_imports.py (#6167, thanks @AdrianStrymer!)optuna.artifacts._download.py (#6177, thanks @dross20!)is_categorical to search space (#6182)optuna.artifacts._list_artifact_meta.py (#6187, thanks @dross20!)GPSampler (#6195)SearchSpace in GP (#6197)_truncnorm (#6201)TYPE_CHECKING in optuna/_gp/acqf.py to avoid circular imports (#6204, thanks @CarvedCoder!)TYPE_CHECKING in optuna/_gp/optim_mixed.py to avoid circular imports (#6205, thanks @Subodh-12!)GPSampler (#6213)BaseGASampler (#6219)torch.newaxis with None for old PyTorch (#6237)README for blackdoc==0.3.10 (#6150)pytest-xdist to speed up the CI (#6170)test_get_timeline_plot_with_killed_running_trials (#6210)test_experimental (#6211)xfail (#6217)GPSampler (#6235)README (optuna/optuna-integration#234, thanks @ParagEkbote!)4.5.0.dev (optuna/optuna-integration#237)README (#6159)This release was made possible by the authors and the people who participated in the reviews and discussions.
@1kastner, @AdrianStrymer, @CarvedCoder, @Greesb, @HideakiImamura, @LukeGT, @ParagEkbote, @Subodh-12, @c-bata, @contramundum53, @dhyeyinf, @dross20, @fusawa-yugo, @gen740, @hvy, @jorenham, @kAIto47802, @ktns, @milkcoffeen, @muhammadibrahim313, @nabenabe0928, @not522, @nzw0301, @sawa3030, @sisird864, @toshihikoyanase, @unKnownNG, @vcovo, @y0z
add deprecated/removed version specification to calls of convert_positional_args ( #6117 , thanks @shmurai !)
This is the release note of v4.4.0.
In addition to new features, bug fixes, and improvements in documentation and testing, version 4.4 introduces a new tool called the Optuna MCP Server.
The Optuna MCP server can be accessed by any MCP client via uv — for instance, with Claude Desktop, simply add the following configuration to your MCP server settings file. Of course, other LLM clients like VSCode or Cline can also be used similarly. You can also access it via Docker. If you want to persist the results, you can use the — storage option. For details, please refer to the repository.
{
"mcpServers": {
… (Other MCP Servers' settings)
"Optuna": {
"command": "uvx",
"args": [
"optuna-mcp"
]
}
}
}
Optuna’s GPSampler, introduced in version 3.6, offers superior speed and performance compared to existing Bayesian optimization frameworks, particularly when handling objective functions with discrete variables. In Optuna v4.4, we have extended this GPSampler to support multi-objective optimization problems. The applications of multi-objective optimization are broad, and the new multi-objective capabilities introduced in this GPSampler are expected to find applications in fields such as material design, experimental design problems, and high-cost hyperparameter optimization.
GPSampler can be easily integrated into your program and performs well against the existing BoTorchSampler. We encourage you to try it out with your multi-objective optimization problems.
sampler = optuna.samplers.GPSampler()
study = optuna.create_study(directions=["minimize", "minimize"], sampler=sampler)During the development period of Optuna v4.4, several new features were also introduced to OptunaHub, the feature-sharing platform for Optuna:
| Vizier sampler performance |
|---|
| TPE acquisition visualizer |
|---|
consider_prior Behavior and Remove Support for False (#6007)restart_strategy and inc_popsize to simplify CmaEsSampler (#6025)TPESampler keyword-only (#6041)AcquisitionFuncParams for LogEHVI (#6052)GPSampler (#6069)n_recent_trials to plot_timeline (#6110, thanks @msdsm!)TYPE_CHECKING of samplers/_gp/sampler.py (#6059)_tell_with_warning (#6079)_compute_3d for hypervolume computation (#6112, thanks @shmurai!)plot_hypervolume_history (#6115, thanks @shmurai!)convert_positional_args (#6117, thanks @shmurai!)Study.best_trial performance by avoiding unnecessary deep copy (#6119, thanks @msdsm!)assume_pareto for hv calculation in _calculate_weights_below_for_multi_objective (#6129)request.values in OptunaStorageProxyService (#6044, thanks @hitsgub!)BruteForceSampler for HyperbandPruner (#6107)optuna.pruners.MedianPruner and optuna.pruners.PatientPruner (#6055, thanks @ParagEkbote!)GPSampler (#6081)_get_best_trial to follow coding conventions (#6122)RAEDME.md (optuna/optuna-examples#323)tensorflow and numpy (optuna/optuna-examples#324)test_base_gasampler.py (#6104)n_recent_trials of plot_timeline (follow-up #6110) (#6116)test_study.py by removing redundancy (#6120)optuna/_experimental.py (#6045, thanks @ParagEkbote!)optuna/importance/_base.py (#6046, thanks @ParagEkbote!)optuna/_convert_positional_args.py (#6050, thanks @ParagEkbote!)optuna/_deprecated.py (#6051, thanks @ParagEkbote!)optuna/_gp/gp.py (#6053, thanks @ParagEkbote!)eta in sbx (#6056, thanks @hrntsm!)CmaEsAttrKeys and _attr_keys for Simplification (#6068)np.isnan with math.isnan (#6080)_tell_with_warning (#6082)optuna/distributions.py (#6086, thanks @AdrianStrymer!)optuna/_gp/gp.py (#6090, thanks @Samarthi!)ExperimentalWarning if heartbeat is enabled (#6106, thanks @lan496!)optuna/visualization/_terminator_improvement.py (#6139, thanks @Prashantdhaka23!)optim_mixed.py (#6140, thanks @Ajay-Satish-01!)test_trial.py (#6141, thanks @saishreyakumar!)optuna/storages/_rdb/models.py for consistency among the codebase (#6143, thanks @Shubham05122002!)wandb (optuna/optuna-integration#228)checks-optional CI on the fork repositories (#6103)blackdoc (#6145)This release was made possible by the authors and the people who participated in the reviews and discussions.
@AdrianStrymer, @Ajay-Satish-01, @Alnusjaponica, @Copilot, @HideakiImamura, @ParagEkbote, @Prashantdhaka23, @Samarthi, @Shubham05122002, @SubhadityaMukherjee, @c-bata, @contramundum53, @copilot-pull-request-reviewer[bot], @fusawa-yugo, @gen740, @himkt, @hitsgub, @hrntsm, @kAIto47802, @lan496, @leevers, @milkcoffeen, @msdsm, @nabenabe0928, @not522, @nzw0301, @saishreyakumar, @sawa3030, @shmurai, @toshihikoyanase, @y0z
Deprecate consider_prior in TPESampler ( #6005 , thanks @sawa3030 !)
This is the release note of v4.3.0.
This has various bug fixes and improvements to the documentation and more.
LightGBMTuner (optuna/optuna-integration#203, thanks @sawa3030!)IntersectionSearchSpace (#5982, thanks @GittyHarsha!)_prev_waiting_trial_number in InMemoryStorage to improve the efficiency of _pop_waiting_trial_id (#5993, thanks @sawa3030!)convert_positional_args (#6009, thanks @fusawa-yugo!)wait_server_ready method in GrpcStorageProxy (#6010, thanks @hitsgub!)plot_contour and plot_rank (#6011)optuna._callbacks.py (#6030)SBXCrossover (#6008, thanks @hrntsm!)InMemoryStorage before copying to the local (optuna/optuna-integration#213)matplotlib (#5892, thanks @fusawa-yugo!)_LazyImport for grpcio package (#5954)JournalStorage (#5971, thanks @sawa3030!)inf (#5995)_pop_waiting_trial_id for finished trial (#6012)BruteForceSampler fails to suggest all combinations (#5893)optuna/optuna's document sphinx config (optuna/optuna-integration#197)CONTRIBUTING.md (optuna/optuna-integration#200, thanks @sawa3030!).readthedocs.yml (#5976)HyperBandPruner (#6018)dask (optuna/optuna-examples#296)dask for dask-ml (optuna/optuna-examples#297)hiplot and sklearn (optuna/optuna-examples#298, thanks @fusawa-yugo!)lightgbm (optuna/optuna-examples#302)skorch example in the CI (optuna/optuna-examples#309)fastai Example (optuna/optuna-examples#312)BaseGASampler (#5864)pyproject.toml (#5972)FirstTrialOnlyRandomSampler (#5973, thanks @mehakmander11!)_check_and_set_param_distribution (#5975, thanks @siddydutta!)testing/distributions.py (#5977, thanks @mehakmander11!)_StudyInfo's param_distribution in _cached_storage.py (#5978, thanks @tarunprabhu11!)UpdateFinishedTrialError to raise an error when attempting to modify a finished trial (#6001, thanks @sawa3030!)consider_prior in TPESampler (#6005, thanks @sawa3030!)create_study's direction easier to understand optuna.study (#6021, thanks @sinano1107!)UnsupportedDistribution (optuna/optuna-integration#208)numpy>=2.2.4 (optuna/optuna-integration#212)lightgbm tuner for Python 3.8 users (optuna/optuna-integration#214)xgboost (optuna/optuna-integration#217)workflow_dispatch trigger to all the CI (#6019)GPSampler blog to the announcement (#6014)This release was made possible by the authors and the people who participated in the reviews and discussions.
@Alnusjaponica, @GittyHarsha, @HideakiImamura, @ParagEkbote, @c-bata, @contramundum53, @ffineis, @fusawa-yugo, @gen740, @hitsgub, @hrntsm, @kAIto47802, @ktns, @mehakmander11, @nabenabe0928, @not522, @nzw0301, @porink0424, @sawa3030, @siddydutta, @sinano1107, @tarunprabhu11, @toshihikoyanase, @y0z
This is the release note of v4.2.1. This release includes a bug fix addressing an issue where Optuna was unable to import if an older version of the g
This is the release note of v4.2.1. This release includes a bug fix addressing an issue where Optuna was unable to import if an older version of the grpcio package was installed.
_LazyImport for grpcio package (#5965)This release was made possible by the authors and the people who participated in the reviews and discussions.
@c-bata @HideakiImamura @nabenabe0928
Update distributions.rst to list deprecated distribution classes
This is the release note of v4.2.0. In conjunction with the Optuna release, OptunaHub 0.2.0 is released. Please refer to the release note of OptunaHub 0.2.0 for more details.
Highlights of this release include:
The gRPC storage proxy is a feature designed to support large-scale distributed optimization. As shown in the diagram below, gRPC storage proxy sits between the optimization workers and the database server, proxying the calls of Optuna’s storage APIs.
<img width="1241" alt="grpc-proxy" src="https://github.com/user-attachments/assets/00220bc6-75da-4ee3-b9ff-a2b3440ac207" />
In large-scale distributed optimization settings where hundreds to thousands of workers are operating, placing a gRPC storage proxy for every few tens can significantly reduce the load on the RDB server which would otherwise be a single point of failure. The gRPC storage proxy enables sharing the cache about Optuna studies and trials, which can further mitigate load. Please refer to the official documentation for further details on how to utilize gRPC storage proxy.
SMAC3 is a hyperparameter optimization framework developed by AutoML.org, one of the most influential AutoML research groups. The Optuna-compatible SMAC3 sampler is now available thanks to the contribution to OptunaHub by Difan Deng (@dengdifan), one of the core members of AutoML.org. We can now use the method widely used in AutoML research and real-world applications from Optuna.
# pip install optunahub smac
import optuna
import optunahub
from optuna.distributions import FloatDistribution
def objective(trial: optuna.Trial) -> float:
x = trial.suggest_float("x", -10, 10)
y = trial.suggest_float("y", -10, 10)
return x**2 + y**2
smac_mod = optunahub.load_module("samplers/smac_sampler")
n_trials = 100
sampler = smac_mod.SMACSampler(
{"x": FloatDistribution(-10, 10), "y": FloatDistribution(-10, 10)},
n_trials=n_trials,
)
study = optuna.create_study(sampler=sampler)
study.optimize(objective, n_trials=n_trials)
Please refer to https://hub.optuna.org/samplers/smac_sampler/ for more details.
Benchmarking the performance of optimization algorithms is an essential process indispensable to the research and development of algorithms. The newly added OptunaHub Benchmarks in the latest version v0.2.0 of optunahub is a new feature for Optuna users to conduct benchmarks conveniently.
# pip install optunahub>=4.2.0 scipy torch
import optuna
import optunahub
bbob_mod = optunahub.load_module("benchmarks/bbob")
smac_mod = optunahub.load_module("samplers/smac_sampler")
sphere2d = bbob_mod.Problem(function_id=1, dimension=2)
n_trials = 100
studies = []
for study_name, sampler in [
("random", optuna.samplers.RandomSampler(seed=1)),
("tpe", optuna.samplers.TPESampler(seed=1)),
("cmaes", optuna.samplers.CmaEsSampler(seed=1)),
("smac", smac_mod.SMACSampler(sphere2d.search_space, n_trials, seed=1)),
]:
study = optuna.create_study(directions=sphere2d.directions,
sampler=sampler, study_name=study_name)
study.optimize(sphere2d, n_trials=n_trials)
studies.append(study)
optuna.visualization.plot_optimization_history(studies).show()
In the above sample code, we compare and display the performance of the four kinds of samplers using a two-dimensional Sphere function, which is part of a group of benchmark functions widely used in the black-box optimization research community known as Blackbox Optimization Benchmarking (BBOB).
<img width="1250" alt="bbob" src="https://github.com/user-attachments/assets/89b09090-dd37-4679-9fa8-af987f138dcc" />
We worked on its extension and adapted GPSampler to constrained optimization in Optuna v4.2.0 since Gaussian process-based Bayesian optimization is a very popular method in various research fields such as aircraft engineering and materials science. We show the basic usage below.
# pip install optuna>=4.2.0 scipy torch
import numpy as np
import optuna
def objective(trial: optuna.Trial) -> float:
x = trial.suggest_float("x", 0.0, 2 * np.pi)
y = trial.suggest_float("y", 0.0, 2 * np.pi)
c = float(np.sin(x) * np.sin(y) + 0.95)
trial.set_user_attr("c", c)
return float(np.sin(x) + y)
def constraints(trial: optuna.trial.FrozenTrial) -> tuple[float]:
return (trial.user_attrs["c"],)
sampler = optuna.samplers.GPSampler(constraints_func=constraints)
study = optuna.create_study(sampler=sampler)
study.optimize(objective, n_trials=50)
Please try out GPSampler for constrained optimization especially when only a small number of trials are available!
Although Optuna has supported constrained optimization for TPESampler, which is the default Optuna sampler, since v3.0.0, its algorithm design and performance comparison have not been verified academically. OptunaHub now supports c-TPE, which is another constrained optimization method for TPESampler. Importantly, the algorithm design and its performance comparison are publicly reviewed to be accepted to IJCAI, a top-tier AI international conference. Please refer to https://hub.optuna.org/samplers/ctpe/ for details.
GPSampler to support constraint functions (#5715)value choice (#5822, thanks @iamarunbrahma!)GrpcStorageProxy (#5872)cli.py to handle an empty database (#5828, thanks @willdavidson05!)load_study function (#5924)distributions.rst to list deprecated distribution classes (#5764)step in IntLogUniformDistribution (#5767)step (#5769)ask_and_tell tutorial - batch optimization recommendations (#5817, thanks @SimonPop!)get_trial_params (#5820)sphinx-notfound-page for better 404 page (#5898)run_grpc_proxy_server (#5914)wandb (https://github.com/optuna/optuna-examples/pull/293)retry_history method in RetryFailedTrialCallback (#5865, thanks @iamarunbrahma!)distributions.py (#5755, thanks @KannanShilen!)tests/visualization_tests/test_pareto_front.py (#5756, thanks @boringbyte!)test_hypervolume_history.py (#5760, thanks @boringbyte!)tests/test_cli.py (#5765, thanks @boringbyte!)tests/test_distributions.py (#5773, thanks @boringbyte!)tests/samplers_tests/test_qmc.py (#5775, thanks @boringbyte!)tests/sampler_tests/tpe_tests/test_sampler.py (#5779, thanks @boringbyte!)tests/samplers_tests/tpe_tests/test_multi_objective_sampler.py (#5781, thanks @boringbyte!)tests/samplers_tests/tpe_tests/test_parzen_estimator.py (#5782, thanks @boringbyte!)tests/storage_tests/journal_tests/test_journal.py (#5783, thanks @boringbyte!)tests/storage_tests/rdb_tests/create_db.py (#5784, thanks @boringbyte!)tests/storage_tests/rdb_tests/ (#5785, thanks @boringbyte!)tests/test_deprecated.py (#5786, thanks @boringbyte!)tests/test_convert_positional_args.py (#5787, thanks @boringbyte!)tests/importance_tests/test_init.py (#5790, thanks @boringbyte!)tests/storages_tests/test_storages.py (#5791, thanks @boringbyte!)tests/storages_tests/test_heartbeat.py (#5792, thanks @boringbyte!)optuna/cli.py (#5793, thanks @willdavidson05!)tests/trial_tests/test_frozen.py (#5794, thanks @boringbyte!)tests/trial_tests/test_trial.py (#5795, thanks @boringbyte!)tests/trial_tests/test_trials.py (#5796, thanks @boringbyte!)optuna/_transform.py (#5799, thanks @JLX0!)test_trial.py readable (#5800)tests/pruners_tests/test_hyperband.py (#5801, thanks @boringbyte!)tests/pruners_tests/test_median.py (#5802, thanks @boringbyte!)tests/pruners_tests/test_patient.py (#5803, thanks @boringbyte!)study.ask() in tests instead of create_new_trial (#5807, thanks @unKnownNG!)tests/pruners_tests/test_percentile.py (#5808, thanks @boringbyte!)tests/pruners_tests/test_successive_halving.py (#5809, thanks @boringbyte!)tests/study_tests/test_optimize.py (#5810, thanks @boringbyte!)tests/hypervolume_tests/test_hssp.py (#5812, thanks @boringbyte!)optuna/_callbacks.py (#5818, thanks @boringbyte!)optuna/samplers/_random.py (#5819, thanks @boringbyte!)optuna/samplers/_gp/sampler.py (#5823, thanks @boringbyte!)optuna/samplers/nsgaii/_crossovers/_sbx.py (#5824, thanks @boringbyte!)optuna/samplers/nsgaii/_crossovers/_spx.py (#5825, thanks @boringbyte!)optuna/samplers/nsgaii/_crossovers/_undx.py (#5826, thanks @boringbyte!)optuna/samplers/nsgaii/_crossovers/_vsbx.py (#5827, thanks @boringbyte!)optuna/samplers/nsgaii/_crossover.py (#5831, thanks @boringbyte!)optuna/samplers/testing/threading.py (#5832, thanks @boringbyte!)optuna/pruners/_patient.py (#5833, thanks @boringbyte!)study.ask() in tests/pruners_tests/test_percentile.py (#5834, thanks @fusawa-yugo!)optuna/search_space/group_decomposed.py (#5836, thanks @boringbyte!)optuna/search_space/intersection.py (#5837, thanks @boringbyte!)optuna/storages/journal/_base.py (#5838, thanks @boringbyte!)optuna/storages/journal/_redis.py (#5840, thanks @boringbyte!)optuna/storages/journal/_storage.py (#5841, thanks @boringbyte!)optuna/study/_dataframe.py (#5842, thanks @boringbyte!)optuna/study/_optimize.py (#5844, thanks @boringbyte!)optuna/study/_tell.py (#5845, thanks @boringbyte!)mypy errors due to numpy 2.2.0 (#5848)optuna/visualization/matplotlib/_contour.py (#5851, thanks @boringbyte!)optuna/visualization/matplotlib/_parallel_coordinate.py (#5854, thanks @boringbyte!)optuna/visualization/matplotlib/_param_importances.py (#5855, thanks @boringbyte!)study.ask() in tests/pruners_tests/test_successive_halving.py (#5856, thanks @willdavidson05!)optuna/visualization/matplotlib/_pareto_front.py (#5857, thanks @boringbyte!)optuna/visualization/matplotlib/_rank.py (#5858, thanks @boringbyte!)optuna/visualization/matplotlib/_slice.py (#5859, thanks @boringbyte!)optuna/visualization/_utils.py (#5876, thanks @boringbyte!)optuna/visualization/_contour.py (#5877, thanks @boringbyte!)optuna/_gp/gp.py (#5879, thanks @boringbyte!)optuna/study/_tell.py (#5880, thanks @boringbyte!)optuna/storages/_heartbeat.py (#5882, thanks @boringbyte!)optuna/storages/_rdb/storage.py (#5883, thanks @boringbyte!)optuna/storages/_rdb/alembic/versions/v3.0.0.a.py (#5884, thanks @boringbyte!)optuna/storages/_rdb/alembic/versions/v3.0.0.c.py (#5885, thanks @boringbyte!)optuna/storages/_rdb/alembic/versions/v3.0.0.d.py (#5886, thanks @boringbyte!)optuna/_deprecated.py (#5887, thanks @boringbyte!)optuna/_experimental.py (#5888, thanks @boringbyte!)optuna/_imports.py (#5889, thanks @boringbyte!)optuna/visualization/_slice.py (#5894, thanks @boringbyte!)optuna/visualization/_parallel_coordinate.py (#5895, thanks @boringbyte!)optuna/visualization/_rank.py (#5896, thanks @boringbyte!)optuna/visualization/_param_importances.py (#5897, thanks @boringbyte!)optuna/_callbacks.py (#5899, thanks @boringbyte!)optuna/storages/journal/_file.py (#5900, thanks @boringbyte!)tests/storages_tests/test_with_server.py (#5901, thanks @boringbyte!)tests/test_multi_objective.py (#5902, thanks @boringbyte!)tests/artifacts_tests/test_gcs.py (#5903, thanks @boringbyte!)tests/samplers_tests/test_grid.py (#5904, thanks @boringbyte!)optuna/study/_dataframe.py (#5905, thanks @boringbyte!)tests/visualization_tests/test_optimization_history.py (#5906, thanks @boringbyte!)tests/visualization_tests/test_intermediate_plot.py (#5907, thanks @boringbyte!)tests/visualization_tests/ (#5908, thanks @boringbyte!)tests/study_tests/test_study.py (#5923, thanks @sawa3030!)test_cache_is_invalidated and remove assert study._thread_local.cached_all_trials is None (#5733)kaleido to fix CI errors (#5771)mypy related entries in setup.cfg to pyproject.toml (#5861)CITATION.cff (#5746)This release was made possible by the authors and the people who participated in the reviews and discussions.
@HideakiImamura, @JLX0, @KannanShilen, @SimonPop, @boringbyte, @c-bata, @fusawa-yugo, @gen740, @himkt, @iamarunbrahma, @kAIto47802, @ktns, @mist714, @nabenabe0928, @not522, @nzw0301, @porink0424, @sawa3030, @sulan, @unKnownNG, @willdavidson05, @y0z
This is the release note of v4.1.0. Highlights of this release include:
This is the release note of v4.1.0. Highlights of this release include:
The updated list of tested and supported Python releases is as follows:
<img width="750" alt="Blog-1" src="https://github.com/user-attachments/assets/f3ecd366-7e7b-49d6-ae38-f35301fa7d11">
AutoSampler automatically selects a sampler from those implemented in Optuna, depending on the situation. Using AutoSampler, as in the code example below, users can achieve optimization performance equal to or better than Optuna's default without being aware of which optimization algorithm to use.
$ pip install optunahub cmaes torch scipy
import optuna
import optunahub
auto_sampler_module = optunahub.load_module("samplers/auto_sampler")
study = optuna.create_study(sampler=auto_sampler_module.AutoSampler())
See the Medium blog post for details.
This release incorporates comprehensive performance tuning on Optuna’s RDBStorage, leading to significant performance improvements. The table below shows the comparison results of execution times between versions 4.0 and 4.1.
| # trials | v4.0.0 | v4.1.0 | Diff |
|---|---|---|---|
| 1000 | 72.461 sec (±1.026) | 59.706 sec (±1.216) | -17.60% |
| 10000 | 1153.690 sec (±91.311) | 664.830 sec (±9.951) | -42.37% |
| 50000 | 12118.413 sec (±254.870) | 4435.961 sec (±190.582) | -63.39% |
For fair comparison, all experiments were repeated 10 times, and the mean execution time was compared. Additional detailed benchmark settings include the following:
Please note, due to extensive execution time, the figure for v4.0.0 with 50,000 trials represents the average of 7 runs instead of 10.
<details> <summary>Benchmark Script</summary>
import optuna
import time
import os
import numpy as np
optuna.logging.set_verbosity(optuna.logging.ERROR)
storage_url = "mysql+pymysql://user:password@<ipaddr>:<port>/<dbname>"
n_repeat = 10
def objective(trial: optuna.Trial) -> float:
s = 0
for i in range(10):
trial.set_user_attr(f"attr{i}", "dummy user attribute")
s += trial.suggest_float(f"x{i}", -10, 10) ** 2
return s
def bench(n_trials):
elapsed = []
for i in range(n_repeat):
start = time.time()
study = optuna.create_study(
storage=storage_url,
sampler=optuna.samplers.RandomSampler()
)
study.optimize(objective, n_trials=n_trials, n_jobs=10)
elapsed.append(time.time() - start)
optuna.delete_study(study_name=study.study_name, storage=storage_url)
print(f"{np.mean(elapsed)=} {np.std(elapsed)=}")
for n_trials in [1000, 10000, 50000]:
bench(n_trials)
</details>
The following five new algorithms were added to OptunaHub!
MO-CMA-ES is an extension of CMA-ES for multi-objective optimization. Its search mechanism is based on multiple (1+1)-CMA-ES and inherits good invariance properties from CMA-ES, such as invariance against rotation of the search space.
<img width="400" alt="mocmaes" src="https://github.com/user-attachments/assets/5289d2fd-81c9-40a4-b575-daf5d3cedc3f">
MOEA/D solves a multi-objective optimization problem by decomposing it into multiple single-objective problems. It allows for the maintenance of a good diversity of solutions during optimization. Please take a look at the article from Hiroaki NATSUME(@hrntsm) for more details.
<img width="400" alt="moead" src="https://github.com/user-attachments/assets/3ab83a64-b789-425b-800c-2c1f09e5a752">
SELECT statements by passing study_id to check_and_add in TrialParamModel (#5702)UPSERT in set_trial_user_attr (#5703)SELECT statements of _CachedStorage.get_all_trials by fixing filtering conditions (#5704)SELECT statements by removing unnecessary distribution compatibility check in set_trial_param() (#5709)UPSERT in set_trial_system_attr (#5741)Mapping as param_distributions in OptunaSearchCV (https://github.com/optuna/optuna-integration/pull/172, thanks @yu9824!)OptunaSearchCV with cross_val_predict (https://github.com/optuna/optuna-integration/pull/174, thanks @yu9824!)GPSampler's suggestion failure within torch.no_grad() context manager (#5671, thanks @kAIto47802!)GPSampler (#5737)QMCSampler (#5740)README.md (#5657)InMemoryStorage to document (#5672, thanks @kAIto47802!)JournalStorage to README.md (#5674)pandas installation guide to RDB tutorial (#5685, thanks @kAIto47802!)EMMREvaluator (#5694)RegretBoundEvaluator document (#5696)README.md (#5705)emmr.py (#5707)\D for Python 3.12 with sphinx build (#5735)sphinx_gallery_conf to remove document build error with Python 3.12 (#5738)generated directories in docs/source recursively (#5739)AutoSampler to the docs (#5745)fastai (https://github.com/optuna/optuna-examples/pull/279)optuna.artifacts to the PyTorch checkpoint example (https://github.com/optuna/optuna-examples/pull/280, thanks @kAIto47802!)kubernetes directory (https://github.com/optuna/optuna-examples/pull/282)lightgbm CI (https://github.com/optuna/optuna-examples/pull/290)CategoricalDistribution (#5683)WFG (#5687)_imports.py (#5692, thanks @Prabhat-Thapa45!)__future__.annotations in optuna/_experimental.py (#5714, thanks @Jonathan43!)__future__.annotations in tests/importance_tests/fanova_tests/test_tree.py (#5731, thanks @guisp03!)fastaiv2 (https://github.com/optuna/optuna-integration/pull/164)actions/download-artifact from 2 to 4.1.7 in /.github/workflows (#5660)upload-artifact version (#5744)sdist by updating MANIFEST.in (#5720)This release was made possible by the authors and the people who participated in the reviews and discussions.
@HideakiImamura, @Jonathan43, @Prabhat-Thapa45, @c-bata, @chitvs, @contramundum53, @eukaryo, @gen740, @guisp03, @kAIto47802, @muhlbach, @nabenabe0928, @not522, @nzw0301, @porink0424, @toshihikoyanase, @y0z, @yu9824
Optuna removes deprecated features in major releases. To prevent users' code from suddenly breaking, we take a long interval between when a feature is…
Here is the release note of v4.0.0. Please also check out the release blog post.
If you want to update the Optuna version of your existing projects to v4.0, please see the migration guide.
We have also published blog posts about the development items. Please check them out!
We officially released OptunaHub, a feature-sharing platform for Optuna. A large number of optimization and visualization algorithms are available in OptunaHub. Contributors can easily register their methods and deliver them to Optuna users around the world.
Please also read the OptunaHub release blog post.
Artifact Store is a file management feature for files generated during optimization, dubbed artifacts. In Optuna v4.0, we stabilized the existing file upload API and further enhanced the usability of Artifact Store by adding some APIs such as the artifact download API. We also added features to show JSONL and CSV files on Optuna Dashboard in addition to the existing support for images, audio, and video. With this official support, the API backward compatibility will be guaranteed.
For more details, please check the blog post.
JournalStorage: Official Support of Distributed Optimization via Network File SystemJournalStorage is a new Optuna storage experimentally introduced in Optuna v3.1 (see the blog post for details). Optuna has JournalFileBackend, a storage backend for various file systems. It can be used on NFS, allowing Optuna to scale to multiple nodes.
In Optuna v4.0, the API for JournalStorage has been reorganized, and JournalStorage is officially supported. This official support guarantees its backward compatibility from v4.0. For details on the API changes, please refer to the Optuna v4.0 Migration Guide.
import optuna
from optuna.storages import JournalStorage
from optuna.storages.journal import JournalFileBackend
def objective(trial: optuna.Trial) -> float:
...
storage = JournalStorage(JournalFileBackend("./optuna_journal_storage.log"))
study = optuna.create_study(storage=storage)
study.optimize(objective)
TPESamplerBefore v4.0, the multi-objective TPESampler sometimes limits the number of trials during optimization due to the sampler bottleneck after a few hundred trials. Optuna v4.0 drastically improves the sampling speed, e.g., 300 times faster for three objectives with 200 trials, and enables users to handle much more trials. Please check the blog post for details.
Terminator AlgorithmOptuna Terminator was originally introduced for hyperparameter optimization of machine learning algorithms using cross-validation. To accept broader use cases, Optuna v4.0 introduced the Expected Minimum Model Regret (EMMR) algorithm. Please refer to the EMMREvaluator document for details.
We have gradually expanded the support for constrained optimization. In v4.0, study.best_trial and study.best_trials start to support constraint optimization. They are guaranteed to satisfy the constraints, which was not the case previously.
Optuna removes deprecated features in major releases. To prevent users' code from suddenly breaking, we take a long interval between when a feature is deprecated and when it is removed. By default, features are removed when the major version has increased by two since the feature was deprecated. For this reason, the main target features for removal in v4.0 were deprecated at v2.x. Please refer to the migration guide for the removed features list.
skopt, catalyst, and fastaiv1 (https://github.com/optuna/optuna-integration/pull/114)CmaEsSampler from integration (https://github.com/optuna/optuna-integration/pull/116)LightGBMTuner (https://github.com/optuna/optuna-integration/pull/136)LightGBMTuner (https://github.com/optuna/optuna-integration/pull/138)multi_objective (#5390)_ask and _tell (#5398)--direction(s) arguments in the ask command (#5405)skopt, catalyst, and fastaiv1 (#5407)samplers.intersection (#5414)ask command (#5415)study optimize CLI command (#5416)CmaEsSampler from integration (#5417)best_trial (#5426)--study in cli.py (#5430)constraints_func in plot_pareto_front function (#5455)JournalStorage (#5539)optuna.samplers.MOTPESampler (#5640)is_exhausted() function in the GridSampler class (#5306, thanks @aaravm!)download_artifact (#5448)JournalStorage (#5568)EMMREvaluator and MedianErrorEvaluator (#5602)ConstrainedMCObjective to support botorch=0.10.0 (https://github.com/optuna/optuna-integration/pull/106)O(NK^2 log K) to O((N - K)K) (#5346)plot_contour faster (#5369)to_internal_repr in CategoricalDistribution (#5400)WFG by NumPy vectorization (#5424)sample_independent of GPSampler (#5428)numpy in hypervolume computation (#5432)JournalStorage (#5526)trial_id of best_trial (#5537)_is_categorical() in optuna/optuna/visualization (#5587, thanks @kAIto47802!)multi_objective deletion (#5641)None objective trials correctly (https://github.com/optuna/optuna-integration/pull/119, thanks @neel04!)ConstrainedMCObjective in qnei_candidates_func (https://github.com/optuna/optuna-integration/pull/124, thanks @alxhslm!)OptunaSearchCV (https://github.com/optuna/optuna-integration/pull/128, thanks @sgerloff!)WilcoxonPruner bug when best_trial has no intermediate value (#5354)GPSampler (#5359)average_is_best implementation in WilcoxonPruner (#5366)JournalStorage (#5389)_normalize_value for incomplete trials (#5422)weights_below to be finite in MOTPE (#5435)_log_complete_trial for constrained optimization (#5462)step to int in report (#5488)seed=None in GridSampler (#5490)_create_new_trial and refactor it (#5497)sample_normalized_param for GPSampler (#5543)plot_contour() with an impossible pair of variables (#5630, thanks @kAIto47802!)plot_rank() when None values exist in trial (#5634, thanks @kAIto47802!)README.md (https://github.com/optuna/optuna-integration/pull/126)PyCmaSampler (https://github.com/optuna/optuna-integration/pull/145)show_progress_bar (#5393)ArtifactStore methods as non-public (#5474)JournalFileStorage (#5475)make clean in docs (#5487)optuna artifact tutorial (#5491)ArtifactMeta (#5511)JournalFileStorage in documents and a tutorial (#5535)lock_obj to JournalFileStorage docstring (#5540)Returns to the docstring of load_study (#5554, thanks @kAIto47802!)storages.journal (#5560)JournalFileBackend in examples (#5562)optunahub-registry (#5586)CmaEsSampler (#5603)optuna-examples (#5623, thanks @kAIto47802!)evaluator.evaluate function in the example of PedAnovaImportanceEvaluator (#5632)README.md (#5636)README.md (#5637)News section of README.md (#5649)dask version constraint (https://github.com/optuna/optuna-examples/pull/254)actions/checkout@v4 and actions/setup-python@v5 (https://github.com/optuna/optuna-examples/pull/255)fastaiv1 (https://github.com/optuna/optuna-examples/pull/256)fastaiv2 to fastai (https://github.com/optuna/optuna-examples/pull/257)tensorflow-cpu in CIs (https://github.com/optuna/optuna-examples/pull/260)README.md (https://github.com/optuna/optuna-examples/pull/265)numpy<2.0.0 for catboost example (https://github.com/optuna/optuna-examples/pull/268)aim test python versions (https://github.com/optuna/optuna-examples/pull/270)fastai test python versions (https://github.com/optuna/optuna-examples/pull/271)mlflow CI python versions (https://github.com/optuna/optuna-examples/pull/274)keras and tensorboard examples (https://github.com/optuna/optuna-examples/pull/275)ExperimentalWarnings (https://github.com/optuna/optuna-integration/pull/108)GPSampler (#5365)JournalStorage (#5486)MLflowCallback and track_in_mlflow method (https://github.com/optuna/optuna-integration/pull/111, thanks @TTRh!)TYPE_CHECKING for ObjectiveFuncType (https://github.com/optuna/optuna-integration/pull/113)ExperimentalWarning for track_in_wandb (https://github.com/optuna/optuna-integration/pull/122)BoTorchSampler (https://github.com/optuna/optuna-integration/pull/147)__future__.annotations (https://github.com/optuna/optuna-integration/pull/150)percentile.py (#5322, thanks @aaravm!)optuna/pruners/_hyperband.py (#5338, thanks @keita-sa!)optuna/pruners/_successive_halving.py and optuna/pruners/_threshold.py (#5343, thanks @keita-sa!)storages/_base.py (#5352, thanks @Obliquedbishop!)TYPE_CHECKING for Study in samplers (#5391)_normalize_objective_values in NSGA-III to supress RuntimeWarning (#5399)ObjectiveFuncType available externally (#5401)numpy with np (#5412)_brute_force.py (#5441)__future__.annotations to base sampler (#5442)__future__.annotations to TPE-related modules (#5443)__future__.annotations in optuna/storages/_rdb/models.py (#5452, thanks @aisha-partha!)GPSampler (#5484)WFG a function (#5504)create_new_trial (#5510).rst files (#5514, thanks @47aamir!)_ with __ in the link in Sphinx (#5517)plot_parallel_coordinate() (#5527, thanks @karthikkurella!)assume_unique_lexsorted in is_pareto_front required (#5534)terminator module (#5536)samplers/_qmc.py (#5538, thanks @kAIto47802!)solution_set to loss_vals in hypervolume computation (#5541)callbacks in optimize to Iterable (#5542, thanks @kz4killua!)JournalStorage (#5544)RetryFailedTrialCallback to optuna.storages._callbacks (#5551)removed_version of deprecated JournalStorage classes (#5552)BaseJournalLogSnapshot (#5561)importance (#5578, thanks @RektPunk!)trial (#5579, thanks @RektPunk!)matplotlib/_contour.py with Python3.11 (#5580)_get_rank_subplot_info (#5581, thanks @RektPunk!)_partial_fixed.py (#5583)_cmaes.py (#5584, thanks @RektPunk!)GridSampler (#5588)search_space in terminator/improvement/evaluator.py (#5594)_bisect in _truncnorm.py (#5598)np.unique (#5615)pipdeptree v2.16.2 to hotfix parse error (https://github.com/optuna/optuna-integration/pull/109)deprecated arg for the comet CI job (https://github.com/optuna/optuna-integration/pull/135)test_pytorch_lightning.py (https://github.com/optuna/optuna-integration/pull/144)actions/setup-python and actions/checkout (#5367)type: ignore for CI hotfix (#5419)sleep function with spin waiting to stabilize the frequent Mac test failure (#5549)LICENSE file (#5597)README.md (#5601)pyproject.toml (#5645)This release was made possible by the authors and the people who participated in the reviews and discussions.
@47aamir, @Alnusjaponica, @HideakiImamura, @Obliquedbishop, @RektPunk, @TTRh, @aaravm, @aisha-partha, @alxhslm, @c-bata, @caleb-kaiser, @contramundum53, @eukaryo, @gen740, @kAIto47802, @karthikkurella, @keisuke-umezawa, @keita-sa, @kz4killua, @nabenabe0928, @neel04, @not522, @nzw0301, @porink0424, @sgerloff, @toshihikoyanase, @virendrapatil24, @y0z
Optuna is sponsored by the following sponsors on GitHub.
@AlphaImpact, @dec1costello, @dubovikmaster, @shu65, @raquelhortab
| Deprecated APIs | Corresponding active APIs | -|-
This is the release note of v4.0.0-b0.
If you want to update your existing projects from Optuna v3.x to Optuna v4, please see the migration guide and try out Optuna v4.
The Optuna team released the beta version of OptunaHub, the feature-sharing platform for Optuna. Registered features can be easily implemented on users’ code and contributors can register the features they implement. The beta version of OptunaHub is now ready to accept contributions from all over the world. Visit hub.optuna.org!
The following code shows an example to use a sampler registered on OptunaHub.
% pip install optunahub
import optunahub
import optuna
def objective(trial):
x = trial.suggest_float("x", 0, 1)
return x
mod = optunahub.load_module("samplers/simulated_annealing")
sampler = mod.SimulatedAnnealingSampler()
study = optuna.create_study(sampler=sampler)
study.optimize(objective, n_trials=20)
The stable version of the artifact module is available, now equipped with several new APIs. This module introduces capabilities for managing the relatively large-sized data such as model snapshots in hyperparameter tuning, training/validation datasets, and etc. Compared to third-party libraries for experiment tracking, the advantage of using Optuna’s artifact module is a tight integration of Optuna Dashboard. This allows users to see artifacts (files) associated with the Optuna trial or study.
Here is a list of new APIs:
download_artifact: Download an artifact from the artifact store.get_all_artifact_meta: List the associated artifact information of the provided trial or study.JournalStorageThe stable version of JournalStorage is available. This implies we have decided to maintain backward compatibility of the log format in the future releases.
Please note that this release introduces the following API changes to improve the clarity of class names and the module structure.
| Deprecated APIs | Corresponding active APIs |
|---|---|
optuna.storages.JournalFileStorage |
optuna.storages.journal.JournalFileBackend |
optuna.storages.JournalFileSymlinkLock |
optuna.storages.journal.JournalFileSymlinkLock |
optuna.storages.JournalFileOpenLock |
optuna.storages.journal.JournalFileOpenLock |
optuna.storages.JournalRedisStorage |
optuna.storages.journal.JournalRedisBackend |
skopt, catalyst, and fastaiv1 (https://github.com/optuna/optuna-integration/pull/114)CmaEsSampler from integration (https://github.com/optuna/optuna-integration/pull/116)LightGBMTuner (https://github.com/optuna/optuna-integration/pull/136)multi_objective (#5390)_ask and _tell (#5398)--direction(s) arguments in the ask command (#5405)skopt, catalyst, and fastaiv1 (#5407)samplers.intersection (#5414)ask command (#5415)study optimize CLI command (#5416)CmaEsSampler from integration (#5417)best_trial (#5426)--study in cli.py (#5430)constraints_func in plot_pareto_front function (#5455)JournalStorage (#5539)is_exhausted() function in the GridSampler class (#5306, thanks @aaravm!)download_artifact (#5448)JournalStorage (#5568)ConstrainedMCObjective to support botorch=0.10.0 (https://github.com/optuna/optuna-integration/pull/106)O(NK^2 log K) to O((N - K)K) (#5346)plot_contour faster (#5369)to_internal_repr in CategoricalDistribution (#5400)WFG by NumPy vectorization (#5424)sample_independent of GPSampler (#5428)numpy in hypervolume computation (#5432)JournalStorage (#5526)trial_id of best_trial (#5537)None objective trials correctly (https://github.com/optuna/optuna-integration/pull/119, thanks @neel04!)ConstrainedMCObjective in qnei_candidates_func (https://github.com/optuna/optuna-integration/pull/124, thanks @alxhslm!)OptunaSearchCV (https://github.com/optuna/optuna-integration/pull/128, thanks @sgerloff!)WilcoxonPruner bug when best_trial has no intermediate value (#5354)GPSampler (#5359)average_is_best implementation in WilcoxonPruner (#5366)JournalStorage (#5389)_normalize_value for incomplete trials (#5422)weights_below to be finite in MOTPE (#5435)_log_complete_trial for constrained optimization (#5462)step to int in report (#5488)seed=None in GridSampler (#5490)_create_new_trial and refactor it (#5497)sample_normalized_param for GPSampler (#5543)README.md (https://github.com/optuna/optuna-integration/pull/126)show_progress_bar (#5393)ArtifactStore methods as non-public (#5474)JournalFileStorage (#5475)make clean in docs (#5487)optuna artifact tutorial (#5491)ArtifactMeta (#5511)JournalFileStorage in documents and a tutorial (#5535)lock_obj to JournalFileStorage docstring (#5540)Returns to the docstring of load_study (#5554, thanks @kAIto47802!)storages.journal (#5560)JournalFileBackend in examples (#5562)actions/checkout@v4 and actions/setup-python@v5 (https://github.com/optuna/optuna-examples/pull/255)fastaiv1 (https://github.com/optuna/optuna-examples/pull/256)tensorflow-cpu in CIs (https://github.com/optuna/optuna-examples/pull/260)numpy<2.0.0 for catboot example (https://github.com/optuna/optuna-examples/pull/268)ExperimentalWarnings (https://github.com/optuna/optuna-integration/pull/108)GPSampler (#5365)JournalStorage (#5486)TYPE_CHECKING for ObjectiveFuncType (https://github.com/optuna/optuna-integration/pull/113)ExperimentalWarning for track_in_wandb (https://github.com/optuna/optuna-integration/pull/122)percentile.py (#5322, thanks @aaravm!)optuna/pruners/_hyperband.py (#5338, thanks @keita-sa!)optuna/pruners/_successive_halving.py and optuna/pruners/_threshold.py (#5343, thanks @keita-sa!)storages/_base.py (#5352, thanks @Obliquedbishop!)TYPE_CHECKING for Study in samplers (#5391)_normalize_objective_values in NSGA-III to supress RuntimeWarning (#5399)ObjectiveFuncType available externally (#5401)numpy with np (#5412)_brute_force.py (#5441)__future__.annotations to base sampler (#5442)__future__.annotations to TPE-related modules (#5443)__future__.annotations in optuna/storages/_rdb/models.py (#5452, thanks @aisha-partha!)GPSampler (#5484)WFG a function (#5504)create_new_trial (#5510).rst files (#5514, thanks @47aamir!)_ with __ in the link in Sphinx (#5517)plot_parallel_coordinate() (#5527, thanks @karthikkurella!)assume_unique_lexsorted in is_pareto_front required (#5534)terminator module (#5536)samplers/_qmc.py (#5538, thanks @kAIto47802!)solution_set to loss_vals in hypervolume computation (#5541)callbacks in optimize to Iterable (#5542, thanks @kz4killua!)JournalStorage (#5544)RetryFailedTrialCallback to optuna.storages._callbacks (#5551)removed_version of deprecated JournalStorage classes (#5552)BaseJournalLogSnapshot (#5561)pipdeptree v2.16.2 to hotfix parse error (https://github.com/optuna/optuna-integration/pull/109)deprecated arg for the comet CI job (https://github.com/optuna/optuna-integration/pull/135)actions/setup-python and actions/checkout (#5367)type: ignore for CI hotfix (#5419)sleep function with spin waiting to stabilize the frequent Mac test failure (#5549)This release was made possible by the authors and the people who participated in the reviews and discussions.
@47aamir, @Alnusjaponica, @HideakiImamura, @Obliquedbishop, @TTRh, @aaravm, @aisha-partha, @alxhslm, @c-bata, @caleb-kaiser, @contramundum53, @eukaryo, @gen740, @kAIto47802, @karthikkurella, @keisuke-umezawa, @keita-sa, @kz4killua, @nabenabe0928, @neel04, @not522, @nzw0301, @porink0424, @sgerloff, @toshihikoyanase, @virendrapatil24, @y0z
This is the release note of v3.6.2.
This is the release note of v3.6.2.
load_study function.Your coding agent can read these notes before it upgrades. Set up the MCP server →