Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tune] Improve user guides and API docs #7716

Merged
merged 10 commits into from
Apr 6, 2020
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
AUTOGALLERYDIR= source/auto_examples
AUTOGALLERYDIR= source/auto_examples source/tune/generated_guides

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
1 change: 1 addition & 0 deletions doc/examples/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:orphan:
25 changes: 13 additions & 12 deletions doc/examples/overview.rst
Original file line number Diff line number Diff line change
@@ -4,6 +4,19 @@ Ray Tutorials and Examples
Get started with Ray, Tune, and RLlib with these notebooks that you can run online in CoLab or Binder:
* `Ray Tutorial Notebooks <https://github.com/ray-project/tutorial>`__

.. toctree::
:hidden:

plot_parameter_server.rst
plot_example-a3c.rst
plot_hyperparameter.rst
plot_pong_example.rst
plot_lbfgs.rst
plot_newsreader.rst
plot_streaming.rst
plot_example-lm.rst


Example Gallery
---------------

@@ -42,15 +55,3 @@ Example Gallery
.. customgalleryitem::
:tooltip: Distributed Fault-Tolerant BERT training for FAIRSeq using Ray.
:description: :doc:`/auto_examples/plot_example-lm`

.. toctree::
:hidden:

plot_parameter_server.rst
plot_example-a3c.rst
plot_hyperparameter.rst
plot_pong_example.rst
plot_lbfgs.rst
plot_newsreader.rst
plot_streaming.rst
plot_example-lm.rst
4 changes: 4 additions & 0 deletions doc/source/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -14,3 +14,7 @@
color: #2980B9;
text-transform: uppercase
}

.rst-content .section ol p, .rst-content .section ul p {
margin-bottom: 0px;
}
6 changes: 3 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -66,8 +66,9 @@
]

sphinx_gallery_conf = {
"examples_dirs": ["../examples"], # path to example scripts
"gallery_dirs": ["auto_examples"], # path where to save generated examples
"examples_dirs": ["../examples", "tune/guides"], # path to example scripts
# path where to save generated examples
"gallery_dirs": ["auto_examples", "tune/generated_guides"],
"ignore_pattern": "../examples/doc_code/",
"plot_gallery": "False",
# "filename_pattern": "tutorial.py",
@@ -138,7 +139,6 @@
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns += sphinx_gallery_conf['examples_dirs']
exclude_patterns += ["*/README.rst"]

# The reST default role (used for this markup: `text`) to use for all
# documents.
8 changes: 4 additions & 4 deletions doc/source/custom_directives.py
Original file line number Diff line number Diff line change
@@ -11,16 +11,14 @@
except NameError:
FileNotFoundError = IOError

# This is not a top level item in the directory, so we use `../` to refer
# to images located at the top level.
GALLERY_TEMPLATE = """
.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="{tooltip}">

.. only:: html

.. figure:: ../{thumbnail}
.. figure:: {thumbnail}

{description}

@@ -78,9 +76,11 @@ def run(self):
os.makedirs(thumb_dir, exist_ok=True)
image_path = os.path.join(thumb_dir, os.path.basename(figname))
sphinx_gallery.gen_rst.scale_image(figname, image_path, 400, 280)

thumbnail = os.path.relpath(image_path, env.srcdir)
# https://stackoverflow.com/questions/52138336/sphinx-reference-to-an-image-from-different-locations
thumbnail = "/" + thumbnail
else:
# "/" is the top level srcdir
thumbnail = "/_static/img/thumbnails/default.png"

if "description" in self.options:
Binary file added doc/source/images/tune-pbt-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
4 changes: 1 addition & 3 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -248,10 +248,8 @@ Getting Involved
:caption: Tune

tune.rst
tune-tutorial.rst
tune-advanced-tutorial.rst
Tune Guides and Tutorials <tune/generated_guides/overview.rst>
tune-usage.rst
tune-distributed.rst
tune-schedulers.rst
tune-searchalg.rst
tune-examples.rst
5 changes: 4 additions & 1 deletion doc/source/tune-schedulers.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _tune-schedulers:

Tune Trial Schedulers
=====================

@@ -15,6 +17,7 @@ Current Available Trial Schedulers:
:local:
:backlinks: none

.. _tune-scheduler-pbt:

Population Based Training (PBT)
-------------------------------
@@ -31,7 +34,7 @@ Tune includes a distributed implementation of `Population Based Training (PBT) <
hyperparam_mutations={
"lr": [1e-3, 5e-4, 1e-4, 5e-5, 1e-5],
"alpha": lambda: random.uniform(0.0, 1.0),
...
...
})
tune.run( ... , scheduler=pbt_scheduler)

2 changes: 2 additions & 0 deletions doc/source/tune-searchalg.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _tune-search-alg:

Tune Search Algorithms
======================

Loading