pypi optuna 2.1.0
v2.1.0

latest releases: 4.3.0, 4.2.1, 3.6.2...
4 years ago

This is the release note of v2.1.0.

Optuna v2.1.0 will be the last version to support Python 3.5. See #1067.

Highlights

Allowing objective(study.best_trial)

FrozenTrial used to subclass object but now implements BaseTrial. It can be used in places where a Trial is expected, including user-defined objective functions.

Re-evaluating the objective functions with the best parameter configuration is now straight forward. See #1503 for more details.

study.optimize(objective, n_trials=100)
best_trial = study.best_trial
best_value = objective(best_trial)  # Did not work prior to v2.1.0.

IPOP-CMA-ES Sampling Algorithm

CmaEsSampler comes with an experimental option to switch to IPOP-CMA-ES. This algorithm restarts the strategy with an increased population size after premature convergence, allowing a more explorative search. See #1548 for more details.

image

Comparing the new option with the previous CmaEsSampler and RandomSampler.

Optuna & MLFlow on Kubernetes Example

Optuna can be easily integrated with MLFlow on Kubernetes clusters. The example contained here is a great introduction to get you started with a few lines of commands. See #1464 for more details.

Providing Type Hinting to Applications

Type hint information is packaged following PEP 561. Users of Optuna can now run style checkers against the framework. Note that the applications which ignore missing imports may raise new type-check errors due to this change. See #1720 for more details.

Breaking Changes

