Skip to content

Commit 913b69e

Browse files
authored
Add structure and pages to sphinx (neuralmagic#27)
* Add structure and pages to sphinx doc generation * update links * small fixes * small fixes * update copyright for rst files * update sphinx dev dep
1 parent 7df8d20 commit 913b69e

16 files changed

+580
-110
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*.rst
1+
/docs/source/api/*.rst
22

33
# Created by https://www.toptal.com/developers/gitignore/api/windows,macos,linux,python,react,pycharm,emacs,vim,visualstudio,visualstudiocode
44
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,macos,linux,python,react,pycharm,emacs,vim,visualstudio,visualstudiocode

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BUILDDIR := $(PWD)
44
PYCHECKDIRS := examples tests src utils scripts notebooks
55
PYCHECKGLOBS := 'examples/**/*.py' 'scripts/**/*.py' 'src/**/*.py' 'tests/**/*.py' 'utils/**/*.py' setup.py
66
DOCDIR := docs
7-
MDCHECKGLOBS := 'docs/**/*.md' 'examples/**/*.md' 'notebooks/**/*.md' 'scripts/**/*.md'
7+
MDCHECKGLOBS := 'docs/**/*.md' 'docs/**/*.rst' 'examples/**/*.md' 'notebooks/**/*.md' 'scripts/**/*.md'
88
MDCHECKFILES := CODE_OF_CONDUCT.md CONTRIBUTING.md DEVELOPING.md README.md
99

1010
# run checks on all files for the repo
@@ -31,7 +31,7 @@ test:
3131

3232
# create docs
3333
docs:
34-
sphinx-apidoc -o "$(DOCDIR)/source/" src/sparsezoo;
34+
sphinx-apidoc -o "$(DOCDIR)/source/api" src/sparsezoo;
3535
cd $(DOCDIR) && $(MAKE) html;
3636

3737
# creates wheel file

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ sparsezoo download --domain cv --sub-domain classification \
194194

195195
For a more in-depth read, check out [SparseZoo documentation](https://docs.neuralmagic.com/sparsezoo/).
196196

197-
### Installation
197+
## Installation
198198

199199
This repository is tested on Python 3.6+, and Linux/Debian systems.
200200
It is recommended to install in a [virtual environment](https://docs.python.org/3/library/venv.html) to keep your system in order.

docs/available-models.md

-56
This file was deleted.
File renamed without changes.

docs/source/conf.py

+35-27
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818

1919
# -- Project information -----------------------------------------------------
2020

21-
project = "sparsezoo"
22-
copyright = "2020, Neural Magic"
21+
project = "Sparse Zoo"
22+
copyright = (
23+
"Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved. "
24+
'Licensed under the Apache License, Version 2.0 (the "License")'
25+
)
2326
author = "Neural Magic"
2427

2528
# The full version, including alpha/beta/rc tags
26-
version = ""
29+
version = "0.1"
2730
release = "0.1.0"
2831

2932

@@ -34,12 +37,17 @@
3437
# ones.
3538
extensions = [
3639
"sphinx.ext.autodoc",
37-
"sphinx.ext.intersphinx",
40+
"sphinx.ext.coverage",
41+
"sphinx.ext.extlinks",
42+
"sphinx.ext.githubpages",
3843
"sphinx.ext.ifconfig",
44+
"sphinx.ext.intersphinx",
45+
"sphinx.ext.napoleon",
3946
"sphinx.ext.viewcode",
40-
"sphinx.ext.githubpages",
41-
"rinoh.frontend.sphinx",
47+
"sphinx_copybutton",
48+
"sphinx_markdown_tables",
4249
"sphinx_rtd_theme",
50+
"recommonmark",
4351
]
4452

4553
# Add any paths that contain templates here, relative to this directory.
@@ -48,11 +56,11 @@
4856
# The suffix(es) of source filenames.
4957
# You can specify multiple suffix as a list of string:
5058
#
51-
# source_suffix = ['.rst', '.md']
52-
source_suffix = ".rst"
59+
source_suffix = [".rst", ".md"]
60+
# source_suffix = ".rst"
5361

5462
# The master toctree document.
55-
master_doc = "sparsezoo"
63+
master_doc = "index"
5664

5765
# The language for content autogenerated by Sphinx. Refer to documentation
5866
# for a list of supported languages.
@@ -76,6 +84,7 @@
7684
# a list of builtin themes.
7785
#
7886
html_theme = "sphinx_rtd_theme"
87+
html_logo = "icon-sparsezoo.png"
7988

8089
# Add any paths that contain custom static files (such as style sheets) here,
8190
# relative to this directory. They are copied after the builtin static files,
@@ -92,39 +101,35 @@
92101
#
93102
# html_sidebars = {}
94103

104+
html_favicon = "favicon.ico"
105+
95106
# -- Options for HTMLHelp output ---------------------------------------------
96107

97108
# Output file base name for HTML help builder.
98-
htmlhelp_basename = "neuralmagicMLdoc"
109+
htmlhelp_basename = "sparsezoodoc"
99110

100111

101112
# -- Options for LaTeX output ------------------------------------------------
102113

103114
latex_elements = {
104-
"papersize": "letterpaper",
105-
"pointsize": "10pt",
106-
"preamble": "",
107-
"figure_align": "htbp",
115+
# "papersize": "letterpaper",
116+
# "pointsize": "10pt",
117+
# "preamble": "",
118+
# "figure_align": "htbp",
108119
}
109120

110121
# Grouping the document tree into LaTeX files. List of tuples
111122
# (source start file, target name, title,
112123
# author, documentclass [howto, manual, or own class]).
113124
latex_documents = [
114-
(
115-
master_doc,
116-
"SparseZoo_API.tex",
117-
"Sparse Zoo API",
118-
"Neural Magic",
119-
"manual",
120-
),
125+
(master_doc, "sparsezoo.tex", "Sparse Zoo Documentation", [author], "manual",),
121126
]
122127

123128
# -- Options for manual page output ------------------------------------------
124129

125130
# One entry per manual page. List of tuples
126131
# (source start file, name, description, authors, manual section).
127-
man_pages = [(master_doc, "sparsezooapi", "Sparse Zoo API Documentation", [author], 1)]
132+
man_pages = [(master_doc, "sparsezoo", "Sparse Zoo Documentation", [author], 1)]
128133

129134

130135
# -- Options for Texinfo output ----------------------------------------------
@@ -135,11 +140,14 @@
135140
texinfo_documents = [
136141
(
137142
master_doc,
138-
"",
139-
"Sparse Zoo API Documentation",
143+
"sparsezoo",
144+
"Sparse Zoo Documentation",
140145
author,
141-
"SparseZoo_API",
142-
"API implementations designed for Sparse Zoo.",
146+
"sparsezoo",
147+
(
148+
"Neural network model repository for highly sparse "
149+
"models and optimization recipes"
150+
),
143151
"Miscellaneous",
144152
),
145153
]
@@ -163,7 +171,7 @@
163171
# epub_uid = ''
164172

165173
# A list of files that should not be packed into the epub file.
166-
epub_exclude_files = ["search.html"]
174+
epub_exclude_files = []
167175

168176

169177
# -- Extension configuration -------------------------------------------------

docs/source/favicon.ico

15 KB
Binary file not shown.
File renamed without changes.

docs/source/index.rst

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
..
2+
Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing,
11+
software distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
===================
17+
SparseZoo |version|
18+
===================
19+
20+
Neural network model repository for highly sparse models and optimization recipes.
21+
22+
.. raw:: html
23+
24+
<div style="margin-bottom:16px;">
25+
<a href="https://github.com/neuralmagic/sparsezoo/blob/master/LICENSE">
26+
<img alt="GitHub" src="https://img.shields.io/github/license/neuralmagic/sparsezoo.svg?color=purple&style=for-the-badge" height=25 style="margin-bottom:4px;">
27+
</a>
28+
<a href="https://docs.neuralmagic.com/sparsezoo/index.html">
29+
<img alt="Documentation" src="https://img.shields.io/website/http/neuralmagic.com/sparsezoo/index.html.svg?down_color=red&down_message=offline&up_message=online&style=for-the-badge" height=25 style="margin-bottom:4px;">
30+
</a>
31+
<a href="https://github.com/neuralmagic/sparsezoo/releases">
32+
<img alt="GitHub release" src="https://img.shields.io/github/release/neuralmagic/sparsezoo.svg?style=for-the-badge" height=25 style="margin-bottom:4px;">
33+
</a>
34+
<a href="https://github.com/neuralmagic.com/sparsezoo/blob/master/CODE_OF_CONDUCT.md">
35+
<img alt="Contributor Covenant" src="https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?color=yellow&style=for-the-badge" height=25 style="margin-bottom:4px;">
36+
</a>
37+
<a href="https://www.youtube.com/channel/UCo8dO_WMGYbWCRnj_Dxr4EA">
38+
<img src="https://img.shields.io/badge/-YouTube-red?&style=for-the-badge&logo=youtube&logoColor=white" height=25 style="margin-bottom:4px;">
39+
</a>
40+
<a href="https://medium.com/limitlessai">
41+
<img src="https://img.shields.io/badge/medium-%2312100E.svg?&style=for-the-badge&logo=medium&logoColor=white" height=25 style="margin-bottom:4px;">
42+
</a>
43+
<a href="https://twitter.com/neuralmagic">
44+
<img src="https://img.shields.io/twitter/follow/neuralmagic?color=darkgreen&label=Follow&style=social" height=25 style="margin-bottom:4px;">
45+
</a>
46+
</div>
47+
48+
Overview
49+
========
50+
51+
SparseZoo is a constantly-growing repository of optimized models and optimization recipes for neural networks.
52+
It simplifies and accelerates your time-to-value in building performant deep learning models with a
53+
collection of inference-optimized models and recipes to prototype from.
54+
55+
Available via API and hosted in the cloud, the SparseZoo contains both baseline and models optimized
56+
to different degrees of inference performance vs baseline loss recovery.
57+
Optimizations on neural networks include approaches such as
58+
`pruning <https://neuralmagic.com/blog/pruning-overview />`_ and `quantization <https://arxiv.org/abs/1609.07061 />`_
59+
allowing for significantly faster models with limited to no effect on their baseline metrics such as accuracy.
60+
Recipe-driven approaches built around these optimizations allow you to take the models as given,
61+
transfer learn from the models onto private datasets, or transfer the recipes to your architectures.
62+
63+
This repository contains the Python API code to handle the connection and authentication to the cloud.
64+
65+
Related Products
66+
================
67+
68+
- `DeepSparse <https://github.com/neuralmagic/deepsparse />`_:
69+
CPU inference engine that delivers unprecedented performance for sparse models
70+
- `SparseML <https://github.com/neuralmagic/sparseml />`_:
71+
Libraries for state-of-the-art deep neural network optimization algorithms,
72+
enabling simple pipelines integration with a few lines of code
73+
- `Sparsify <https://github.com/neuralmagic/sparsify />`_:
74+
Easy-to-use autoML interface to optimize deep neural networks for
75+
better inference performance and a smaller footprint
76+
77+
Resources and Learning More
78+
===========================
79+
80+
- `SparseZoo Documentation <https://docs.neuralmagic.com/sparsezoo/ />`_
81+
- `SparseML Documentation <https://docs.neuralmagic.com/sparseml/ />`_
82+
- `Sparsify Documentation <https://docs.neuralmagic.com/sparsify/ />`_
83+
- `DeepSparse Documentation <https://docs.neuralmagic.com/deepsparse/ />`_
84+
- `Neural Magic Blog <https://www.neuralmagic.com/blog/ />`_,
85+
`Resources <https://www.neuralmagic.com/resources/ />`_,
86+
`Website <https://www.neuralmagic.com/ />`_
87+
88+
Release History
89+
===============
90+
91+
Official builds are hosted on PyPi
92+
- stable: `sparsezoo <https://pypi.org/project/sparsezoo/ />`_
93+
- nightly (dev): `sparsezoo-nightly <https://pypi.org/project/sparsezoo-nightly/ />`_
94+
95+
Additionally, more information can be found via
96+
`GitHub Releases <https://github.com/neuralmagic/sparsezoo/releases />`_.
97+
98+
.. toctree::
99+
:maxdepth: 3
100+
:caption: General
101+
102+
quicktour
103+
installation
104+
models
105+
recipes
106+
107+
.. toctree::
108+
:maxdepth: 2
109+
:caption: API
110+
111+
api/sparsezoo

docs/source/installation.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!--
2+
Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing,
11+
software distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
### Installation
18+
19+
This repository is tested on Python 3.6+, and Linux/Debian systems.
20+
It is recommended to install in a [virtual environment](https://docs.python.org/3/library/venv.html)
21+
to keep your system in order.
22+
23+
Install with pip using:
24+
25+
```bash
26+
pip install sparsezoo
27+
```
28+
29+
Then if you would like to explore any of the [scripts](https://github.com/neuralmagic/sparsezoo/tree/main/scripts),
30+
[notebooks](https://github.com/neuralmagic/sparsezoo/tree/main/notebooks),
31+
or [examples](https://github.com/neuralmagic/sparsezoo/tree/main/examples)
32+
clone the repository and install any additional dependencies as required.

0 commit comments

Comments
 (0)