Repository: optuna/optuna

Issue:
Rewrite numerical formulas in documentation by using MathJax.
To improve readability, we would like to rewrite numerical formulas in documentation by using MathJax.


Discussion:
Would you mind my working on this?
@crcrpar Please go for it!

Resolving patch:
diff --git a/optuna/pruners/successive_halving.py b/optuna/pruners/successive_halving.py
--- a/optuna/pruners/successive_halving.py
+++ b/optuna/pruners/successive_halving.py
@@ -19,7 +19,7 @@ class SuccessiveHalvingPruner(BasePruner):
     `Asynchronous Successive Halving <http://arxiv.org/abs/1810.05934>`_ for detailed descriptions.
 
     Note that, this class does not take care of the parameter for the maximum
-    resource, referred to as ``R`` in the paper. The maximum resource allocated to a trial is
+    resource, referred to as :math:`R` in the paper. The maximum resource allocated to a trial is
     typically limited inside the objective function (e.g., ``step`` number in `simple.py
     <https://github.com/pfnet/optuna/tree/c5777b3e/examples/pruning/simple.py#L31>`_,
     ``EPOCH`` number in `chainer_integration.py
@@ -44,27 +44,33 @@ class SuccessiveHalvingPruner(BasePruner):
         min_resource:
             A parameter for specifying the minimum resource allocated to a trial
             (in the `paper <http://arxiv.org/abs/1810.05934>`_ this parameter is
-            referred to as ``r``).
+            referred to as :math:`r`).
 
             A trial is never pruned until it executes
-            ``min_resource * (reduction_factor ** min_early_stopping_rate)`` steps
-            (i.e., the completion point of the first rung). When the trial completes the first
-            rung, it will be promoted to the next rung only if the value of the trial is placed in
-            the top ``1/reduction_factor`` fraction of the all trials that already have reached
-            the point (otherwise it will be pruned there). If the trial won
-            the competition, it runs until the next completion point
-            (i.e., ``min_resource * (reduction_factor ** (min_early_stopping_rate + rung))`` steps)
+            :math:`\\mathsf{min}\\_\\mathsf{resource} \\times
+            \\mathsf{reduction}\\_\\mathsf{factor}^{
+            \\mathsf{min}\\_\\mathsf{early}\\_\\mathsf{stopping}\\_\\mathsf{rate}}`
+            steps (i.e., the completion point of the first rung). When the trial completes
+            the first rung, it will be promoted to the next rung only
+            if the value of the trial is placed in the top
+            :math:`{1 \\over \\mathsf{reduction}\\_\\mathsf{factor}}` fraction of
+            the all trials that already have reached the point (otherwise it will be pruned there).
+            If the trial won the competition, it runs until the next completion point (i.e.,
+            :math:`\\mathsf{min}\\_\\mathsf{resource} \\times
+            \\mathsf{reduction}\\_\\mathsf{factor}^{
+            (\\mathsf{min}\\_\\mathsf{early}\\_\\mathsf{stopping}\\_\\mathsf{rate}
+            + \\mathsf{rung})}` steps)
             and repeats the same procedure.
         reduction_factor:
             A parameter for specifying reduction factor of promotable trials
             (in the `paper <http://arxiv.org/abs/1810.05934>`_ this parameter is
-            referred to as ``eta``).
-            At the completion point of each rung, about ``1/reduction_factor`` trials
-            will be promoted.
+            referred to as :math:`\\eta`).  At the completion point of each rung,
+            about :math:`{1 \\over \\mathsf{reduction}\\_\\mathsf{factor}}`
+            trials will be promoted.
         min_early_stopping_rate:
             A parameter for specifying the minimum early-stopping rate
             (in the `paper <http://arxiv.org/abs/1810.05934>`_ this parameter is
-            referred to as ``s``).
+            referred to as :math:`s`).
     """
 
     def __init__(self, min_resource=1, reduction_factor=4, min_early_stopping_rate=0):
diff --git a/optuna/trial.py b/optuna/trial.py
--- a/optuna/trial.py
+++ b/optuna/trial.py
@@ -121,7 +121,8 @@ def suggest_uniform(self, name, low, high):
         # type: (str, float, float) -> float
         """Suggest a value for the continuous parameter.
 
-        The value is sampled from the range ``[low, high)`` in the linear domain.
+        The value is sampled from the range :math:`[\\mathsf{low}, \\mathsf{high})`
+        in the linear domain.
 
         Example:
 
@@ -153,7 +154,8 @@ def suggest_loguniform(self, name, low, high):
         # type: (str, float, float) -> float
         """Suggest a value for the continuous parameter.
 
-        The value is sampled from the range ``[low, high)`` in the log domain.
+        The value is sampled from the range :math:`[\\mathsf{low}, \\mathsf{high})`
+        in the log domain.
 
         Example:
 
@@ -187,10 +189,13 @@ def suggest_discrete_uniform(self, name, low, high, q):
         # type: (str, float, float, float) -> float
         """Suggest a value for the discrete parameter.
 
-        The value is sampled from the range ``[low, high]``, and the step of discretization is
-        ``q``. More specifically, this method returns one of the values in the sequence ``low,
-        low + q, low + 2 * q, ..., low + k * q <= high``, where `k`` denotes an integer. Note that
-        ``high`` may be excluded from ranges due to round-off errors if ``q`` is not an integer.
+        The value is sampled from the range :math:`[\\mathsf{low}, \\mathsf{high}]`,
+        and the step of discretization is :math:`q`. More specifically,
+        this method returns one of the values in the sequence
+        :math:`\\mathsf{low}, \\mathsf{low} + q, \\mathsf{low} + 2 q, \\dots,
+        \\mathsf{low} + k q \\le \\mathsf{high}`,
+        where :math:`k` denotes an integer. Note that :math:`high` may be
+        excluded from ranges due to round-off errors if :math:`q` is not an integer.
 
         Example:
 
@@ -234,7 +239,7 @@ def suggest_int(self, name, low, high):
         # type: (str, int, int) -> int
         """Suggest a value for the integer parameter.
 
-        The value is sampled from the integers in ``[low, high]``.
+        The value is sampled from the integers in :math:`[\\mathsf{low}, \\mathsf{high}]`.
 
         Example:
 


Test patch: