<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yoshihiko Ozaki on Medium]]></title>
        <description><![CDATA[Stories by Yoshihiko Ozaki on Medium]]></description>
        <link>https://medium.com/@yozaki?source=rss-e68c0864db53------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*BSKY0S2j1QW5MPIE</url>
            <title>Stories by Yoshihiko Ozaki on Medium</title>
            <link>https://medium.com/@yozaki?source=rss-e68c0864db53------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:03:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yozaki/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Releasing Optuna v5.0, an Open-Source Black-Box Optimization Library]]></title>
            <link>https://medium.com/optuna/releasing-optuna-v5-0-an-open-source-black-box-optimization-library-9bff8b4587ba?source=rss-e68c0864db53------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bff8b4587ba</guid>
            <category><![CDATA[automl]]></category>
            <category><![CDATA[optuna]]></category>
            <dc:creator><![CDATA[Yoshihiko Ozaki]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 05:54:07 GMT</pubDate>
            <atom:updated>2026-09-07T05:54:07.095Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Since its public release in 2018, Optuna has grown through extensive feature development into software used by a large community. With over 14,000 GitHub stars, more than 16 million monthly downloads, over 32,000 dependent projects, and over 16,000 paper citations, it has earned the support of many users over eight years and become one of the most widely used black-box optimization OSS libraries.</p><p>Although Optuna was originally released as a hyperparameter optimization framework for machine learning, it has increasingly been adopted in recent years as a more general-purpose black-box optimization framework, expanding into diverse domains beyond machine learning such as <a href="https://matlantis.com/en/resources/blog/matlantis-csp-and-optuna/">materials science</a> and <a href="https://medium.com/optuna/black-box-optimization-of-geometry-and-functionality-by-integrating-optuna-and-3d-cad-f2d2984d263e">structural design</a>.</p><p>To help Optuna solve even more real-world problems, our development team has worked hard on a high-performance next version. Today, we are releasing Optuna v5, a new major version of Optuna, together with <strong>Rustuna</strong>, a black-box optimization framework offering a fast Optuna-compatible API implemented in Rust.</p><ul><li><strong>Optuna v5: </strong>This is the direct successor to the current Optuna line. It includes several changes befitting a major update: the first default sampler change since Optuna v1.5, a new API for constrained optimization, a change to the default parameter importance algorithm, and enhancements to the Gaussian-process-based optimization algorithm.</li><li><strong>Rustuna: </strong>Optuna’s design assumes hyperparameter optimization of machine learning models, where model training dominates runtime. In diverse use cases beyond machine learning, however, the situation differs, and sampling or storage can become the bottleneck. Rustuna is a fast, memory-efficient, Optuna-compatible framework implemented in Rust to address these performance challenges.</li></ul><p>This post introduces the major updates in Optuna v5 individually. Rustuna is covered in detail in a separate release blog post.</p><h3>Key Changes in Optuna v5</h3><h4>Major Update to Optuna’s Default Optimization Algorithms</h4><p>Optuna’s default samplers have long been the Tree-Structured Parzen Estimator (TPE) for single-objective optimization and Non-dominated Sorting Genetic Algorithm II (NSGA-II) for multi-objective optimization, with their internal settings left largely unchanged for years. In Optuna v5, we improved the default optimization algorithms based on research and benchmark results accumulated over the past several years (Figure 1).</p><ol><li><strong>Switched the default multi-objective sampler to TPESampler: </strong>Multi-objective TPE was reported in [1] to outperform NSGA-II, but at the time it could not be adopted as the default because its execution speed was a bottleneck. Years of speed improvements have since resolved this issue, so in v5, TPESampler becomes the default for both single-objective and multi-objective optimization.</li><li><strong>Enabled Multivariate TPE by default: </strong>Instead of treating each parameter independently as in the conventional approach, Multivariate TPE captures interactions between parameters by modeling their joint distribution. Multivariate TPE was reported in [2] to have an advantage when combined with Optuna’s bandwidth selection, and our own follow-up experiments confirmed a similar trend in single-objective optimization, so we enabled this feature by default. For multi-objective optimization, since we observed no performance improvement in benchmarks, we will continue using independent TPE as before.</li><li><strong>Enabled Constant Liar by default: </strong>Without special handling, parallel optimization with TPE causes each worker to reference the same set of completed trials, resulting in nearly identical parameter proposals. With Constant Liar enabled, proposals near trials that are still being evaluated are suppressed, which is expected to improve performance in parallel optimization.</li></ol><p>Details of the follow-up experiments and benchmarks conducted for the default sampler changes will be shared in a separate blog post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwRrd_b5nYUjsfSD5_JAAw.png" /><figcaption>Figure 1: Performance comparison between the default samplers of Optuna v4.9 and v5.0. (Left) Benchmark results on BBOB (single-objective). (Right) Benchmark results on WFG (multi-objective).</figcaption></figure><h3>New API for Constrained Optimization</h3><p>Optuna has supported constrained optimization since v2.4, but this was positioned as a feature of certain samplers. In Optuna v5, constrained optimization has been elevated from a sampler-level feature to a core feature of Optuna, available through a more natural API. Going forward, constraints can be set simply by calling trial.set_constraint() inside the objective function, and constraint values can be retrieved via trial.constraints.</p><pre>import optuna<br><br>def objective(trial):<br>    trial.set_constraint(&quot;c0&quot;, c0)<br>    trial.set_constraint(&quot;c1&quot;, c1)<br>    …<br><br>sampler = optuna.samplers.TPESampler()<br>study = optuna.create_study(sampler=sampler)<br>study.optimize(objective)<br>print(study.best_trial.constraints)</pre><h3>PED-ANOVA as the Default for Parameter Importance Calculation</h3><p>Parameter importance quantifies how much each parameter affects the observed objective function value. It is highly useful for interpreting optimization results, identifying key design decisions, detecting irrelevant or redundant parameters, and guiding subsequent search processes or manual tuning.</p><p>Optuna used f-ANOVA [3] as its default parameter importance algorithm, but starting with Optuna v5, it uses PED-ANOVA [4] as the default instead. This brings several benefits: dramatically faster parameter importance computation compared to f-ANOVA, usability with only Optuna’s standard dependencies, and newly developed support for conditional search spaces and multi-objective optimization. In particular, the conditional search space support we developed was accepted at KDD 2026, one of the top conferences in the machine learning field. See the paper below [5] for details:</p><ul><li><a href="https://arxiv.org/abs/2601.20800">Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical &amp; Dynamic Search Spaces</a></li></ul><p>Parameter importance using PED-ANOVA in Optuna can be used as follows:</p><pre>import optuna<br><br>def objective(trial: optuna.Trial) -&gt; float:<br>    model = trial.suggest_categorical(&quot;model&quot;, [&quot;nn&quot;, &quot;tree&quot;])<br>    if model == &quot;nn&quot;:<br>        n_layers = trial.suggest_int(&quot;n_layers&quot;, 1, 5)<br>        return train_nn(n_layers)<br>    else:<br>        min_split_gain = trial.suggest_float(&quot;min_split_gain&quot;, 0.0, 1.0)<br>        return train_tree(min_split_gain)<br><br>study = optuna.create_study(direction=&#39;minimize&#39;)<br>study.optimize(objective, n_trials=100)<br><br>importance = optuna.importance.get_param_importances(study)<br>print(importance)<br><br>fig = optuna.visualization.plot_param_importances(study)<br>fig.show()</pre><p>Further details will be covered in a separate blog post. Please try the new Optuna v5 parameter importance calculation.</p><h3>GPSampler</h3><p>GPSampler is a sampler that performs Bayesian optimization based on Gaussian processes. It delivers strong optimization performance, especially on problems involving continuous parameters, and is well suited to optimization problems where each evaluation is time-consuming or costly.</p><p>Through Optuna v4.7, GPSampler performed Gaussian process regression using only completed trials. As a result, trials still under evaluation were not reflected in the regression model, causing nearby candidate points to be proposed repeatedly in batch optimization.</p><p><a href="https://medium.com/optuna/improving-optunas-gpsampler-parallelization-by-considering-running-trials-10d42aeb5d49">Optuna v4.8 introduced Constant Liar</a> to address this issue. With Constant Liar, provisional objective function values are assigned to points still under evaluation and treated as observed points, suppressing subsequent candidate points from overlapping with those under evaluation. However, this approach had the drawback that the values assigned to points under evaluation were determined heuristically.</p><p>To address this, Optuna v5 introduces a Monte Carlo-based acquisition function that accounts for points under evaluation. This method draws multiple samples of the objective function value at the points under evaluation from the Gaussian process posterior distribution. It then computes the improvement for each sample set and derives the final acquisition function value as their average. This allows candidate points to be proposed while accounting for predictive uncertainty, without assigning a single heuristic value to points under evaluation. Below is the optimization performance assuming 5-way parallel optimization, proposing candidate points in sequence (Figure 2). It clearly shows higher optimization performance than the conventional Constant Liar approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*ZbL1JK5tJM_IgKwgJBIUpw.png" /><figcaption>Figure 2: Performance comparison of GPSampler between Optuna v4.9 and v5.0 (5-way parallel).</figcaption></figure><h3>Simultaneously Releasing “Rustuna,” a Fast Rust Implementation of Optuna</h3><p>Optuna is now used for a wide variety of purposes beyond hyperparameter optimization. This has surfaced new challenges. For example, in use cases such as crystal structure search, it is not uncommon for the number of evaluations to reach the hundreds of thousands. At this scale, Optuna’s execution speed and memory consumption become bottlenecks, making efficient search difficult.</p><p>Given that various software projects such as <a href="https://github.com/astral-sh/ruff">Ruff</a>, <a href="https://github.com/pola-rs/polars">Polars</a>, and <a href="https://github.com/pydantic/pydantic">Pydantic V2</a> have achieved dramatic speedups through Rust in recent years, we developed and released <a href="https://github.com/optuna/rustuna">Rustuna</a>, a fast Rust implementation of Optuna. Its main features are as follows:</p><ol><li><strong>Fast sampler implementations: </strong>Rustuna supports single-objective TPE, multi-objective TPE, NSGA-II, CMA-ES, and Random Search. Depending on the sampler used and the number of evaluations, Rustuna achieves speedups ranging from several-fold to several hundred-fold when the objective function evaluation itself is quick.</li><li><strong>Memory-efficient storage implementation: </strong>When running large-scale searches with hundreds of thousands of evaluations, memory consumption can grow to non-negligible levels. Rustuna includes a feature to discard evaluation history no longer needed for the search from storage, avoiding the problem of memory consumption and execution time degrading linearly as the number of evaluations increases.</li><li><strong>Zero Python runtime dependency: </strong>Whereas Optuna depends on packages such as NumPy and SQLAlchemy, Rustuna has no Python dependencies except for some features. This also helps mitigate the risk of supply chain attacks that have become increasingly common in recent years.</li></ol><p>For more details on Rustuna, please see the release blog post and official documentation below.</p><ul><li>Release blog post: <a href="https://medium.com/@c-bata/announcing-rustuna-cc82a6815bf7">https://medium.com/optuna/announcing-rustuna-cc82a6815bf7</a></li><li>GitHub: <a href="https://github.com/optuna/rustuna">https://github.com/optuna/rustuna</a></li><li>Official documentation: <a href="https://rustuna.readthedocs.io/">https://rustuna.readthedocs.io/</a></li></ul><h3>Conclusion</h3><p>With Optuna v5 and Rustuna, you can now tackle black-box optimization faster and more effectively across domains ranging from machine learning hyperparameter optimization to materials science and structural design. Optuna v5 packs improvements that many users will notice directly: the first default sampler change since v1.5, a refined constrained optimization API, and faster parameter importance calculation. For use cases requiring many evaluations, we also encourage you to try Rustuna.</p><p>Our development team will continue to expand functionality and improve performance so that the Optuna family can help solve even more real-world problems. Please try out the latest release and share your feedback through GitHub Issues and Discussions.</p><h3>Reference</h3><ol><li>Ozaki, Y., Tanigaki, Y., Watanabe, S., Nomura, M., &amp; Onishi, M. (2022). Multiobjective tree-structured parzen estimator. Journal of Artificial Intelligence Research, 73, 1209–1250.</li><li>Watanabe, S. (2023). Tree-Structured Parzen Estimator: Understanding Its Algorithm Components and Their Roles for Better Empirical Performance. arXiv preprint arXiv:2304.11127.</li><li>Hutter, F., Hoos, H., &amp; Leyton-Brown, K. (2014, January). An efficient approach for assessing hyperparameter importance. In International Conference on Machine Learning (pp. 754–762). PMLR.</li><li>Watanabe, S., Bansal, A., &amp; Hutter, F. (2023). PED-ANOVA: Efficiently quantifying hyperparameter importance in arbitrary subspaces. In Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence (IJCAI ’23) (Article 488, pp. 4389–4396).</li><li>Baba, K., Ozaki, Y., &amp; Watanabe, S. (2026, August). Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical &amp; Dynamic Search Spaces. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2 (pp. 57–68).</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bff8b4587ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/optuna/releasing-optuna-v5-0-an-open-source-black-box-optimization-library-9bff8b4587ba">Releasing Optuna v5.0, an Open-Source Black-Box Optimization Library</a> was originally published in <a href="https://medium.com/optuna">Optuna</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing Optuna 4.6]]></title>
            <link>https://medium.com/optuna/announcing-optuna-4-6-a9e82183ab07?source=rss-e68c0864db53------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9e82183ab07</guid>
            <category><![CDATA[hyperparameter-tuning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[optuna]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[automl]]></category>
            <dc:creator><![CDATA[Yoshihiko Ozaki]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 05:52:26 GMT</pubDate>
            <atom:updated>2025-11-10T05:52:26.995Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>We are excited to announce the release of Optuna 4.6, the latest version of our black-box optimization framework. This release significantly improves the user experience and optimization performance, with a particular focus on the following highlights:</p><ul><li>Introduction of an interactive interface powered by Large Language Models (LLMs)</li><li>Further speed enhancements for GPSampler</li><li>Full support for multi-objective and constrained optimization in AutoSampler</li><li>Additions of robust Bayesian optimization packages</li></ul><p>Beyond these significant improvements, this version also includes several updates to enhance usability, including an OpenTelemetry integration tutorial, LaTeX support in OptunaHub, and structured output support for the Optuna MCP Server. In this article, we will detail these noteworthy updates.</p><p>Get started with the new features by installing the latest version with the following command!</p><pre>pip install -U optuna optuna-dashboard optunahub</pre><h3>Optuna Dashboard LLM Integration</h3><p>We are introducing an LLM integration feature to the Optuna Dashboard. By enabling this, you can now utilize two key functions: 1) filtering trials using natural language and 2) automatic graph generation.</p><p>The natural language trial filtering feature, as shown in Figure 1, allows you to filter the trials displayed in graphs and tables using natural language queries. Previously, the filter conditions in Optuna Dashboard were quite limited, as supporting a wide variety of conditions would complicate the UI and hinder usability. With this new feature, the LLM generates a filter function based on your instructions, enabling flexible filtering through a simple interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7w8Tg15mURJa5IfCsAkHLg.png" /><figcaption>Figure 1: Natural language trial filtering feature.</figcaption></figure><p>Next, let’s take a look at the automatic graph generation feature. Optuna Dashboard supports general-purpose graphs for any optimization task, including visualizing objective value history, Pareto fronts, and contour plots. However, it was challenging to support visualizations tailored to specific optimization tasks that are needed in only a few use cases. Now, as shown in Figure 2, you can describe the plot you want in natural language, and the LLM will generate a visualization function using <a href="https://plotly.com/javascript/">Plotly.js</a>. This enables task-specific visualizations that were previously unsupported.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQjBq9CIWEYaCT4YVYh0_A.png" /><figcaption>Figure 2: Example of the automatic graph generation feature. The LLM used was OpenAI’s GPT-5 Mini. The input prompt was “Plot intermediate values of all trials in a study.”</figcaption></figure><p>For instructions on how to use the LLM integration, please refer to the <a href="https://optuna-dashboard.readthedocs.io/en/latest/tutorials/llm-integration.html">Tutorial: LLM Integration — Optuna Dashboard documentation</a>. Please note that the performance of these features depends on the LLM being used.</p><h3>Speeding up GPSampler</h3><p>GPSampler is a Gaussian Process-based Bayesian optimization sampler known for its high sample efficiency. However, when the evaluation time of the objective function is less than a few hours, the sampling time of GPSampler can become a bottleneck.</p><p>In Optuna v4.6, we have made several modifications to GPSampler’s internal implementation to accelerate sampling time while maintaining optimization performance. Specifically, we implemented caching for repeated calculations, removed unnecessary operation calls for empty tensors, and parallelized the optimization of the acquisition function. In the experimental setup shown in Figure 3, we achieved a speedup of nearly 8x. The parallelization of the acquisition function optimization is detailed in <a href="https://tech.preferred.jp/ja/blog/speed-up-optuna-gpsampler-by-batch-opt/">a separate article</a> (in Japanese). Please note that the actual speedup may vary depending on the computational environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*oE1sisfwDGkEREeUC5F8mg.png" /><figcaption>Figure 3: Speedup effect of GPSampler compared to v4.5. The horizontal axis represents the number of trials, and the vertical axis shows the cumulative execution time. The benchmark was performed on the 10-dimensional Rastrigin function, for both v4.5 and v4.6, with three different random seeds. The shaded areas represent the standard error from these three seeds.</figcaption></figure><h3>Full Support for Multi-objective and Constrained Optimization in AutoSampler</h3><p><a href="https://hub.optuna.org/samplers/auto_sampler/">AutoSampler</a> is the most popular package in OptunaHub, enabling efficient optimization by automatically selecting the best algorithm. In Optuna v4.6, we have fully implemented sampler selection rules for multi-objective and constrained optimization (Figure 4). The latest AutoSampler now strategically uses samplers like <a href="https://optuna.readthedocs.io/en/stable/reference/samplers/generated/optuna.samplers.GPSampler.html">GPSampler</a> for constrained and multi-objective optimization (implemented across Optuna v4.2-v4.5) and <a href="https://optuna.readthedocs.io/en/stable/reference/samplers/generated/optuna.samplers.NSGAIIISampler.html">NSGAIIISampler</a> for many-objective optimization, leading to significant improvements in benchmark performance.</p><p>For more details, please see our blog post, <a href="https://medium.com/optuna/autosampler-full-support-for-multi-objective-constrained-optimization-c1c4fc957ba2">“AutoSampler: Full Support for Multi-Objective &amp; Constrained Optimization.”</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbmzfI-r_Z5g045WOK62JQ.png" /><figcaption>Figure 4: The new AutoSampler fully supports multi-objective and constrained optimization.</figcaption></figure><h3>Additions of Robust Bayesian Optimization Packages</h3><p>Robust Bayesian optimization is a method for ensuring that optimal solutions obtained through simulations can be stably reproduced in real-world experiments, even when parameter values are noisy. In practice, maintaining experimental parameters (e.g., temperature and pressure) precisely is challenging and can lead to variations in results. To address this issue, research and development are underway to develop a framework for finding optimal solutions in which the objective function’s value does not degrade significantly even when the set values deviate slightly.</p><p>In Optuna v4.6, we have made <a href="https://hub.optuna.org/samplers/carbo/">CARBO</a> and <a href="https://hub.optuna.org/samplers/value_at_risk/">Value at Risk (VaR)</a>, which are robust Bayesian optimization methods developed in the fields of experimental chemistry and machine learning, respectively, available via OptunaHub. As shown in Figure 5, the introduced methods can perform robust optimization even in the presence of input noise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*pceAz2qdB9G_oGgdZQU-GA.png" /><figcaption>Figure 5: Results of constrained robust Bayesian optimization by CARBO (for details on the problem setup, please see <a href="https://github.com/optuna/optunahub-registry/pull/285">the PR</a>). On the contour plot, blue indicates a good objective value, while yellow indicates a poor one. The region where constraints are not satisfied is shaded. The yellow point is the robust parameter discovered by CARBO, and the light blue box represents the range of parameter values that the yellow point can take due to noise. The figure shows that the robust solution almost always satisfies the constraints and achieves a good objective value, even in the presence of noise.</figcaption></figure><h3>Other Updates</h3><h4>Tutorial for Monitoring Optuna Dashboard with OpenTelemetry</h4><p>We have released a new tutorial, “<a href="https://optuna-dashboard.readthedocs.io/en/latest/tutorials/opentelemetry.html">Tutorial: Integrating with OpenTelemetry</a>,” for monitoring Optuna Dashboard using <a href="https://opentelemetry.io/">OpenTelemetry</a>. OpenTelemetry is a framework that simplifies the monitoring and tracking of performance and resource usage in applications and systems. By integrating Optuna Dashboard with OpenTelemetry (Figure 6), you can:</p><ul><li>Monitor HTTP request metrics (latency, error rate, throughput).</li><li>Track the performance of database queries.</li><li>Export metrics to <a href="https://prometheus.io/">Prometheus</a> for storage and visualization in <a href="https://grafana.com/">Grafana</a>.</li></ul><p>If you are interested in monitoring your Optuna Dashboard, we encourage you to try it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*PjGGwwCuv9NTNJBOj0GsbQ.png" /><figcaption>Figure 6: Diagram of the integration between Optuna Dashboard and OpenTelemetry.</figcaption></figure><h4>LaTeX Support on OptunaHub Package Detail Pages</h4><p>We’ve added support for LaTeX mathematical expressions on the package detail pages in <a href="https://hub.optuna.org/">OptunaHub</a>. With this update, package developers can now use both inline ($expr$, `$expr$`) and block ($$expr$$) expressions with <a href="https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions">GitHub-compatible syntax</a>. For users, this dramatically improves documentation readability, as formulas are now beautifully rendered. Figure 7 shows an example of formulas from the <a href="https://hub.optuna.org/samplers/carbo/">CARBOSampler</a>’s package detail page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M_MF4rbbm-K4nD4NvD9w2Q.png" /><figcaption>Figure 7: Example of LaTeX formulas on a package detail page.</figcaption></figure><h4>Optuna MCP Server Now Supports Structured Output</h4><p>Optuna MCP Server now supports Structured Output, a feature introduced in <a href="https://modelcontextprotocol.io/specification/2025-06-18">the latest Model Context Protocol specification (2025–06–18)</a>. This enhancement improves stability by automatically validating the results returned from the Optuna MCP Server to the MCP client against an output schema generated from type annotations. For more technical details, please refer to <a href="https://github.com/modelcontextprotocol/python-sdk?tab=readme-ov-file#structured-output">the official documentation</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*WIfYp5WssOyF9mMbHCXWqQ.png" /><figcaption>Figure 8: Example of Structured Output in Optuna MCP Server. (Left) In optuna-mcp 0.1.2, the study name was embedded in text, requiring the LLM to recognize and extract it. (Right) In optuna-mcp 0.2.0, the study name is defined in a JSON schema, allowing for easy retrieval and validation.</figcaption></figure><h3>What’s Ahead</h3><p>In this article, we have introduced the release highlights of Optuna v4.6. These highlights are directly tied to the three core concepts of <a href="https://medium.com/optuna/optuna-v5-roadmap-ac7d6935a878">the Optuna v5 roadmap</a>, which we unveiled this past May.</p><p><strong>Unleashing the Potential of Black-box Optimization with Generative AI</strong></p><ul><li>Introduction of Optuna Dashboard LLM Integration</li><li>Structured Output Support for Optuna MCP Server</li></ul><p><strong>Making Optuna Available Anytime, Anywhere</strong></p><ul><li>Tutorial for Monitoring Optuna Dashboard with OpenTelemetry</li></ul><p><strong>Continuing the Sustainable Growth of Optuna</strong></p><ul><li>Speeding up GPSampler</li><li>Full Support for Multi-Objective and Constrained Optimization in AutoSampler</li><li>Additions of Robust Bayesian Optimization Packages</li><li>LaTeX Support on OptunaHub Package Detail Pages</li></ul><p>We are preparing to change the default sampler, prototyping performance improvements by replacing components with Rust, and validating prompt-optimization techniques. We plan to continue releasing exciting new features as we move toward Optuna v5, so please stay tuned!</p><h3>Contributors</h3><p>The v4.6 release includes contributions from the following contributors. Thank you all!</p><p>@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</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9e82183ab07" width="1" height="1" alt=""><hr><p><a href="https://medium.com/optuna/announcing-optuna-4-6-a9e82183ab07">Announcing Optuna 4.6</a> was originally published in <a href="https://medium.com/optuna">Optuna</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AutoSampler: Full Support for Multi-Objective & Constrained Optimization]]></title>
            <link>https://medium.com/optuna/autosampler-full-support-for-multi-objective-constrained-optimization-c1c4fc957ba2?source=rss-e68c0864db53------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1c4fc957ba2</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[optuna]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[optunahub]]></category>
            <dc:creator><![CDATA[Yoshihiko Ozaki]]></dc:creator>
            <pubDate>Tue, 28 Oct 2025 04:40:13 GMT</pubDate>
            <atom:updated>2025-10-28T05:03:55.933Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p><a href="https://hub.optuna.org/samplers/auto_sampler/">AutoSampler</a> is an intelligent sampler that automatically selects an optimization algorithm implemented in Optuna for a given problem, enabling efficient optimization. As the most popular package on OptunaHub, it receives over 30,000 weekly downloads. The initial version of this feature, as stated in <a href="https://tech.preferred.jp/ja/blog/optuna-autosampler/">a blog post</a> published shortly after its release, implemented special automatic selection rules for single-objective optimization. However, for multi-objective optimization and constrained optimization, it defaulted to Optuna’s standard sampler, with full support for these problem settings designated as future work.</p><p>With the development of Optuna v4.6 (to be released next month), we have enhanced AutoSampler to fully support multi-objective and constrained optimization — a long-requested feature. This blog post will introduce these new enhancements, explain how to use them, and present benchmark results demonstrating their performance. (Note: The new AutoSampler is available now.)</p><h3>Enhanced Support for Multi-Objective &amp; Constrained Optimization</h3><p>The new AutoSampler builds upon its original design philosophy by automatically selecting the most suitable sampler for a given optimization problem. It analyzes factors such as the evaluation budget, search space, constraints, and the number of objectives to choose a sampler that empirically delivers results equal to or better than the default.</p><p>With this update, the selection rules now fully support multi-objective and constrained optimization. The logic automatically switches between several powerful samplers (see Figure 1):</p><ul><li>TPESampler: Best for complex search spaces involving categorical variables and conditional branching.</li><li>GPSampler: Ideal for continuous and integer search spaces, now with full multi-objective and constraint support.</li><li>NSGAIISampler &amp; NSGAIIISampler: Scalable choices for problems with a high number of evaluations (NSGA-II) or many objectives (NSGA-III).</li></ul><p>This significant enhancement was made possible by the full implementation of constraint and multi-objective support for GPSampler in <a href="https://github.com/optuna/optuna/releases">Optuna v4.2-v4.5</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbmzfI-r_Z5g045WOK62JQ.png" /><figcaption>Figure 1: AutoSampler finally fully supports constrained optimization and multi-objective optimization.</figcaption></figure><h3>How to Use AutoSampler</h3><p>Getting started with the latest <a href="https://hub.optuna.org/samplers/auto_sampler/">AutoSampler</a> is straightforward. Here’s how you can set it up and integrate it into your Optuna study.</p><p>First, make sure you have the necessary packages installed. You’ll need optuna version 4.5 or higher. You can install optuna, optunahub, and the AutoSampler’s dependencies with the following commands:</p><pre>pip install -U optuna optunahub<br>pip install -r https://hub.optuna.org/samplers/auto_sampler/requirements.txt</pre><p>Once the packages are installed, you simply load the &quot;samplers/auto_sampler” package using the <a href="https://optuna.github.io/optunahub/generated/optunahub.load_module.html#optunahub.load_module">optunahub.load_module</a> function, instantiate the AutoSampler included in the package, and use it just like any other Optuna sampler. Here is a runnable example for a multi-objective optimization problem:</p><pre>import optuna<br>import optunahub<br><br><br>def objective(trial: optuna.Trial) -&gt; tuple[float]:<br>    x = trial.suggest_float(&quot;x&quot;, 0, 5)<br>    y = trial.suggest_float(&quot;y&quot;, 0, 3)<br>    return  4 * x**2 + 4 * y**2, (x - 5)**2 + (y - 5)**2<br><br>study = optuna.create_study(<br>    directions=[&quot;minimize&quot;, &quot;minimize&quot;],<br>    sampler=optunahub.load_module(&quot;samplers/auto_sampler&quot;).AutoSampler()<br>)<br>study.optimize(objective, n_trials=300)<br><br>print(study.best_trials)</pre><p>If you’ve used AutoSampler before, your locally cached version might be outdated. To ensure you have the latest version, run load_module once with the force_reload=True flag.</p><pre>python<br>&gt;&gt;&gt; import optunahub; optunahub.load_module(&quot;samplers/auto_sampler&quot;, force_reload=True)</pre><h3>Performance Evaluation</h3><p>We evaluated the latest AutoSampler against Optuna’s default sampler in both multi-objective and constrained optimization scenarios. The results highlight the benefits of its intelligent, adaptive approach.</p><h4>Multi-Objective Optimization</h4><p>For our multi-objective benchmark, we used the widely recognized <a href="https://hub.optuna.org/benchmarks/wfg/">WFG1 problem</a>. As shown in Figure 2, the AutoSampler demonstrates superior search performance. Unlike the default sampler, which always uses the NSGA-II algorithm, AutoSampler dynamically switches between four powerful methods based on the problem’s characteristics (e.g., number of evaluations, objectives, and search space): GPSampler, TPESampler, NSGAIISampler, and NSGAIIISampler. This automatic selection allows it to find better solutions by adapting its strategy to the task at hand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OnO4_xe8qZMf80nMwkqirQ.png" /><figcaption>Figure 2: Experimental results for the WFG1 benchmark</figcaption></figure><h4>Constrained Optimization</h4><p>We also compared performance on constrained problems using the 5-dimensional Rotated Rastrigin function with three constraints in the <a href="https://hub.optuna.org/benchmarks/bbob_constrained/">bbob-constrained</a> benchmark set. As seen in Figure 3, the AutoSampler again outperforms the default.</p><p>Its advantage comes from new selection rules that incorporate the powerful, constraint-aware GPSampler (<a href="https://medium.com/optuna/optuna-v4-2-gaussian-process-based-sampler-can-now-handle-inequality-constraints-a4f68e8ee810">introduced in Optuna v4.2</a>). This enables it to navigate constrained search spaces much more effectively. Furthermore, for problems that are both constrained and multi-objective, it leverages the even newer <a href="https://github.com/optuna/optuna/releases/tag/v4.5.0">GPSampler enhancements from Optuna v4.5</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*HhxBI800ClHNc_VFAbGIfQ.png" /><figcaption>Figure 3: Benchmark results for the Rotated Rastrigin function</figcaption></figure><h3>Wrapping Up</h3><p>In this update, we’ve unveiled a significantly enhanced AutoSampler with full support for multi-objective and constrained optimization. By integrating AutoSampler into your workflow, you can achieve performance that is empirically equal to or better than the default sampler, all without the complex task of manually selecting the right algorithm. This powerful convenience allows you to focus on your problem while Optuna handles the optimization strategy.</p><p>This release fulfills a key milestone on our <a href="https://medium.com/optuna/optuna-v5-roadmap-ac7d6935a878">Optuna v5 roadmap</a>: “Feature upgrades for AutoSampler to enable multi-objective optimization and constrained optimization with automatic algorithm selection.” We are continuing to develop new features and enhance existing ones as we move closer to the official v5 release. We encourage you to take advantage of these new capabilities and stay tuned for more updates to come!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1c4fc957ba2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/optuna/autosampler-full-support-for-multi-objective-constrained-optimization-c1c4fc957ba2">AutoSampler: Full Support for Multi-Objective &amp; Constrained Optimization</a> was originally published in <a href="https://medium.com/optuna">Optuna</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OptunaHub Benchmarks: A New Feature to Use/Register Various Benchmark Problems]]></title>
            <link>https://medium.com/optuna/optunahub-benchmarks-a-new-feature-to-use-register-various-benchmark-problems-694401524ce0?source=rss-e68c0864db53------2</link>
            <guid isPermaLink="false">https://medium.com/p/694401524ce0</guid>
            <category><![CDATA[automl]]></category>
            <category><![CDATA[optunahub]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[optuna]]></category>
            <category><![CDATA[benchmark]]></category>
            <dc:creator><![CDATA[Yoshihiko Ozaki]]></dc:creator>
            <pubDate>Wed, 22 Jan 2025 05:13:17 GMT</pubDate>
            <atom:updated>2025-05-22T08:39:35.480Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Performance benchmarking is essential in both research and algorithm development because it enables direct comparisons of under-developing algorithms with some baseline algorithms to quantify the performance for idea verification purposes or to claim the superiority of the proposed method. Due to the diverse problem setups in the real world, there is also a wide variety of benchmark problems.</p><p>OptunaHub Benchmarks is a new feature added in the latest version v0.2.0 of <a href="https://medium.com/optuna/optunahub-a-feature-sharing-platform-for-optuna-now-available-in-official-release-4b99efe9934d">optunahub</a>, designed to facilitate convenient benchmarking. You can enjoy the following benefits from this feature:</p><ul><li>Usage of various benchmark problems through a unified API simply by switching package names.</li><li>A quick analysis of benchmark results using the <a href="https://optuna.readthedocs.io/en/stable/reference/visualization/index.html">optuna.visualization</a> module or <a href="https://github.com/optuna/optuna-dashboard">optuna-dashboard</a>.</li><li>Usage of the benchmark problems even from optimization frameworks other than Optuna through a general API.</li><li>Easy registration of new benchmark problems to OptunaHub.</li></ul><p>Below is an example code using OptunaHub Benchmarks. In this way, users can easily load benchmark functions, execute optimizations, and visualize results (for more practical examples, please refer to Appendix: Practical Benchmark Code Example).</p><pre>import optuna<br>import optunahub<br><br>bbob = optunahub.load_module(&quot;benchmarks/bbob&quot;)<br>sphere2d = bbob.Problem(function_id=1, dimension=2, instance_id=1)<br>study = optuna.create_study(sampler=optuna.samplers.TPESampler(seed=42), directions=sphere2d.directions)<br>study.optimize(sphere2d, n_trials=20)<br>optuna.visualization.plot_optimization_history(study).show()</pre><p>This article provides a detailed introduction to how to use OptunaHub Benchmarks.</p><h3>OptunaHub Benchmarks</h3><p>The primary roles of OptunaHub Benchmarks fall into the following categories:</p><ul><li>Utilizing benchmark problems published on OptunaHub</li><li>Registering benchmark problems to OptunaHub</li></ul><p>Using OptunaHub Benchmarks requires the latest version of optunahub, v0.2.0. Please ensure that you have installed or upgraded optunahub before trying the contents of this article.</p><pre>pip install optunahub==0.2.0 --upgrade</pre><h4>Utilization of Published Benchmark Problems</h4><p>We now explain the usage of benchmark problems using the sample code we provided earlier. Note that <a href="https://github.com/numbbo/coco-experiment">coco-experiment</a> is required to execute the sample code.</p><pre>pip install coco-experiment  # sample code&#39;s dependency</pre><p>OptunaHub Benchmarks is registered under the benchmark category of the optunahub-registrypackages. Therefore, like other package categories, they can be easily loaded using the <a href="https://optuna.github.io/optunahub/generated/optunahub.load_module.html#optunahub.load_module">load_module</a>function.</p><p>In line 4 of the sample code in the introduction, we have used<a href="https://hub.optuna.org/benchmarks/bbob/"> the </a><a href="https://hub.optuna.org/benchmarks/bbob/">&quot;benchmarks/bbob&quot; package</a> (hereafter referred to as the bbob package). The `bbob` (blackbox optimization benchmarking) package provides 24 benchmark functions widely used in the research community. It is a wrapper implementation for Optuna of the original <a href="https://github.com/numbbo/coco-experiment">COCO (COmparing Continuous Optimizers) experiment</a> library.</p><pre>bbob = optunahub.load_module(&quot;benchmarks/bbob&quot;)</pre><p>In line 5, the problem object for the 2-dimensional Sphere function is instantiated. Note that function_id=1 refers to the Sphere function in bbob.</p><pre>sphere2d = bbob.Problem(function_id=1, dimension=2, instance_id=1)</pre><p>In lines 6–7, a study is created and optimization is performed. The problem object is properly equipped with a directions attribute to inform us of the optimization direction and the __call__(trial) method, an objective function API for Optuna. They make our optimization script much simpler.</p><pre>study = optuna.create_study(sampler=optuna.samplers.TPESampler(seed=42), directions=sphere2d.directions)<br>study.optimize(sphere2d, n_trials=20)</pre><p>The bbob package from OptunaHub Benchmarks can halve user codes in comparison to directly using COCO to define Optuna’s objective function on your own, as can be seen in Figure 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L_i3x-nSzxwq9THD9ityyg.png" /><figcaption>Figure 1: Comparison of user code when using OptunaHub Benchmarks (left) vs. using COCO directly (right)</figcaption></figure><p>Figure 2 visualizes the 24 available benchmark functions in the bbob package. Users can easily switch between them by passing the corresponding function_id to Problem. Additionally, the dimensions and the location of the optimal solution can be changed via dimension and instance_id. For more details, please refer to <a href="https://hub.optuna.org/benchmarks/bbob/">the documentation of the </a><a href="https://hub.optuna.org/benchmarks/bbob/">bbob package</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_gRgmLEsSjteDpNom79KMQ.png" /><figcaption>Figure 2: 24 benchmark functions included in the Blackbox Optimization Benchmarking (BBOB) suite</figcaption></figure><p>In addition to the bbob package, OptunaHub Benchmarks currently includes <a href="https://hub.optuna.org/benchmarks/bbob_constrained/">bbob-constrained</a>, which contains 54 constrained optimization problems,<a href="https://hub.optuna.org/benchmarks/wfg/"> the WFG benchmark</a>, a widely-used test suite for multi-objective optimization, and <a href="https://hub.optuna.org/benchmarks/hpobench_nn/">HPOBench</a>, a collection of benchmark problems for hyperparameter optimization. These can also be used in the same way. Please feel free to try them out. Furthermore, we plan to continue expanding the available benchmarks in the future.</p><h4>Can We Use OptunaHub Benchmarks for Other Optimization Frameworks? (General API)</h4><p>The bbob.Problem class provides two APIs:</p><ul><li>__call__(trial), the Optuna-compatible API, and</li><li>evaluate(params), a more general API that takes a dictionary with keys of each variable name and their corresponding parameter values.</li></ul><p>Thanks to the general API, other optimization frameworks can easily ride on OptunaHub Benchmarks.</p><pre>sphere2d.evaluate({&quot;x0&quot;: 0, &quot;x1&quot;: 0})  # You can evaluate the objective function for the given dictionary.</pre><p>Here is an example of optimizing the 2-dimensional Sphere function using <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html">scipy.optimize.minimize</a> instead of Optuna. An objective function is prepared using a simple lambda expression, which internally calls the evaluate method. Furthermore, attributes provided by COCO, the original implementation in the BBOB, are also accessible from the bbob package’s Problem class. Here, for example, <a href="https://numbbo.github.io/coco-doc/apidocs/cocoex/cocoex.Problem.html">the </a><a href="https://numbbo.github.io/coco-doc/apidocs/cocoex/cocoex.Problem.html">i</a>nitial_solution<a href="https://numbbo.github.io/coco-doc/apidocs/cocoex/cocoex.Problem.html">, </a><a href="https://numbbo.github.io/coco-doc/apidocs/cocoex/cocoex.Problem.html">l</a>ower_bounds<a href="https://numbbo.github.io/coco-doc/apidocs/cocoex/cocoex.Problem.html">, and </a><a href="https://numbbo.github.io/coco-doc/apidocs/cocoex/cocoex.Problem.html">u</a>pper_bounds<a href="https://numbbo.github.io/coco-doc/apidocs/cocoex/cocoex.Problem.html"> properties</a> are used to obtain x0 and bounds, respectively.</p><pre>import scipy<br><br>result = scipy.optimize.minimize(<br>    fun=lambda x: sphere2d.evaluate({f&quot;x{d}&quot;: x[d] for d in range(sphere2d.dimension)}),<br>    x0=sphere2d.initial_solution,<br>    bounds=scipy.optimize.Bounds(<br>        lb=sphere2d.lower_bounds, ub=sphere2d.upper_bounds<br>    )<br>)</pre><h4>Registering Benchmark Problems to OptunaHub</h4><p>OptunaHub Benchmarks not only provides benchmark problems but also enables developers to publish their benchmark problems as new packages. Here, we will explain how to create and publish benchmark problems.</p><p>A new problem can be simply created by inheriting optunahub.benchmarks.BaseProblem and defining search_space, directions, and evaluate.</p><ul><li>search_space(self) -&gt; dict[str, optuna.distributions.BaseDistribution]: Implement a method that returns the search space consisting of variable names and distributions for the benchmark problem.</li><li>directions(self) -&gt; list[optuna.study.StudyDirection]: Implement a method that returns a list of optimization directions. If it’s a minimization problem, return [optuna.study.StudyDirection.MINIMIZE]. If it’s a maximization problem, return [optuna.study.StudyDirection.MAXIMIZE]. For multi-objective optimization problems, a list of the directions for each objective function must be returned.</li><li>evaluate(self, params: dict[str, float]) -&gt; float | Sequence[float]: Implement a method that takes a dictionary as an argument and returns the objective function values.</li></ul><p>Below is an example implementation of the 2-dimensional Sphere function.</p><pre>class Sphere2D(optunahub.benchmarks.BaseProblem):<br>    @property<br>    def search_space(self) -&gt; dict[str, optuna.distributions.BaseDistribution]:<br>        return {<br>            &quot;x0&quot;: optuna.distributions.FloatDistribution(low=-5, high=5),<br>            &quot;x1&quot;: optuna.distributions.FloatDistribution(low=-5, high=5),<br>        }<br><br>    @property<br>    def directions(self) -&gt; list[optuna.study.StudyDirection]:<br>        return [optuna.study.StudyDirection.MINIMIZE]<br><br>    def evaluate(self, params: dict[str, float]) -&gt; float:<br>        return params[&quot;x0&quot;]**2 + params[&quot;x1&quot;]**2</pre><p>The above implements the minimal components for creating an original problem, but you can add any additional properties or methods as desired. For example, you can make the dimension of the problem configurable by defining an additional argument in the __init__() method yourself (see SphereND in <a href="https://optuna.github.io/optunahub/generated/recipes/006_benchmarks_basic.html">the tutorial</a>). The previously mentioned bbob package is also implemented by inheriting optunahub.benchmarks.BaseProblem, so if you are interested, please look at <a href="https://github.com/optuna/optunahub-registry/blob/main/package/benchmarks/bbob/_bbob.py">the implementation</a>.</p><p>The benchmark problems you implement can be registered with OptunaHub by creating a pull request to <a href="https://github.com/optuna/optunahub-registry/">the optunahub-registry repository</a> as a package. For more details, please see the various tutorials available.</p><ul><li><a href="https://optuna.github.io/optunahub/generated/recipes/006_benchmarks_basic.html">How to Implement Your Benchmark Problems with OptunaHub (Basic)</a></li><li><a href="https://optuna.github.io/optunahub/generated/recipes/007_benchmarks_advanced.html">How to Implement Your Benchmark Problems with OptunaHub (Advanced: Conditional Parameters, Constrained Problems)</a></li><li><a href="https://optuna.github.io/optunahub/generated/recipes/002_registration.html">How to Register Your Package with OptunaHub</a></li></ul><h3>Conclusion</h3><p>In this article, we introduced OptunaHub Benchmarks, a new feature for benchmarks added in optunahub v0.2.0.</p><p>OptunaHub Benchmarks easily allows users to benchmark algorithms over various problems. Furthermore, OptunaHub Benchmarks is also convenient for preliminary experiments preceding real-world problems or for algorithm learning purposes. We hope OptunaHub Benchmarks makes your work more efficient.</p><p>Last but not least, we plan to expand the list of available benchmark packages, so we welcome any requests for specific benchmark problems or pull requests from benchmark developers to <a href="https://github.com/optuna/optunahub-registry/">the optunahub-registry</a>!</p><h3>Appendix: Practical Benchmark Code Example</h3><p>Here, we will introduce a more practical example of benchmark code, including visualization of results.</p><p>The experimental setups in this section are the following:</p><ul><li>Use 24 functions (function_id from 1 to 24) from BBOB.</li><li>Use function dimensionality of 2 (dimension=2) and instance ID of 1 (instance_id=1).</li><li>Compare TPESampler and CmaEsSampler.</li><li>Plot the mean and standard error of each sampler on each problem over 10 different random seeds.</li></ul><p>Here is the code to generate Figure 3:</p><pre>import itertools<br><br>import matplotlib.pyplot as plt<br>import numpy as np<br>import optuna<br>import optunahub<br>import pandas as pd<br><br><br>plt.rcParams[&quot;font.family&quot;] = &quot;Times New Roman&quot;<br>plt.rcParams[&quot;mathtext.fontset&quot;] = &quot;stix&quot;  # The math font setup.<br>plt.rcParams[&quot;text.usetex&quot;] = True<br>samplers = [optuna.samplers.TPESampler, optuna.samplers.CmaEsSampler]<br><br><br>def collect_results(<br>   dimension: int = 2, instance_id: int = 1, n_seeds: int = 10, n_trials: int = 100<br>) -&gt; pd.DataFrame:<br>   bbob = optunahub.load_module(&quot;benchmarks/bbob&quot;)<br>   results = []<br>   # Compare TPESampler and CmaEsSampler using BBOB 24 problems over 10 random seeds.<br>   for sampler_class, function_id, seed in itertools.product(<br>       *(samplers, range(1, 25), range(n_seeds))<br>   ):<br>       sampler = sampler_class(seed=seed)<br>       objective = bbob.Problem(function_id, dimension, instance_id)<br>       study = optuna.create_study(sampler=sampler, directions=objective.directions)<br>       study.optimize(objective, n_trials=n_trials)<br>       results.append(<br>           {<br>               &quot;sampler_name&quot;: sampler_class.__name__,<br>               &quot;seed&quot;: seed,<br>               &quot;function_id&quot;: function_id,<br>               &quot;values&quot;: np.minimum.accumulate([t.value for t in study.trials]),<br>           }<br>       )<br>   return pd.DataFrame(results)<br><br><br>def plot_results(df: pd.DataFrame, dimension: int = 2, instance_id: int = 1) -&gt; None:<br>   sampler_names = [sampler_class.__name__ for sampler_class in samplers]<br>   n_seeds = len(df[&quot;seed&quot;].unique())<br>   x_axis = np.arange(len(df[&quot;values&quot;].iloc[0])) + 1<br>   fig, axes = plt.subplots(4, 6, figsize=(20, 10), sharex=True, tight_layout=True)<br>   lines = [None] * len(sampler_names)<br>   for sampler_name, function_id in itertools.product(*(sampler_names, range(1, 25))):<br>       target_rows = df[(df[&quot;sampler_name&quot;] == sampler_name) &amp; (df[&quot;function_id&quot;] == function_id)]<br>       mean = np.mean([vs for vs in target_rows[&quot;values&quot;]], axis=0)<br>       sem = np.std([vs for vs in target_rows[&quot;values&quot;]], axis=0) / np.sqrt(n_seeds)<br><br>       ax = axes[(function_id - 1) // 6, (function_id - 1) % 6]<br>       ax.set_title(f&quot;{function_id=}&quot;)<br>       lines[sampler_names.index(sampler_name)], = ax.plot(x_axis, mean, label=sampler_name)<br>       ax.fill_between(x_axis, mean - sem, mean + sem, alpha=0.3)<br>       ax.grid(True)<br><br>   fig.suptitle(f&quot;{instance_id=} in {dimension}D&quot;, fontsize=20)<br>   fig.supxlabel(&quot;\# of Trials&quot;, fontsize=20)<br>   fig.supylabel(&quot;Objective&quot;, fontsize=20)<br>   fig.legend(handles=lines, labels=sampler_names, ncol=len(sampler_names), loc=&quot;upper right&quot;, fontsize=18)<br>   plt.show()<br><br><br>df = collect_results(n_seeds=10, n_trials=100)<br>plot_results(df)</pre><p>By running the code above, you can obtain a graph like Figure 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jp41-i6Zkms6S1y5ot87MA.png" /><figcaption>Figure 3: Benchmark results of TPESampler and CmaEsSampler using BBOB</figcaption></figure><p>Real-world applications may require some tweaks or adjustments in the visualization and additional detailed analyses such as problem-specific discussions and statistical tests. We hope this example will be helpful as a reference for applications in your projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=694401524ce0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/optuna/optunahub-benchmarks-a-new-feature-to-use-register-various-benchmark-problems-694401524ce0">OptunaHub Benchmarks: A New Feature to Use/Register Various Benchmark Problems</a> was originally published in <a href="https://medium.com/optuna">Optuna</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AutoSampler: Automatic Selection of Optimization Algorithms in Optuna]]></title>
            <link>https://medium.com/optuna/autosampler-automatic-selection-of-optimization-algorithms-in-optuna-1443875fd8f9?source=rss-e68c0864db53------2</link>
            <guid isPermaLink="false">https://medium.com/p/1443875fd8f9</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[hyperparameter-tuning]]></category>
            <category><![CDATA[automl]]></category>
            <category><![CDATA[optuna]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Yoshihiko Ozaki]]></dc:creator>
            <pubDate>Wed, 06 Nov 2024 06:26:37 GMT</pubDate>
            <atom:updated>2024-11-06T06:26:37.828Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p><a href="https://hub.optuna.org/samplers/auto_sampler/">AutoSampler</a> 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.</p><pre>study = optuna.create_study(<br>    sampler=optunahub.load_module(<br>        &quot;samplers/auto_sampler&quot;<br>    ).AutoSampler()  # Automatically selects an algorithm internally<br>)</pre><p>In this article, we introduce AutoSampler, released on OptunaHub on October 31st. We explain why different optimization algorithms are necessary depending on the problems to be solved and the design principles behind AutoSampler’s automatic algorithm selection rules. Then, we describe how to use AutoSampler and provide brief benchmark results.</p><h3>Why Algorithm Selection Is Needed</h3><p>There are various optimization problems, and new optimization algorithms are continually being proposed in academic research. There are several reasons behind this.</p><p>One of the biggest reasons is a wide variety of problem settings. Some involve both integer and continuous variables, some have multiple objectives, and others are limited by the number of evaluations. To deal with those problem settings effectively, researchers and practitioners are working on developing and improving optimization algorithms.</p><p>The Optuna documentation provides <a href="https://optuna.readthedocs.io/en/stable/reference/samplers/index.html">a sampler comparison table</a> to help Optuna users select an algorithm according to their problem settings (Table 1). By referring to this table, the users can easily find sampler candidates based on the support status for various problem settings and the maximum number of evaluations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KRmeyDSZfiOjy-rw0-OtUQ.png" /><figcaption>Table1: Sampler Comparison Table</figcaption></figure><p>Optuna offers various algorithms with different characteristics to deal effectively with various problems. Here is a simple example to show the difference between the algorithms. The left side of Figure 1 shows the results of minimizing a benchmark function (an 8-dimensional <a href="https://www.sfu.ca/~ssurjano/stybtang.html">Styblinski-Tang function</a>) using <a href="https://optuna.readthedocs.io/en/stable/reference/samplers/generated/optuna.samplers.GPSampler.html">GPSampler</a> and <a href="https://optuna.readthedocs.io/en/stable/reference/samplers/generated/optuna.samplers.CmaEsSampler.html">CmaEsSampler</a>. The right side of Figure 1 shows the results of running the same operation with half of the variables in the function (x4-x8) replaced with integer variables. There is not much difference in the former (CmaEsSampler performs slightly better in this example), but in the latter, GPSampler achieves significantly better results. This is because Optuna’s GPSampler is relatively better at handling integer variables than CmaEsSampler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LKPv5yBVhjDH7S6-QMy1Zw.png" /><figcaption>Figure 1: Preferable sampler may vary from problem to problem.</figcaption></figure><p>So, it is essential to use the appropriate algorithm for each problem. However, for users, understanding each algorithm’s working mechanisms, characteristics, strengths, and weaknesses, and making a proper selection is a difficult task that requires a high level of expertise and can be considered a heavy burden.</p><h3>AutoSampler</h3><p>This time, we have gone one step further than the sampler comparison table and developed AutoSampler. It enables users to solve problems well without spending time understanding and selecting samplers. AutoSampler is equipped with sampler selection rules designed to achieve the following two points and automatically and dynamically selects suitable samplers during optimization (Figure 2).</p><ol><li>Automatically selects a sampler that can appropriately handle problems with different settings by considering the number of evaluations, search space, constraints, and the number of objectives.</li><li>Automatically selects a sampler that empirically achieves equivalent or better search results than always using Optuna’s default sampler.</li></ol><p>Regarding the second point, we noticed a bias in the problems that Optuna users often encounter, particularly with hyperparameter optimization. Based on this experience, we tried to develop a better sampler selection rule instead of always using the default sampler.*¹</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qj3Vm1AjupbE3wIpoSK_gw.png" /><figcaption>Figure 2: Concept of AutoSampler</figcaption></figure><p>AutoSampler’s approach to automatic sampler selection involves the following.</p><ul><li>Using GPSampler during the early stages of a search, as it has excellent sample efficiency but is only applicable to a small number of evaluations.</li><li>Using TPESampler for problems with categorical variables, as it can handle these variables flexibly.</li></ul><p>AutoSampler also has elaborate schemes to improve performance when dynamically switching methods during optimization.</p><h4>How to Use AutoSampler</h4><p>It is very easy to use <a href="https://hub.optuna.org/samplers/auto_sampler/">the AutoSampler published on OptunaHub</a>.</p><p>First, install dependencies in your environment to use the package, including <a href="https://optuna.github.io/optunahub/">the optunahub library</a>.</p><pre>pip install optunahub<br>pip install -r https://hub.optuna.org/samplers/auto_sampler/requirements.txt</pre><p>After that, load the &quot;samplers/auto_sampler&quot; package using the <a href="https://optuna.github.io/optunahub/reference.html#optunahub.load_module">optunahub.load_module</a> function and instantiate AutoSampler included in the package. Below is a code example that can be run by copying and pasting.</p><pre>import optuna<br>import optunahub<br><br><br>def objective(trial: optuna.Trial) -&gt; float:<br>    x = trial.suggest_float(&quot;x&quot;, -1, 1)<br>    y = trial.suggest_float(&quot;y&quot;, -1, 1)<br><br>    return x**2 + y**2<br><br><br>study = optuna.create_study(sampler=optunahub.load_module(&quot;samplers/auto_sampler&quot;).AutoSampler())<br>study.optimize(objective, n_trials=300)<br><br>print(study.best_trial.value, study.best_trial.params)</pre><h4>Benchmarking</h4><p>To demonstrate the effectiveness of AutoSampler, we performed a simple comparative evaluation of search performance using benchmark functions. Figure 3 shows the optimization results for Mishra06(2), Hartmann6(6), and McCourt11(8) (the numbers in parentheses indicate the problem dimensions; implementation of the benchmark functions is <a href="https://github.com/sigopt/evalset/blob/main/evalset/test_funcs.py">available here</a>). In addition, for the two-dimensional function Mishra06(2), a landscape plot (upper right of Figure 3) that visualizes the contours of the function values is also shown. This plot’s vertical and horizontal axes correspond to the two variables, and the colors correspond to the objective function values. Darker areas indicate locations with good objective function values.</p><p>The results show that AutoSampler consistently achieves performance equal to or better than the default TPESampler, except for the very beginning of the search. First, looking at the gray dotted line for each figure, we confirm that AutoSampler with less than 100 trials found a better solution than the best solution by the default sampler with 1000 trials. Next, the narrowness of the filled band indicates that the search stability is higher than the default sampler.</p><p>Regarding the individual problem results, in Mishra06(2), both AutoSampler and TPESampler stopped improving the objective function value before reaching 400 trials. It seems both converged to some local minima. However, there is a significant difference in the final objective function value, i.e., the former can find a better solution on average. In Hartmann(6), there is no considerable difference in the final objective function value, but AutoSampler is significantly superior in terms of convergence speed. In McCourt11(8), both methods continued to improve the objective function value until the end, and the search did not converge, but the pace of improvement in the objective function value indicates that AutoSampler has superior search efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ifitQggOWl0ISOJesupY6Q.png" /><figcaption>Figure 3: Experimental results. The solid line indicates the average of five trials with different random seeds, and the filled area indicates ± standard error. The horizontal gray dotted line indicates the objective value of the best solution found by TPESampler. The scale value of the vertical gray line that intersects with the dotted line indicates the number of evaluations when AutoSampler achieved that objective value.</figcaption></figure><h3>Wrapping Up</h3><p>We introduced AutoSampler, which automatically selects the optimization algorithm for Optuna. This helpful feature allows users to empirically obtain performance equal to or better than the default sampler without bothering about which optimization algorithm to use. *² It is easy to use with just one modification line; please try it!</p><p>The first version of AutoSampler has room for improvement, such as falling back to the default in the case of multi-objective optimization and constrained optimization, and we plan to continue improving it in the future. We are actively seeking user feedback to improve AutoSampler. If you have any impressions or requests for improvements, <a href="https://github.com/optuna/optuna/discussions/5747">please post them in the relevant thread on Optuna Discussions</a>!</p><h3>Supplements</h3><p>*¹ According to <a href="https://en.wikipedia.org/wiki/No_free_lunch_in_search_and_optimization">the no-free-lunch theorem</a>, the average performance of all optimization algorithms across all problems in the universe is equal. Therefore, when discussing the superiority or inferiority of optimization algorithms, some assumptions about the target problems are required.</p><p>*² Some readers may wonder, “Why not make AutoSampler the default?” In software development, there are many things to consider besides optimization performance, and the default provides a good balance when considering all of these factors comprehensively. For example, AutoSampler depends on experimental features such as GPSampler and additional packages such as cmaes and torch, but the default does not have such dependencies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1443875fd8f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/optuna/autosampler-automatic-selection-of-optimization-algorithms-in-optuna-1443875fd8f9">AutoSampler: Automatic Selection of Optimization Algorithms in Optuna</a> was originally published in <a href="https://medium.com/optuna">Optuna</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OptunaHub, a Feature-Sharing Platform for Optuna, Now Available in Official Release!]]></title>
            <link>https://medium.com/optuna/optunahub-a-feature-sharing-platform-for-optuna-now-available-in-official-release-4b99efe9934d?source=rss-e68c0864db53------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b99efe9934d</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[automl]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[hyperparameter-tuning]]></category>
            <dc:creator><![CDATA[Yoshihiko Ozaki]]></dc:creator>
            <pubDate>Fri, 30 Aug 2024 02:24:33 GMT</pubDate>
            <atom:updated>2024-08-30T02:29:39.528Z</atom:updated>
            <content:encoded><![CDATA[<h3>TL;DR</h3><p>We are pleased to announce the official release of OptunaHub (<a href="https://hub.optuna.org/">https://hub.optuna.org/</a>), a feature-sharing platform for Optuna.</p><ul><li>OptunaHub now includes a variety of new algorithms, such as one proposed at this year’s top conference (e.g. <a href="https://hub.optuna.org/samplers/catcma/">CatCMA</a>) and one that won a competition (e.g. <a href="https://hub.optuna.org/samplers/hebo/">HEBO</a>).</li><li>Not only optimization algorithms, but also visualization algorithms for analysis can be available in OptunaHub.</li><li>You only need to search for the desired function on the OptunaHub website and call the <a href="https://optuna.github.io/optunahub/">optunahub.load_module</a> function in your code to incorporate it.</li></ul><h3>Introducing OptunaHub</h3><p>OptunaHub is a platform for sharing algorithms in Optuna, a powerful and flexible hyperparameter optimization framework. Since the beta version was released in July, the Optuna team has continued to improve the service with developers, receiving more than 10 contributions. Today, the official version of OptunaHub was released.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LqunGPY9gMzgxac1gf_mYw.png" /><figcaption>OptunaHub: A Feature-Sharing Platform for Optuna</figcaption></figure><p>Below, we will explain the values that OptunaHub provides to users from four perspectives.</p><h4>A wide range of optimization algorithms are available, from the latest to the well-known</h4><p>In OptunaHub, a wide range of optimization algorithms are available. In particular, state-of-the-art (SOTA) methods such as “<a href="https://hub.optuna.org/samplers/hebo/">HEBO</a>” and “<a href="https://hub.optuna.org/samplers/catcma/">CatCMA</a>”, which have only recently been proposed, can be easily used with the Optuna interface. Previously, in order to use such methods, users had to implement each algorithm themselves, but now, by using OptunaHub, anyone can easily try out these methods. Of course, the methods available on OptunaHub are not limited to the latest ones, and Optuna implementations of algorithms such as classical experimental design (<a href="https://hub.optuna.org/samplers/uniform_design/">UniformDesignSampler</a>) are also available.</p><h4>Providing packages specialized for specific domains and applications</h4><p>OptunaHub also has packages specialized for specific domains and applications. For example, algorithms specialized for materials and chemical domains (<a href="https://hub.optuna.org/samplers/bbo_rietveld/">BBO-Rietveld</a>) and algorithms specialized for merging large language models (<a href="https://hub.optuna.org/samplers/evo_merge/">EvoMergeSampler</a>) exist. These packages provide not only the Optuna implementation of optimization algorithms but also various utilities for solving the target problems, allowing users to solve problems with significantly less effort than if they were to implement all the mechanisms from scratch.</p><h4>Frequent feature updates</h4><p>In OptunaHub, feature additions are reflected in the platform as soon as the corresponding pull requests are merged. In just one month since the beta version was released, more than ten optimization algorithms and visualization functions have been added. If the feature you want has not yet been provided, <a href="https://github.com/optuna/optuna/discussions/5606">you can request it from contributors</a>. Frequent feature updates also allow quick feature improvements and bug fixes.</p><h4>Practical Visualization</h4><p>Finally, OptunaHub also provides <a href="https://hub.optuna.org/?q=Visualization">packages for users to visualize algorithm execution times and other metrics</a>, allowing users to better understand the optimization process, analyze optimization results, and refine algorithm choices.</p><p>As described above, OptunaHub offers many benefits as a platform for efficient problem solving through black-box optimization. Since anyone can use it easily, we highly recommend that you try OptunaHub.</p><h3>How to Use OptunaHub</h3><h4>Installation</h4><p>First, you need to install the optunahub Python library.</p><pre>pip install optunahub</pre><p>OptunaHub is now ready to use.</p><h4>Find optimization algorithms and visualization features on the website</h4><p>OptunaHub is a simple website that mainly consists of two types of pages. Here, we explain how to find and use packages.</p><p><strong>Search for packages on the top page</strong></p><p>When you access the top page, you will see a list of all the packages available in OptunaHub.</p><p>By entering an algorithm name or keyword in the text box, you can filter the results to only relevant packages. Each package has a thumbnail and a brief description, and you can click to view its details page.</p><p>The image below is an example of filtering packages with the keyword “Bayesian”. Only packages related to Bayesian optimization are displayed then.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tR357CBn8yOWd3n8q5Qdw.png" /><figcaption>OptunaHub: Package Search</figcaption></figure><p><strong>Learn how to use the package on the details page</strong></p><p>The details page provides detailed explanations and usage of each algorithm and visualization function, including how to install dependent libraries and sample code.</p><p>By referring to the sample code, you can learn how to actually use the algorithm. For example, the CatCMA Sampler details page below has sample code in the Example section. You can also try out the sample code in Google Colab from your browser by pressing the Open in Colab button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1u1wX4ao0gu5rkQteyRLGA.png" /><figcaption>OptunaHub: Package Details</figcaption></figure><p>In <a href="https://colab.research.google.com/github/optuna/optunahub-registry/blob/main/package/samplers/catcma/example.ipynb">this Google Colab notebook</a>, you can execute the sample code for CatCmaSampler, from setting up the environment to defining the objective function, running the optimization, and visualizing the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PBiURLZXVqNa9Q3D3ksAOA.png" /><figcaption>Google Colab Notebook for CatCmaSampler</figcaption></figure><p>Here, we will introduce a simple example of using the OptunaHub library and CatCmaSampler. The following sample code loads CatCmaSampler and optimizes a simple quadratic function that includes a categorical variable.</p><pre>import optuna<br>import optunahub<br><br>def objective(trial: optuna.Trial) -&gt; float:<br>    x1 = trial.suggest_float(&quot;x1&quot;, -10, 10)<br>    x2 = trial.suggest_float(&quot;x2&quot;, -10, 10)<br>    c = trial.suggest_categorical(&quot;c&quot;, [-5, 0, 5])<br>    return x1**2 + x2**2 + c<br><br>mod = optunahub.load_module(&quot;samplers/catcma&quot;)<br>study = optuna.create_study(sampler=mod.CatCmaSampler())<br>study.optimize(objective, n_trials=20)</pre><p>The important thing to note is optunahub.load_module(&quot;samplers/catcma&quot;). load_module is a function that downloads and loads the desired module (here, “samplers/catcma”) from OptunaHub. This allows you to use CatCmaSampler. The remaining optimization steps are the same as when using Optuna’s built-in sampler.</p><p>Now, you are ready to try applying OptunaHub’s algorithms and visualizations to your problems!</p><p><em>Tips: Reload Packages</em></p><p>Packages loaded with OptunaHub are cached locally. Therefore, packages are downloaded only the first time, and from the second time onwards they are loaded from the cache. Package caching has the advantage of speeding up subsequent loads and allowing offline use. If there is an update to a package, you can get the latest version by setting the force_reload option of optunahub.load_moduleto True.</p><pre>mod = optunahub.load_module(&quot;samplers/catcma&quot;, force_reload=True)</pre><h3>Wrapping Up</h3><p>We believe that the official release of OptunaHub is valuable for everyone passionate about black-box optimization. We are confident that this platform will benefit the community and continue evolving. We hope you will use <a href="https://hub.optuna.org/">OptunaHub</a> and explore the black-box optimization world!</p><h4>For potential contributors interested in registering OptunaHub packages</h4><p>In this article, we have introduced how to use packages in OptunaHub. Developers can also register packages they have created in OptunaHub and make them available to users. In last month’s <a href="https://medium.com/optuna/announcing-optunahub-0-1-0-%CE%B2-69b35bb3e95e">OptunaHub 0.1.0-β release blog</a>, we introduced how to register packages in OptunaHub, so if you are interested in registering your package with the platform, please take a look!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b99efe9934d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/optuna/optunahub-a-feature-sharing-platform-for-optuna-now-available-in-official-release-4b99efe9934d">OptunaHub, a Feature-Sharing Platform for Optuna, Now Available in Official Release!</a> was originally published in <a href="https://medium.com/optuna">Optuna</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing OptunaHub 0.1.0-β]]></title>
            <link>https://medium.com/optuna/announcing-optunahub-0-1-0-%CE%B2-69b35bb3e95e?source=rss-e68c0864db53------2</link>
            <guid isPermaLink="false">https://medium.com/p/69b35bb3e95e</guid>
            <category><![CDATA[optunahub]]></category>
            <category><![CDATA[hyperparameter-tuning]]></category>
            <category><![CDATA[blackbox-optimization]]></category>
            <category><![CDATA[optuna]]></category>
            <category><![CDATA[automl]]></category>
            <dc:creator><![CDATA[Yoshihiko Ozaki]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 06:31:33 GMT</pubDate>
            <atom:updated>2025-05-22T08:41:52.668Z</atom:updated>
            <content:encoded><![CDATA[<h3>TL;DR</h3><ul><li><a href="https://hub.optuna.org/">OptunaHub</a> is a platform for sharing features developed by contributors around the world for Optuna. Anyone can easily use and register features!</li><li>Using optunahub.load_module, you can employ arbitrary algorithms in the platform. Try it on <a href="https://colab.research.google.com/github/optuna/optunahub-registry/blob/main/package/samplers/simulated_annealing/example.ipynb">Google Colab</a>!</li><li>We are actively seeking feature registration in OptunaHub; <a href="https://optuna.github.io/optunahub/index.html">please register</a>!</li></ul><h3>Introduction</h3><p><a href="https://optuna.org/">Optuna</a> is one of the most popular OSS for black-box optimization in the world today. It has over 2 million downloads per month, more than 10,000 stars on GitHub, and is used in over 15,000 software projects.</p><p>Today, the Optuna team released the beta version of <a href="https://hub.optuna.org/">OptunaHub</a>, the feature-sharing platform for Optuna. OptunaHub collects features that can be freely used by Optuna users, and all researchers and developers can register the features they implement. The beta version of OptunaHub is now ready to accept contributions from all over the world. This article introduces you to OputunaHub and explains how to register your features in OptunaHub.</p><h3>OptunaHub</h3><p>OptunaHub is a platform for sharing features developed for Optuna by contributors worldwide. Researchers and developers of black-box optimization can register their developed features in OptunaHub, and users can easily use these features with the same interface as the features in Optuna. As of July 2024, OptunaHub supports the registration and use of algorithms such as Sampler and Pruner, as well as visualization functions.</p><p>When you access the top page of OptunaHub (<a href="https://hub.optuna.org/">https://hub.optuna.org/</a>), a list of registered packages is displayed (Figure 1). Packages are Python modules containing features implemented for Optuna. Here, you can search for packages that provide desired features using keywords and tags. By clicking on the name of the package, you can move to the details page and check how to use and examples of the package (Figure 2).</p><figure><img alt="Figure 1: OptunaHub top page" src="https://cdn-images-1.medium.com/max/1024/1*ikSOah04qWqwkGXr2rhJpg.png" /><figcaption>Figure 1: OptunaHub top page</figcaption></figure><figure><img alt="Figure 2: Example of detail page" src="https://cdn-images-1.medium.com/max/1024/1*6CY47GHWWqO4UuSTPCFfHA.png" /><figcaption>Figure 2: Example of details page</figcaption></figure><p>To use a package on OptunaHub, first install the <a href="https://github.com/optuna/optunahub">optunahub</a> library.</p><pre>pip install optunahub</pre><p>You can load the module by passing the package name to the optunahub.load_module function provided by the library. The package name is in the form of category/user_defined_name, which can be checked in the Package column on the details page. Then, just like in Optuna itself, you can use the desired function implemented in the module (in this example, <a href="https://hub.optuna.org/samplers/simulated_annealing/">SimulatedAnnealingSampler</a>).</p><p>Try the below example on <a href="https://colab.research.google.com/github/optuna/optunahub-registry/blob/main/package/samplers/simulated_annealing/example.ipynb">Google Colab</a>.</p><pre>import optuna<br>import optunahub<br><br><br>def objective(trial: optuna.Trial) -&gt; float:<br>    x = trial.suggest_float(&quot;x&quot;, 0, 1)<br><br>    return x<br><br><br>if __name__ == &quot;__main__&quot;:<br>    mod = optunahub.load_module(&quot;samplers/simulated_annealing&quot;)<br><br>    sampler = mod.SimulatedAnnealingSampler()<br>    study = optuna.create_study(sampler=sampler)<br>    study.optimize(objective, n_trials=20)<br><br>    print(study.best_trial.value, study.best_trial.params)</pre><p>For more detailed information on the optunahub library, please check <a href="https://optuna.github.io/optunahub/">the official documentation</a>.</p><h3>Registering Your Package with OptunaHub</h3><p>All packages in OptunaHub are managed in a repository called <a href="https://github.com/optuna/optunahub-registry">optunahub-registry</a>. Under the package directory of this repository, there are directories corresponding to categories such as Sampler, Pruner, and Visualization, and individual packages are placed in each. For example, the entity of the Simulated Annealing Sampler package used in the previous example is <a href="https://github.com/optuna/optunahub-registry/tree/main/package/samplers/simulated_annealing">optunahub-registry/package/samplers/simulated_annealing</a>.</p><p>To register a new package in OptunaHub, fork the optunahub-registry repository, implement a package with a structure like the following including algorithm, README, and license (note: optional elements are omitted), and create a pull request to the optunahub-registry repository.</p><pre>package<br>  └── category (e.g. samplers, pruners, and visualization)<br>    └── YOUR_PACKAGE_NAME (you need to create this directory and its contents)<br>      ├── README.md<br>      ├── LICENSE<br>      ├── __init__.py<br>      └── YOUR_ALGORITHM_NAME.py</pre><p>When a pull request is created, the Optuna team conducts a simple check and merges it immediately. The code review in optunahub-registry checks for format deficiencies and security threats, among other simple matters. After the pull request is merged, the corresponding package will be displayed on the OptunaHub website within about 1 hour. <a href="https://optuna.github.io/optunahub/tutorials_for_contributors.html">The official tutorial</a> explains the package registration process in more detail.</p><p>OptunaHub is actively accepting registrations of recently published cutting-edge methods and methods specialized for specific applications, which were difficult to support officially in Optuna. For example, the <a href="https://hub.optuna.org/samplers/evo_merge/">Evolutionary LLM Merge Sampler</a> package (Figure 3) provides an implementation of the merger method for large language models proposed in <a href="https://arxiv.org/abs/2403.13187">a paper</a> published in 2024.</p><figure><img alt="Figure 3: Evolutionary LLM Merge Sampler" src="https://cdn-images-1.medium.com/max/1024/1*KsflZyHjyrV6m6wu2Lj5kw.png" /><figcaption>Figure 3: Evolutionary LLM Merge Sampler</figcaption></figure><p>OptunaHub is looking forward to your contributions.</p><h3>Wrapping Up</h3><p>With the release of the beta version of OptunaHub, we have introduced OptunaHub and explained how to register features in OptunaHub. We are committed to broadly contributing to problem-solving by black-box optimization and developing the research and development community through OSS development. We look forward to your continued support.</p><p>Access OptunaHub<br><a href="https://hub.optuna.org/">https://hub.optuna.org/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69b35bb3e95e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/optuna/announcing-optunahub-0-1-0-%CE%B2-69b35bb3e95e">Announcing OptunaHub 0.1.0-β</a> was originally published in <a href="https://medium.com/optuna">Optuna</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>