Skip to content

Commit

Permalink
Merge pull request optuna#5514 from 47aamir/master
Browse files Browse the repository at this point in the history
replaced single trailing underscore with double trailing underscore in .rst files
  • Loading branch information
y0z authored Jun 25, 2024
2 parents ca489a0 + 177277f commit c75b6c2
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
28 changes: 14 additions & 14 deletions docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Can I use Optuna with X? (where X is your favorite ML library)
--------------------------------------------------------------

Optuna is compatible with most ML libraries, and it's easy to use Optuna with those.
Please refer to `examples <https://github.com/optuna/optuna-examples/>`_.
Please refer to `examples <https://github.com/optuna/optuna-examples/>`__.


.. _objective-func-additional-args:
Expand Down Expand Up @@ -63,7 +63,7 @@ Below is an example that uses ``lambda``:
study = optuna.create_study()
study.optimize(lambda trial: objective(trial, min_x, max_x), n_trials=100)
Please also refer to `sklearn_additional_args.py <https://github.com/optuna/optuna-examples/tree/main/sklearn/sklearn_additional_args.py>`_ example,
Please also refer to `sklearn_additional_args.py <https://github.com/optuna/optuna-examples/tree/main/sklearn/sklearn_additional_args.py>`__ example,
which reuses the dataset instead of loading it in each trial execution.


Expand Down Expand Up @@ -116,7 +116,7 @@ And to resume the study:
Note that Optuna does not support saving/reloading across different Optuna
versions with ``pickle``. To save/reload a study across different Optuna versions,
please use RDBs and `upgrade storage schema <reference/cli.html#storage-upgrade>`_
please use RDBs and `upgrade storage schema <reference/cli.html#storage-upgrade>`__
if necessary. If you are using RDBs, see :ref:`rdb` for more details.

How to suppress log messages of Optuna?
Expand Down Expand Up @@ -274,7 +274,7 @@ If your optimization target supports GPU (CUDA) acceleration and you want to spe
$ export CUDA_VISIBLE_DEVICES=1
$ python main.py
Please refer to `CUDA C Programming Guide <https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars>`_ for further details.
Please refer to `CUDA C Programming Guide <https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars>`__ for further details.


How can I test my objective functions?
Expand Down Expand Up @@ -382,7 +382,7 @@ How do I suggest variables which represent the proportion, that is, are in accor

When you want to suggest :math:`n` variables which represent the proportion, that is, :math:`p[0], p[1], ..., p[n-1]` which satisfy :math:`0 \le p[k] \le 1` for any :math:`k` and :math:`p[0] + p[1] + ... + p[n-1] = 1`, try the below.
For example, these variables can be used as weights when interpolating the loss functions.
These variables are in accordance with the flat `Dirichlet distribution <https://en.wikipedia.org/wiki/Dirichlet_distribution>`_.
These variables are in accordance with the flat `Dirichlet distribution <https://en.wikipedia.org/wiki/Dirichlet_distribution>`__.

.. code-block:: python
Expand Down Expand Up @@ -433,7 +433,7 @@ You can verify the transformation by calculating the elements of the Jacobian.
How can I optimize a model with some constraints?
-------------------------------------------------

When you want to optimize a model with constraints, you can use the following classes: :class:`~optuna.samplers.TPESampler`, :class:`~optuna.samplers.NSGAIISampler` or `BoTorchSampler <https://optuna-integration.readthedocs.io/en/stable/reference/generated/optuna_integration.BoTorchSampler.html>`_.
When you want to optimize a model with constraints, you can use the following classes: :class:`~optuna.samplers.TPESampler`, :class:`~optuna.samplers.NSGAIISampler` or `BoTorchSampler <https://optuna-integration.readthedocs.io/en/stable/reference/generated/optuna_integration.BoTorchSampler.html>`__.
The following example is a benchmark of Binh and Korn function, a multi-objective optimization, with constraints using :class:`~optuna.samplers.NSGAIISampler`. This one has two constraints :math:`c_0 = (x-5)^2 + y^2 - 25 \le 0` and :math:`c_1 = -(x - 8)^2 - (y + 3)^2 + 7.7 \le 0` and finds the optimal solution satisfying these constraints.


Expand Down Expand Up @@ -488,7 +488,7 @@ The following example is a benchmark of Binh and Korn function, a multi-objectiv
)
print(" Params: {}".format(trial.params))
If you are interested in an example for `BoTorchSampler <https://optuna-integration.readthedocs.io/en/stable/reference/generated/optuna_integration.BoTorchSampler.html>`_, please refer to `this sample code <https://github.com/optuna/optuna-examples/blob/main/multi_objective/botorch_simple.py>`_.
If you are interested in an example for `BoTorchSampler <https://optuna-integration.readthedocs.io/en/stable/reference/generated/optuna_integration.BoTorchSampler.html>`__, please refer to `this sample code <https://github.com/optuna/optuna-examples/blob/main/multi_objective/botorch_simple.py>`__.


There are two kinds of constrained optimizations, one with soft constraints and the other with hard constraints.
Expand Down Expand Up @@ -541,12 +541,12 @@ How can I solve the error that occurs when performing parallel optimization with

We would never recommend SQLite3 for parallel optimization in the following reasons.

- To concurrently evaluate trials enqueued by :func:`~optuna.study.Study.enqueue_trial`, :class:`~optuna.storages.RDBStorage` uses `SELECT ... FOR UPDATE` syntax, which is unsupported in `SQLite3 <https://github.com/sqlalchemy/sqlalchemy/blob/rel_1_4_41/lib/sqlalchemy/dialects/sqlite/base.py#L1265-L1267>`_.
- As described in `the SQLAlchemy's documentation <https://docs.sqlalchemy.org/en/14/dialects/sqlite.html#sqlite-concurrency>`_,
- To concurrently evaluate trials enqueued by :func:`~optuna.study.Study.enqueue_trial`, :class:`~optuna.storages.RDBStorage` uses `SELECT ... FOR UPDATE` syntax, which is unsupported in `SQLite3 <https://github.com/sqlalchemy/sqlalchemy/blob/rel_1_4_41/lib/sqlalchemy/dialects/sqlite/base.py#L1265-L1267>`__.
- As described in `the SQLAlchemy's documentation <https://docs.sqlalchemy.org/en/14/dialects/sqlite.html#sqlite-concurrency>`__,
SQLite3 (and pysqlite driver) does not support a high level of concurrency.
You may get a "database is locked" error, which occurs when one thread or process has an exclusive lock on a database connection (in reality a file handle) and another thread times out waiting for the lock to be released.
You can increase the default `timeout <https://docs.python.org/3/library/sqlite3.html#sqlite3.connect>`_ value like `optuna.storages.RDBStorage("sqlite:///example.db", engine_kwargs={"connect_args": {"timeout": 20.0}})` though.
- For distributed optimization via NFS, SQLite3 does not work as described at `FAQ section of sqlite.org <https://www.sqlite.org/faq.html#q5>`_.
You can increase the default `timeout <https://docs.python.org/3/library/sqlite3.html#sqlite3.connect>`__ value like `optuna.storages.RDBStorage("sqlite:///example.db", engine_kwargs={"connect_args": {"timeout": 20.0}})` though.
- For distributed optimization via NFS, SQLite3 does not work as described at `FAQ section of sqlite.org <https://www.sqlite.org/faq.html#q5>`__.

If you want to use a file-based Optuna storage for these scenarios, please consider using :class:`~optuna.storages.JournalFileStorage` instead.

Expand All @@ -559,7 +559,7 @@ If you want to use a file-based Optuna storage for these scenarios, please consi
study = optuna.create_study(storage=storage)
...
See `the Medium blog post <https://medium.com/optuna/distributed-optimization-via-nfs-using-optunas-new-operation-based-logging-storage-9815f9c3f932>`_ for details.
See `the Medium blog post <https://medium.com/optuna/distributed-optimization-via-nfs-using-optunas-new-operation-based-logging-storage-9815f9c3f932>`__ for details.

.. _heartbeat_monitoring:

