Skip to content

Commit

Permalink
Add documents page
Browse files Browse the repository at this point in the history
  • Loading branch information
thieupu committed Dec 3, 2023
1 parent 812eac2 commit 296c597
Show file tree
Hide file tree
Showing 12 changed files with 613 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

examples/helpers/history/
metaperceptron/data/
docs/
# Pycharm
.idea/
tut_upcode.md
Expand Down
24 changes: 24 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build all formats
formats: all

build:
os: "ubuntu-20.04"
tools:
python: "3.8"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

python:
install:
- requirements: docs/requirements.txt

submodules:
include: all
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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 = source
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)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
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
12 changes: 12 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Defining the exact version will make sure things don't break
sphinx>=4.4.0
sphinx_rtd_theme>=1.0.1
readthedocs-sphinx-search>=0.1.1
numpy>=1.17.1
scipy>=1.7.1
scikit-learn>=1.0.2
pandas>=1.3.5
mealpy>=3.0.1
permetrics>=1.5.0
torch>=2.0.0
skorch>=0.13.0
69 changes: 69 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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
import os
import sys

sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(1, os.path.abspath('../../metaperceptron'))


# -- Project information -----------------------------------------------------

project = 'metaperceptron'
copyright = '2023, Thieu'
author = 'Thieu'

# The full version, including alpha/beta/rc tags
release = '1.0.1'


# -- 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.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
]

# 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'

html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# 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']
98 changes: 98 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
.. MetaPerceptron documentation master file, created by
sphinx-quickstart on Sat May 20 16:59:33 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to MetaPerceptron's documentation!
====================================

.. image:: https://img.shields.io/badge/release-1.0.1-yellow.svg
:target: https://github.com/thieu1995/metaperceptron/releases

.. image:: https://img.shields.io/pypi/wheel/gensim.svg
:target: https://pypi.python.org/pypi/metaperceptron

.. image:: https://badge.fury.io/py/metaperceptron.svg
:target: https://badge.fury.io/py/metaperceptron

.. image:: https://img.shields.io/pypi/pyversions/metaperceptron.svg
:target: https://www.python.org/

.. image:: https://img.shields.io/pypi/status/metaperceptron.svg
:target: https://img.shields.io/pypi/status/metaperceptron.svg

.. image:: https://img.shields.io/pypi/dm/metaperceptron.svg
:target: https://img.shields.io/pypi/dm/metaperceptron.svg

.. image:: https://github.com/thieu1995/metaperceptron/actions/workflows/publish-package.yaml/badge.svg
:target: https://github.com/thieu1995/metaperceptron/actions/workflows/publish-package.yaml

.. image:: https://pepy.tech/badge/metaperceptron
:target: https://pepy.tech/project/metaperceptron

.. image:: https://img.shields.io/github/release-date/thieu1995/metaperceptron.svg
:target: https://img.shields.io/github/release-date/thieu1995/metaperceptron.svg

.. image:: https://readthedocs.org/projects/metaperceptron/badge/?version=latest
:target: https://metaperceptron.readthedocs.io/en/latest/?badge=latest

.. image:: https://img.shields.io/badge/Chat-on%20Telegram-blue
:target: https://t.me/+fRVCJGuGJg1mNDg1

.. image:: https://img.shields.io/github/contributors/thieu1995/metaperceptron.svg
:target: https://img.shields.io/github/contributors/thieu1995/metaperceptron.svg

.. image:: https://img.shields.io/badge/PR-Welcome-%23FF8300.svg?
:target: https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.10067995.svg
:target: https://doi.org/10.5281/zenodo.10067995

.. image:: https://img.shields.io/badge/License-GPLv3-blue.svg
:target: https://www.gnu.org/licenses/gpl-3.0


MetaPerceptron (Metaheuristic-optimized Multi-Layer Perceptron) is a Python library that implements variants and the
traditional version of Multi-Layer Perceptron models. These include Metaheuristic-optimized MLP models (GA, PSO, WOA, TLO, DE, ...)
and Gradient Descent-optimized MLP models (SGD, Adam, Adelta, Adagrad, ...). It provides a comprehensive list of
optimizers for training MLP models and is also compatible with the Scikit-Learn library. With MetaPerceptron,
you can perform searches and hyperparameter tuning using the features provided by the Scikit-Learn library.

* **Free software:** GNU General Public License (GPL) V3 license
* **Provided Estimator**: MlpRegressor, MlpClassifier, MhaMlpRegressor, MhaMlpClassifier
* **Total Metaheuristic-based MLP Regressor**: > 200 Models
* **Total Metaheuristic-based MLP Classifier**: > 200 Models
* **Total Gradient Descent-based MLP Regressor**: 12 Models
* **Total Gradient Descent-based MLP Classifier**: 12 Models
* **Supported performance metrics**: >= 67 (47 regressions and 20 classifications)
* **Supported objective functions (as fitness functions or loss functions)**: >= 67 (47 regressions and 20 classifications)
* **Documentation:** https://metaperceptron.readthedocs.io
* **Python versions:** >= 3.8.x
* **Dependencies:** numpy, scipy, scikit-learn, pandas, mealpy, permetrics, torch, skorch

.. toctree::
:maxdepth: 4
:caption: Quick Start:

pages/quick_start.rst

.. toctree::
:maxdepth: 4
:caption: Models API:

pages/metaperceptron.rst

.. toctree::
:maxdepth: 4
:caption: Support:

pages/support.rst



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
34 changes: 34 additions & 0 deletions docs/source/pages/metaperceptron.core.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
metaperceptron.core package
===========================

metaperceptron.core.base\_mlp\_numpy module
-------------------------------------------

.. automodule:: metaperceptron.core.base_mlp_numpy
:members:
:undoc-members:
:show-inheritance:

metaperceptron.core.base\_mlp\_torch module
-------------------------------------------

.. automodule:: metaperceptron.core.base_mlp_torch
:members:
:undoc-members:
:show-inheritance:

metaperceptron.core.mha\_mlp module
-----------------------------------

.. automodule:: metaperceptron.core.mha_mlp
:members:
:undoc-members:
:show-inheritance:

metaperceptron.core.traditional\_mlp module
-------------------------------------------

.. automodule:: metaperceptron.core.traditional_mlp
:members:
:undoc-members:
:show-inheritance:
42 changes: 42 additions & 0 deletions docs/source/pages/metaperceptron.helpers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
metaperceptron.helpers package
==============================

metaperceptron.helpers.act\_util module
---------------------------------------

.. automodule:: metaperceptron.helpers.act_util
:members:
:undoc-members:
:show-inheritance:

metaperceptron.helpers.metric\_util module
------------------------------------------

.. automodule:: metaperceptron.helpers.metric_util
:members:
:undoc-members:
:show-inheritance:

metaperceptron.helpers.preprocessor module
------------------------------------------

.. automodule:: metaperceptron.helpers.preprocessor
:members:
:undoc-members:
:show-inheritance:

metaperceptron.helpers.scaler\_util module
------------------------------------------

.. automodule:: metaperceptron.helpers.scaler_util
:members:
:undoc-members:
:show-inheritance:

metaperceptron.helpers.validator module
---------------------------------------

.. automodule:: metaperceptron.helpers.validator
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/source/pages/metaperceptron.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
metaperceptron package
======================

.. toctree::
:maxdepth: 4

metaperceptron.core
metaperceptron.helpers
Loading

0 comments on commit 296c597

Please sign in to comment.