Skip to content

Commit bf5859f

Browse files
committed
Add documentation
1 parent c54dd3c commit bf5859f

20 files changed

+357
-65
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ var/
2222
*.egg-info/
2323
.installed.cfg
2424
*.egg
25+
26+
# Sphix
27+
_build/

README.md

Lines changed: 4 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<p align="center">
2-
<img src="images/tensornet.png" alt="tensornet" />
2+
<img src="images/tensornet_logo.png" alt="tensornet" />
33
<br />
44
<br />
55
<img src="https://img.shields.io/badge/version-0.9.1-blue.svg" alt="Version">
6+
<a href='https://tensornet.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/tensornet/badge/?version=latest' alt='Documentation Status' /></a>
67
<a href="https://github.com/shan18/TensorNet/blob/master/LICENSE"><img src="https://img.shields.io/apm/l/atomic-design-ui.svg?" alt="MIT License"></a>
78
<br />
89
</p>
910

1011
TensorNet is a high-level deep learning library built on top of PyTorch.
1112

12-
NOTE: This documentation applies to the MASTER version of TensorNet only.
13-
1413
## Installation
1514

1615
You can use pip to install tensornet
@@ -25,55 +24,9 @@ If you want to get the latest version of the code before it is released on PyPI
2524
pip install git+https://github.com/shan18/TensorNet.git#egg=torch-tensornet
2625
```
2726

28-
## Features
29-
30-
TensorNet currently supports the following features
27+
## Documentation
3128

32-
- Model architectures
33-
- ResNet18
34-
- Model utilities
35-
- Loss functions
36-
- Cross Entropy Loss
37-
- Binary Cross Entropy Loss
38-
- Mean Square Error Loss
39-
- SSIM and MS-SSIM Loss
40-
- Dice Loss
41-
- Evaluation Metrics
42-
- Accuracy
43-
- RMSE
44-
- MAE
45-
- ABS_REL
46-
- Optimizers
47-
- Stochastic Gradient Descent
48-
- Regularizers
49-
- L1 regularization
50-
- L2 regularization
51-
- LR Schedulers
52-
- Step LR
53-
- Reduce LR on Plateau
54-
- One Cycle Policy
55-
- LR Range Test
56-
- Model Checkpointing
57-
- Tensorboard
58-
- Model training and validation
59-
- Datasets (data is is returned via data loaders)
60-
- MNIST
61-
- CIFAR10
62-
- TinyImageNet
63-
- MODEST Museum Dataset
64-
- Data Augmentation
65-
- Resize
66-
- Padding
67-
- Random Crop
68-
- Horizontal Flip
69-
- Vertical Flip
70-
- Gaussian Blur
71-
- Random Rotation
72-
- CutOut
73-
- GradCAM and GradCAM++ (Gradient-weighted Class Activation Map)
74-
- Result Analysis Tools
75-
- Plotting changes in validation accuracy and loss during model training
76-
- Displaying correct and incorrect predictions of a trained model
29+
Documentation is available at: https://tensornet.readthedocs.io/en/latest/
7730

7831
## How to Use
7932

@@ -91,20 +44,6 @@ TensorNet has the following third-party dependencies
9144
- albumentations
9245
- opencv-python
9346

94-
## Documentation
95-
96-
Documentation making for the library is currently in progress. So until a documentation is available please refer to the following table for various functionalities and their corresponding module names.
97-
98-
| Functionality | Module Name |
99-
| ------------------------------------- | ----------- |
100-
| Learner, Callbacks and Tensorboard | engine |
101-
| Dataset downloading and preprocessing | data |
102-
| GradCAM and GradCAM++ | gradcam |
103-
| Models, loss functions and optimizers | models |
104-
| CUDA setup and result analysis | utils |
105-
106-
For a demo on how to use these modules, refer to the notebooks present in the [examples](https://github.com/shan18/TensorNet/tree/master/examples) directory.
107-
10847
## Contact/Getting Help
10948

11049
If you need any help or want to report a bug, raise an issue in the repo.

docs/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -b coverage

docs/_static/favicon.png

4.25 KB
Loading

docs/conf.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Configuration file for TensorNet documentation builder.
2+
3+
import os
4+
import re
5+
import sys
6+
sys.path.insert(0, os.path.abspath('.'))
7+
sys.path.insert(0, os.path.abspath('../'))
8+
9+
10+
def get_version():
11+
with open(
12+
os.path.join(
13+
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
14+
'tensornet',
15+
'__init__.py'
16+
)
17+
) as f:
18+
return re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', f.read(), re.M).group(1)
19+
20+
21+
def skip(app, what, name, obj, would_skip, options):
22+
if name == "__call__":
23+
return False
24+
return would_skip
25+
26+
27+
def setup(app):
28+
app.connect("autodoc-skip-member", skip)
29+
30+
31+
# -- Project information -----------------------------------------------------
32+
33+
project = 'torch-tensornet'
34+
copyright = '2020, Shantanu Acharya'
35+
author = 'Shantanu Acharya'
36+
37+
version = get_version()
38+
release = version
39+
40+
41+
# -- General configuration ---------------------------------------------------
42+
43+
44+
# Custom configurations
45+
# add_module_names = False
46+
autodoc_member_order = 'bysource'
47+
48+
extensions = [
49+
'sphinx.ext.napoleon',
50+
'sphinx.ext.autodoc',
51+
'sphinx.ext.viewcode',
52+
'sphinx.ext.coverage',
53+
]
54+
55+
# Add any paths that contain templates here, relative to this directory.
56+
templates_path = ['_templates']
57+
58+
# The suffix(es) of source filenames.
59+
source_suffix = '.rst'
60+
61+
# The master toctree document.
62+
master_doc = 'index'
63+
64+
# List of patterns, relative to source directory, that match files and
65+
# directories to ignore when looking for source files.
66+
# This pattern also affects html_static_path and html_extra_path.
67+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
68+
69+
# The name of the Pygments (syntax highlighting) style to use.
70+
pygments_style = 'sphinx'
71+
72+
73+
# -- Options for HTML output -------------------------------------------------
74+
75+
# The theme to use for HTML and HTML Help pages. See the documentation for
76+
# a list of builtin themes.
77+
#
78+
html_theme = 'sphinx_rtd_theme'
79+
80+
# The name of an image file (relative to this directory) to place at the top
81+
# of the sidebar.
82+
# html_logo = "_static/tensornet_logo.png"
83+
84+
# The name of an image file (within the static path) to use as favicon of the
85+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
86+
# pixels large.
87+
html_favicon = "_static/favicon.png"
88+
89+
# Add any paths that contain custom static files (such as style sheets) here,
90+
# relative to this directory. They are copied after the builtin static files,
91+
# so a file named "default.css" will overwrite the builtin "default.css".
92+
html_static_path = ['_static']

docs/index.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
:github_url: https://github.com/shan18/TensorNet
2+
3+
TensorNet Documentation
4+
=======================
5+
6+
TensorNet is a high-level deep learning library built on top of PyTorch.
7+
8+
To install and use TensorNet all you have to do is:
9+
10+
.. code-block:: bash
11+
12+
pip install torch-tensornet
13+
14+
If you want to get the latest version of the code before it is released on PyPI you can install the library from GitHub
15+
16+
.. code-block:: bash
17+
18+
pip install git+https://github.com/shan18/TensorNet.git#egg=torch-tensornet
19+
20+
.. toctree::
21+
:maxdepth: 2
22+
:caption: Contents
23+
24+
source/data
25+
source/models
26+
source/models.loss
27+
source/models.optimizer
28+
source/engine
29+
source/engine.ops
30+
source/engine.ops.regularizer
31+
source/gradcam
32+
source/utils

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
numpy==1.18.5
2+
torch==1.5.1
3+
torchvision==0.6.1
4+
Pillow==7.0.0
5+
matplotlib==3.2.2
6+
albumentations==0.4.5
7+
opencv-python==4.1.2.30
8+
Sphinx==3.2.1
9+
sphinx-rtd-theme

docs/source/data.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Data
2+
====
3+
4+
Classes and methods which can be used to create and modify datasets.
5+
6+
Datasets
7+
--------
8+
9+
.. automodule:: tensornet.data
10+
:members:
11+
:undoc-members:
12+
13+
Processing
14+
----------
15+
16+
.. automodule:: tensornet.data.processing
17+
:members:
18+
:undoc-members:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Regularizers
2+
============
3+
4+
.. automodule:: tensornet.engine.ops.regularizer
5+
:members:
6+
:undoc-members:

docs/source/engine.ops.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Callbacks
2+
=========
3+
4+
Model Checkpoint
5+
----------------
6+
7+
.. autoclass:: tensornet.engine.ops.ModelCheckpoint
8+
:members:
9+
:undoc-members:
10+
11+
TensorBoard
12+
-----------
13+
14+
.. autoclass:: tensornet.engine.ops.TensorBoard
15+
:members:
16+
:undoc-members:
17+
18+
LR Schedulers
19+
-------------
20+
21+
.. automodule:: tensornet.engine.ops.lr_scheduler
22+
:members:
23+
:undoc-members:

docs/source/engine.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Engine
2+
======
3+
4+
Classes and methods used to train and test models.
5+
6+
.. automodule:: tensornet.engine
7+
:members:
8+
:undoc-members:

docs/source/gradcam.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
GradCAM
2+
=======
3+
4+
.. automodule:: tensornet.gradcam
5+
:members:
6+
:undoc-members:

docs/source/models.loss.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Criterion
2+
=========
3+
4+
This module contains loss functions.
5+
6+
.. automodule:: tensornet.models.loss
7+
:members:
8+
:undoc-members:

docs/source/models.optimizer.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Optimizers
2+
==========
3+
4+
This module contains optimizers.
5+
6+
.. automodule:: tensornet.models.optimizer
7+
:members:
8+
:undoc-members:

0 commit comments

Comments
 (0)