Configuration files for AllenNLPExecutor may need to be updated. See #1544 for more details.

  • Remove allennlp.common.params.infer_and_cast from AllenNLP integrations (#1544)
  • Deprecate optuna.integration.KerasPruningCallback (#1670, thanks @VamshiTeja!)
  • Make Optuna PEP 561 Compliant (#1720, thanks @MarioIshac!)

New Features

  • Add sampling functions to FrozenTrial (#1503, thanks @nzw0301!)
  • Add modules to compute hypervolume (#1537)
  • Add IPOP-CMA-ES support in CmaEsSampler (#1548)
  • Implement skorch pruning callback (#1668)

Enhancements

  • Make sampling from trunc-norm efficient in TPESampler (#1562)
  • Add trials to cache when awaking WAITING trials in _CachedStorage (#1570)
  • Add log in create_new_study method of storage classes (#1629, thanks @tohmae!)
  • Add border to markers in contour plot (#1691, thanks @zchenry!)
  • Implement hypervolume calculator for two-dimensional space (#1771)

Bug Fixes

  • Avoid to sample the value which equals to upper bound (#1558)
  • Exit thread after session is destroyed (#1676, thanks @KoyamaSohei!)
  • Disable feature_pre_filter in LightGBMTuner (#1774)
  • Fix fANOVA for IntLogUniformDistribution (#1790)

Installation

  • Add packaging in install_requires (#1551)
  • Fix failure of Keras integration due to TF2.3 (#1563)
  • Install fsspec<0.8.0 for Python 3.5 (#1596)
  • Specify the version of packaging to >= 20.0 (#1599, thanks @Isa-rentacs!)
  • Install lightgbm<3.0.0 to circumvent error with feature_pre_filter (#1773)

Documentation

  • Fix link to the definition of StudySummary (#1533, thanks @nzw0301!)
  • Update log format in docs (#1538)
  • Integrate Sphinx Gallery to make tutorials easily downloadable (#1543)
  • Add AllenNLP pruner to list of pruners in tutorial (#1545)
  • Refine the help of study-name (#1565, thanks @belldandyxtq!)
  • Simplify contribution guidelines by removing rule about PR title naming (#1567)
  • Remove license section from README.md (#1573)
  • Update key features (#1582)
  • Simplify documentation of BaseDistribution.single (#1593)
  • Add navigation links for contributors to README.md (#1597)
  • Apply minor changes to CONTRIBUTING.md (#1601)
  • Add list of projects using Optuna to examples/README.md (#1605)
  • Add a news section to README.md (#1606)
  • Avoid the latest stable sphinx (#1613)
  • Add link to examples in tutorial (#1625)
  • Add the description of default pruner (MedianPruner) to the documentation (#1657, thanks @Chillee!)
  • Remove generated directories with make clean (#1658)
  • Delete a useless auto generated directory (#1708)
  • Divide a section for each integration repository (#1709)
  • Add example to optuna.study.create_study (#1711, thanks @Ruketa!)
  • Add example to optuna.study.load_study (#1712, thanks @bigbird555!)
  • Fix broken doctest example code (#1713)
  • Add some notes and usage example for the hypervolume computing module (#1715)
  • Fix issue where doctests are not executed (#1723, thanks @harupy!)
  • Add example to optuna.study.Study.optimize (#1726, thanks @norihitoishida!)
  • Add target for doctest to Makefile (#1732, thanks @harupy!)
  • Add example to optuna.study.delete_study (#1741, thanks @norihitoishida!)
  • Add example to optuna.study.get_all_study_summaries (#1742, thanks @norihitoishida!)
  • Add example to optuna.study.Study.set_user_attr (#1744, thanks @norihitoishida!)
  • Add example to optuna.study.Study.user_attrs (#1745, thanks @norihitoishida!)
  • Add example to optuna.study.Study.get_trials (#1746, thanks @norihitoishida!)
  • Add example to optuna.multi_objective.study.MultiObjectiveStudy.optimize (#1747, thanks @norihitoishida!)
  • Add explanation for optuna.trial (#1748)
  • Add example to optuna.multi_objective.study.create_study (#1749, thanks @norihitoishida!)
  • Add example to optuna.multi_objective.study.load_study (#1750, thanks @norihitoishida!)
  • Add example to optuna.study.Study.stop (#1752, thanks @Ruketa!)
  • Re-generate contour plot example with padding (#1758)

Examples

  • Add an example of Kubernetes, PyTorchLightning, and MLflow (#1464)
  • Create study before multiple workers are launched in Kubernetes MLflow example (#1536)
  • Fix typo in examples/kubernetes/mlflow/README.md (#1540)
  • Reduce search space for AllenNLP example (#1542)
  • Introduce plot_param_importances in example (#1555)
  • Removing references to deprecated optuna study optimize commands from examples (#1566, thanks @ritvik1512!)
  • Add scripts to run examples/kubernetes/* (#1584, thanks @VamshiTeja!)
  • Update Kubernetes example of "simple" to avoid potential errors (#1600, thanks @Nishikoh!)
  • Implement skorch pruning callback (#1668)
  • Add a tf.keras example (#1681, thanks @sfujiwara!)
  • Update examples/pytorch_simple.py (#1725, thanks @wangxin0716!)
  • Fix Binh and Korn function in MO example (#1757)

Tests

  • Test _CachedStorage in test_study.py (#1575)
  • Rename tests/multi_objective as tests/multi_objective_tests (#1586)
  • Do not use deprecated pytorch_lightning.data_loader decorator (#1667)
  • Add test for hypervolume computation for solution sets with duplicate points (#1731)

Code Fixes

  • Match the order of definition in trial (#1528, thanks @nzw0301!)
  • Add type hints to storage (#1556)
  • Add trials to cache when awaking WAITING trials in _CachedStorage (#1570)
  • Use packaging to check the library version (#1610, thanks @VamshiTeja!)
  • Fix import order of packaging.version (#1623)
  • Refactor TPE's sample_from_categorical_dist (#1630)
  • Fix error messages in TPESampler (#1631, thanks @kstoneriv3!)
  • Add code comment about n_ei_candidates for categorical parameters (#1637)
  • Add type hints into optuna/integration/keras.py (#1642, thanks @airyou!)
  • Fix how to use black in CONTRIBUTING.md (#1646)
    1- Add type hints into optuna/cli.py (#1648, thanks @airyou!)
  • Add type hints into optuna/dashboard.py, optuna/integration/__init__.py (#1653, thanks @airyou!)
  • Add type hints optuna/integration/_lightgbm_tuner (#1655, thanks @upura!)
  • Fix LightGBM Tuner import code (#1659)
  • Add type hints to optuna/storages/__init__.py (#1661, thanks @akihironitta!)
  • Add type hints to optuna/trial (#1662, thanks @upura!)
  • Enable flake8 E231 (#1663, thanks @harupy!)
  • Add type hints to optuna/testing (#1665, thanks @upura!)
  • Add type hints to tests/storages_tests/rdb_tests (#1666, thanks @akihironitta!)
  • Add type hints to optuna/samplers (#1673, thanks @akihironitta!)
  • Fix type hint of optuna.samplers._random (#1678, thanks @nyanhi!)
  • Add type hints into optuna/integration/mxnet.py (#1679, thanks @norihitoishida!)
  • Fix type hint of optuna/pruners/_nop.py (#1680, thanks @Ruketa!)
  • Update Type Hints: prunes/_percentile.py and prunes/_median.py (#1682, thanks @ytknzw!)
  • Fix incorrect type annotations for args and kwargs (#1684, thanks @harupy!)
  • Update type hints in optuna/pruners/_base.py and optuna/pruners/_successive_halving.py (#1685, thanks @ytknzw!)
  • Add type hints to test_optimization_history.py (#1686, thanks @yosupo06!)
  • Fix type hint of tests/pruners_tests/test_median.py (#1687, thanks @polyomino-24!)
  • Type hint and reformat of files under visualization_tests (#1689, thanks @gasin!)
  • Remove unused argument trial from optuna.samplers._tpe.sampler._get_observation_pairs (#1692, thanks @ytknzw!)
  • Add type hints into optuna/integration/chainer.py (#1693, thanks @norihitoishida!)
  • Add type hints to optuna/integration/tensorflow.py (#1698, thanks @uenoku!)
  • Add type hints into optuna/integration/chainermn.py (#1699, thanks @norihitoishida!)
  • Add type hints to optuna/integration/xgboost.py (#1700, thanks @Ruketa!)
  • Add type hints to files under tests/integration_tests (#1701, thanks @gasin!)
  • Use Optional for keyword arguments that default to None (#1703, thanks @harupy!)
  • Fix type hint of all the rest files under tests/ (#1704, thanks @gasin!)
  • Fix type hint of optuna/integration (#1705, thanks @akihironitta!)
  • Add l2 metric aliases to LightGBMTuner (#1717, thanks @thigm85!)
  • Convert type comments in optuna/study.py into type annotations (#1724, thanks @harupy!)
  • Apply black==20.8b1 (#1730)
  • Fix type hint of optuna/integration/sklearn.py (#1735, thanks @akihironitta!)
  • Add type hints into optuna/structs.py (#1743, thanks @norihitoishida!)
  • Fix typo in optuna/samplers/_tpe/parzen_estimator.py (#1754, thanks @akihironitta!)

Continuous Integration

  • Temporarily skip allennlp_jsonnet.py example in CI (#1527)
  • Run TensorFlow on Python 3.8 (#1564)
  • Bump PyTorch to 1.6 (#1572)
  • Skip entire allennlp example directory in CI (#1585)
  • Use actions/setup-python@v2 (#1594)
  • Add cache to GitHub Actions Workflows (#1595)
  • Run example after docker build to ensure that built image is setup properly (#1635, thanks @harupy!)
  • Use cache-from to build docker image faster (#1638, thanks @harupy!)
  • Fix issue where doctests are not executed (#1723, thanks @harupy!)

Other

  • Remove Swig installation from Dockerfile (#1462)
  • Add: How to run examples with our Docker images (#1554)
  • GitHub Action labeler (#1591)
  • Do not trigger labeler on push (#1624)
  • Fix invalid YAML syntax (#1626)
  • Pin sphinx version to 3.0.4 (#1627, thanks @harupy!)
  • Add .dockerignore (#1633, thanks @harupy!)
  • Fix how to use black in CONTRIBUTING.md (#1646)
  • Add pyproject.toml for easier use of black (#1649)
  • Fix docs/Makefile (#1650)
  • Ignore vscode configs (#1660)
  • Make Optuna PEP 561 Compliant (#1720, thanks @MarioIshac!)

Don't miss a new optuna release

NewReleases is sending notifications on new releases.