diff --git a/Makefile b/Makefile index 3201dccc..85e6d056 100644 --- a/Makefile +++ b/Makefile @@ -20,4 +20,4 @@ requirements: python -m poetry export -f requirements.txt --output requirements-dev.txt --without-hashes --with dev docs: - make -C docs html + mkdocs serve diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d4bb2cbb..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index d35736d9..00000000 --- a/docs/conf.py +++ /dev/null @@ -1,80 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -import os -import sys - -sys.path.insert(0, os.path.abspath('../')) - -import sphinx_rtd_theme - -# -- Project information ----------------------------------------------------- - -project = 'pytorch-optimizer' -copyright = '2021, kozistr' -author = 'kozistr' - -# The full version, including alpha/beta/rc tags -release = '2.11.2' - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'sphinx_rtd_theme', - 'sphinx.ext.autodoc', - 'sphinx.ext.napoleon', - 'sphinx.ext.doctest', - 'sphinx.ext.todo', - 'sphinx.ext.coverage', - 'sphinx.ext.mathjax', - 'sphinx.ext.ifconfig', - 'sphinx.ext.viewcode', - 'sphinx.ext.intersphinx', -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'sphinx_rtd_theme' - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -html_theme_options = { - 'analytics_anonymize_ip': False, - 'logo_only': False, - 'display_version': True, - 'prev_next_buttons_location': 'bottom', - 'style_external_links': False, - 'vcs_pageview_mode': '', - 'style_nav_header_background': 'white', - # Toc options - 'collapse_navigation': True, - 'sticky_navigation': True, - 'navigation_depth': 4, - 'includehidden': True, - 'titles_only': False, -} diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..15fc3ee7 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,9 @@ +# Welcome to pytorch-optimizer + +[optimizer docs](optimizer) + +[lr_scheduler docs](lr_scheduler) + +[loss docs](loss) + +[util docs](util) diff --git a/docs/loss.md b/docs/loss.md new file mode 100644 index 00000000..a8569a4d --- /dev/null +++ b/docs/loss.md @@ -0,0 +1 @@ +# Loss \ No newline at end of file diff --git a/docs/lr_scheduler.md b/docs/lr_scheduler.md new file mode 100644 index 00000000..7c113fc8 --- /dev/null +++ b/docs/lr_scheduler.md @@ -0,0 +1 @@ +# Learning Rate Scheduler diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 8084272b..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/optimizer.md b/docs/optimizer.md new file mode 100644 index 00000000..a1fd554f --- /dev/null +++ b/docs/optimizer.md @@ -0,0 +1,13 @@ +# Optimizers + +::: pytorch_optimizer.A2Grad + :docstring: + :members: + +::: pytorch_optimizer.AdaBelief + :docstring: + :members: + +::: pytorch_optimizer.AdaBound + :docstring: + :members: diff --git a/docs/requirements.txt b/docs/requirements.txt index 7754e8ee..83a6db42 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -4,3 +4,6 @@ numpy torch==2.0.1 mkdocs==1.5.2 mkdocs-material==9.2.8 +pymdown-extensions==10.3 +mkdocstrings-python==1.6.2 +markdown-include==0.8.1 diff --git a/docs/util.md b/docs/util.md new file mode 100644 index 00000000..9795412f --- /dev/null +++ b/docs/util.md @@ -0,0 +1 @@ +# Util diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..442581b6 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,33 @@ +site_name: pytorch-optimizer +theme: + name: material + highlightjs: true +plugins: + - search + - mkdocstrings: + handlers: + python: + options: + show_root_heading: true + show_root_full_path: false + show_root_members_full_path: false + show_symbol_type_toc: true + allow_inspection: true + show_bases: true + show_source: true + docstring_style: sphinx +markdown_extensions: + - admonition + - pymdownx.critic + - pymdownx.caret + - pymdownx.keys + - pymdownx.mark + - pymdownx.tilde + - pymdownx.arithmatex: + generic: true + - markdown_include.include: + base_path: . + +extra_javascript: + - https://polyfill.io/v3/polyfill.min.js?features=es6 + - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js