Expand All @@ -572,7 +572,7 @@ Can I monitor trials and make them failed automatically when they are killed une

A process running a trial could be killed unexpectedly, typically by a job scheduler in a cluster environment.
If trials are killed unexpectedly, they will be left on the storage with their states `RUNNING` until we remove them or update their state manually.
For such a case, Optuna supports monitoring trials using `heartbeat <https://en.wikipedia.org/wiki/Heartbeat_(computing)>`_ mechanism.
For such a case, Optuna supports monitoring trials using `heartbeat <https://en.wikipedia.org/wiki/Heartbeat_(computing)>`__ mechanism.
Using heartbeat, if a process running a trial is killed unexpectedly,
Optuna will automatically change the state of the trial that was running on that process to :obj:`~optuna.trial.TrialState.FAIL`
from :obj:`~optuna.trial.TrialState.RUNNING`.
Expand Down Expand Up @@ -622,7 +622,7 @@ How can I deal with permutation as a parameter?

Although it is not straightforward to deal with combinatorial search spaces like permutations with existing API, there exists a convenient technique for handling them.
It involves re-parametrization of permutation search space of :math:`n` items as an independent :math:`n`-dimensional integer search space.
This technique is based on the concept of `Lehmer code <https://en.wikipedia.org/wiki/Lehmer_code>`_.
This technique is based on the concept of `Lehmer code <https://en.wikipedia.org/wiki/Lehmer_code>`__.

A Lehmer code of a sequence is the sequence of integers in the same size, whose :math:`i`-th entry denotes how many inversions the :math:`i`-th entry of the permutation has after itself.
In other words, the :math:`i`-th entry of the Lehmer code represents the number of entries that are located after and are smaller than the :math:`i`-th entry of the original sequence.
Expand Down
6 changes: 3 additions & 3 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ optimization *studies*.
Web Dashboard
-------------

`Optuna Dashboard <https://github.com/optuna/optuna-dashboard>`_ is a real-time web dashboard for Optuna.
`Optuna Dashboard <https://github.com/optuna/optuna-dashboard>`__ is a real-time web dashboard for Optuna.
You can check the optimization history, hyperparameter importance, etc. in graphs and tables.
You don't need to create a Python script to call `Optuna's visualization <https://optuna.readthedocs.io/en/stable/reference/visualization/index.html>`_ functions.
You don't need to create a Python script to call `Optuna's visualization <https://optuna.readthedocs.io/en/stable/reference/visualization/index.html>`__ functions.
Feature requests and bug reports are welcome!

.. image:: https://user-images.githubusercontent.com/5564044/204975098-95c2cb8c-0fb5-4388-abc4-da32f56cb4e5.gif
Expand All @@ -97,7 +97,7 @@ Feature requests and bug reports are welcome!
.. TIP::

Please check out the `getting started <https://optuna-dashboard.readthedocs.io/en/latest/getting-started.html>`_ section of Optuna Dashboard's official documentation.
Please check out the `getting started <https://optuna-dashboard.readthedocs.io/en/latest/getting-started.html>`__ section of Optuna Dashboard's official documentation.

Communication
-------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/importance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The :mod:`~optuna.importance` module provides functionality for evaluating hyper
.. note::

:class:`~optuna.importance.FanovaImportanceEvaluator` takes over 1 minute when given a study that contains 1000+ trials.
We published `optuna-fast-fanova <https://github.com/optuna/optuna-fast-fanova>`_ library,
We published `optuna-fast-fanova <https://github.com/optuna/optuna-fast-fanova>`__ library,
that is a Cython accelerated fANOVA implementation. By using it, you can get hyperparameter
importances within a few seconds.
If ``n_trials`` is more than 10000, the Cython implementation takes more than a minute, so you can use :class:`~optuna.importance.PedAnovaImportanceEvaluator` instead, enabling the evaluation to finish in a second.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/reference/integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ The :mod:`~optuna.integration` module contains classes used to integrate Optuna

.. note::
Optuna's integration modules for third-party libraries have started migrating from Optuna itself to a package called
`optuna-integration`. Please check the `repository <https://github.com/optuna/optuna-integration>`_ and
the `documentation <https://optuna-integration.readthedocs.io/en/latest/index.html>`_.
`optuna-integration`. Please check the `repository <https://github.com/optuna/optuna-integration>`__ and
the `documentation <https://optuna-integration.readthedocs.io/en/latest/index.html>`__.

For most of the ML frameworks supported by Optuna, the corresponding Optuna integration class serves only to implement a callback object and functions, compliant with the framework's specific callback API, to be called with each intermediate step in the model training. The functionality implemented in these callbacks across the different ML frameworks includes:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/samplers/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The :mod:`~optuna.samplers` module defines a base class for parameter sampling a

For distributed optimization, see :ref:`distributed` tutorial. Note that the ``constant_liar`` option of :class:`~optuna.samplers.TPESampler` allows :class:`~optuna.samplers.TPESampler` to handle the distributed optimization.

For constrained optimization, see an `example <https://github.com/optuna/optuna-examples/blob/main/multi_objective/botorch_simple.py>`_.
For constrained optimization, see an `example <https://github.com/optuna/optuna-examples/blob/main/multi_objective/botorch_simple.py>`__.

.. autosummary::
:toctree: generated/
Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/terminator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ The :mod:`~optuna.terminator` module implements a mechanism for automatically te
optuna.terminator.TerminatorCallback
optuna.terminator.report_cross_validation_scores

For an example of using this module, please refer to `this example <https://github.com/optuna/optuna-examples/tree/main/terminator>`_.
For an example of using this module, please refer to `this example <https://github.com/optuna/optuna-examples/tree/main/terminator>`__.
2 changes: 1 addition & 1 deletion docs/source/reference/visualization/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The :mod:`~optuna.visualization` module provides utility functions for plotting
render them by default. Please follow this `installation guide`_ to show figures in
`JupyterLab`_.
.. note::
The :func:`~optuna.visualization.plot_param_importances` requires the Python package of `scikit-learn <https://github.com/scikit-learn/scikit-learn>`_.
The :func:`~optuna.visualization.plot_param_importances` requires the Python package of `scikit-learn <https://github.com/scikit-learn/scikit-learn>`__.

.. _JupyterLab: https://github.com/jupyterlab/jupyterlab
.. _installation guide: https://github.com/plotly/plotly.py#jupyterlab-support
Expand Down
6 changes: 3 additions & 3 deletions docs/source/tutorial/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If you are new to Optuna or want a general introduction, we highly recommend the
Key Features
------------

Showcases Optuna's `Key Features <https://github.com/optuna/optuna/blob/master/README.md#key-features>`_.
Showcases Optuna's `Key Features <https://github.com/optuna/optuna/blob/master/README.md#key-features>`__.

1. :doc:`10_key_features/001_first`
2. :doc:`10_key_features/002_configurations`
Expand All @@ -41,12 +41,12 @@ Showcases the recipes that might help you using Optuna with comfort.
- :doc:`20_recipes/009_ask_and_tell`
- :doc:`20_recipes/010_reuse_best_trial`
- :doc:`20_recipes/011_journal_storage`
- `Human-in-the-loop Optimization with Optuna Dashboard <https://optuna-dashboard.readthedocs.io/en/latest/tutorials/hitl.html>`_
- `Human-in-the-loop Optimization with Optuna Dashboard <https://optuna-dashboard.readthedocs.io/en/latest/tutorials/hitl.html>`__
- :doc:`20_recipes/012_artifact_tutorial`
- :doc:`20_recipes/013_wilcoxon_pruner`

.. only:: html

.. rst-class:: sphx-glr-signature

`Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
`Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`__
2 changes: 1 addition & 1 deletion tutorial/10_key_features/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Key Features
------------

Showcases Optuna's `Key Features <https://github.com/optuna/optuna/blob/master/README.md#key-features>`_.
Showcases Optuna's `Key Features <https://github.com/optuna/optuna/blob/master/README.md#key-features>`__.

0 comments on commit c75b6c2

Please sign in to comment.