starting doc

This commit is contained in:
dario-coscia
2024-07-23 15:27:38 +02:00
committed by Nicola Demo
parent 5445559cb2
commit a09c17209d
12 changed files with 118 additions and 75 deletions

View File

@@ -15,13 +15,16 @@
import sys import sys
import os import os
import sphinx_rtd_theme import sphinx_rtd_theme
# 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.
sys.path.insert(0, os.path.abspath('../..'))
import pina import pina
# -- Project information -----------------------------------------------------
project = pina.__project__
copyright = pina.__copyright__
author = pina.__author__
version = release ='1.0.0'
sys.path.insert(0, os.path.abspath('../sphinx_extensions')) # extension to remove paramref link from lightinig sys.path.insert(0, os.path.abspath('../sphinx_extensions')) # extension to remove paramref link from lightinig
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
@@ -49,13 +52,30 @@ extensions = [
'sphinx.ext.intersphinx', 'sphinx.ext.intersphinx',
'paramref_extension', # this extension is made to remove paramref links from lightining doc 'paramref_extension', # this extension is made to remove paramref links from lightining doc
'sphinx_copybutton', 'sphinx_copybutton',
'sphinx_design'
] ]
# The root document.
root_doc = 'index'
# 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', 'docstrings', 'nextgen', 'Thumbs.db', '.DS_Store']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = 'literal'
# Generate the API documentation when building
autosummary_generate = True
numpydoc_show_class_members = False
intersphinx_mapping = { intersphinx_mapping = {
'python': ('http://docs.python.org/3', None), 'python': ('http://docs.python.org/3', None),
# 'numpy': ('http://docs.scipy.org/doc/numpy/', None), # 'numpy': ('http://docs.scipy.org/doc/numpy/', None),
# 'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None), # 'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None),
'matplotlib': ('http://matplotlib.sourceforge.net/', None), 'matplotlib': ('http://matplotlib.sourceforge.net/', None),
# 'matplotlib': ('https://matplotlib.org/stable', None),
'torch': ('https://pytorch.org/docs/stable/', None), 'torch': ('https://pytorch.org/docs/stable/', None),
'pytorch_lightning': ("https://lightning.ai/docs/pytorch/stable/", None), 'pytorch_lightning': ("https://lightning.ai/docs/pytorch/stable/", None),
} }
@@ -68,7 +88,6 @@ nitpick_ignore = [
('py:func', 'torch.inference_mode'), ('py:func', 'torch.inference_mode'),
('py:func', 'torch.no_grad'), ('py:func', 'torch.no_grad'),
('py:class', 'torch.utils.data.DistributedSampler'), ('py:class', 'torch.utils.data.DistributedSampler'),
('py:class', 'CartesianDomain'), # TO FIX
('py:class', 'pina.model.layers.convolution.BaseContinuousConv'), ('py:class', 'pina.model.layers.convolution.BaseContinuousConv'),
('py:class', 'Module'), ('py:class', 'Module'),
('py:class', 'torch.nn.modules.loss._Loss'), # TO FIX ('py:class', 'torch.nn.modules.loss._Loss'), # TO FIX
@@ -162,7 +181,7 @@ viewcode_import = True
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
html_theme = "sphinx_rtd_theme" html_theme = 'pydata_sphinx_theme'
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
@@ -181,12 +200,26 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The name of an image file (relative to this directory) to place at the top # The name of an image file (relative to this directory) to place at the top
# of the sidebar. # of the sidebar.
html_logo = "index_files/pina_logo.png" html_logo = "index_files/pina_logo_pina.png"
html_theme_options = { html_theme_options = {
'logo_only': True, "icon_links": [
'display_version': True, {
'prev_next_buttons_location': 'bottom', "name": "GitHub",
"url": "https://github.com/mathLab/PINA",
"icon": "fab fa-github",
"type": "fontawesome",
},
{
"name": "Twitter",
"url": "http://twitter.com/rozzagroup",
"icon": "fab fa-twitter",
"type": "fontawesome",
},
],
"show_prev_next": False,
"navbar_start": ["navbar-logo"],
"navbar_end": ["navbar-icon-links"],
"header_links_before_dropdown": 8,
} }
# The name of an image file (within the static path) to use as favicon of the # The name of an image file (within the static path) to use as favicon of the
@@ -195,16 +228,17 @@ html_theme_options = {
# html_favicon = None # html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here, # 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, # relative to this directory. They are copied after the builtin static files,# so a file named "default.css" will overwrite the builtin "default.css".
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static'] html_static_path = ['_static']
html_css_files = [
'/css/custom.css',
]
# Add any extra paths that contain custom files (such as robots.txt or # Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied # .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation. # directly to the root of the documentation.
# html_extra_path = ['_tutorial'] # html_extra_path = ['_tutorial']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # If not ''i, a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format. # using the given strftime format.
html_last_updated_fmt = '%b %d, %Y' html_last_updated_fmt = '%b %d, %Y'
@@ -269,7 +303,7 @@ latex_elements = {
'papersize': 'a4paper', 'papersize': 'a4paper',
# The font size ('10pt', '11pt' or '12pt'). # The font size ('10pt', '11pt' or '12pt').
'pointsize': '10pt', 'pointsize': '20pt',
# Additional stuff for the LaTeX preamble. # Additional stuff for the LaTeX preamble.
'preamble': '', 'preamble': '',
@@ -342,4 +376,4 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu. # If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False # texinfo_no_detailmenu = False
autodoc_member_order = 'bysource' autodoc_member_order = 'bysource'

View File

@@ -1,73 +1,82 @@
Welcome to PINA's documentation! :html_theme.sidebar_secondary.remove:
===================================================
Physics Informed Neural network for Advanced modeling (**PINA**) is Welcome to PINAs documentation!
an open-source Python library providing an intuitive interface for =======================================
solving differential equations using PINNs, NOs or both together.
Based on `PyTorch <https://pytorch.org/>`_ and `PyTorchLightning <https://lightning.ai/docs/pytorch/stable/>`_,
PINA offers a simple and intuitive way to formalize a specific (differential) problem
and solve it using neural networks . The approximated solution of a differential equation
can be implemented using PINA in a few lines of code thanks to the intuitive and user-friendly interface.
`PyTorchLightning <https://lightning.ai/docs/pytorch/stable/>`_ as backhand is done to offer .. grid:: 6
professional AI researchers and machine learning engineers the possibility of using advancement :gutter: 1
training strategies provided by the library, such as multiple device training, modern model compression techniques,
gradient accumulation, and so on. In addition, it provides the possibility to add arbitrary
self-contained routines (callbacks) to the training for easy extensions without the need to touch the
underlying code.
The high-level structure of the package is depicted in our API. The pipeline to solve differential equations .. grid-item::
with PINA follows just five steps: problem definition, model selection, data generation, solver selection, and training.
.. figure:: index_files/API_color.png .. image:: index_files/tutorial_13_3.png
:alt: PINA application program interface :target: _rst/tutorials/tutorial2/tutorial.html
:align: center
:width: 600
| .. grid-item::
Physics-informed neural network .. image:: index_files/tutorial_32_0.png
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :target: _rst/tutorials/tutorial4/tutorial.html
`PINN <https://www.sciencedirect.com/science/article/abs/pii/S0021999118307125>`_ is a novel approach that .. grid-item::
involves neural networks to solve differential equations in an unsupervised manner, while respecting
any given law of physics described by general differential equations. Proposed in "*Physics-informed neural
networks: A deep learning framework for solving forward and inverse problems
involving nonlinear partial differential equations*", such framework aims to
solve problems in a continuous and nonlinear settings.
Neural operator learning .. image:: index_files/tutorial_13_01.png
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :target: _rst/tutorials/tutorial9/tutorial.html
`Neural Operators <https://www.jmlr.org/papers/v24/21-1524.html>`_ is a novel approach involving neural networks .. grid-item::
to learn differential operators using supervised learning strategies. By learning the differential operator, the
neural network is able to generalize across different instances of the differential equations (e.g. different forcing .. image:: index_files/tutorial_5_0.png
terms), without the need of re-training. :target: _rst/tutorials/tutorial10/tutorial.html
.. grid-item::
.. image:: index_files/tutorial_36_0.png
:target: _rst/tutorials/tutorial6/tutorial.html
.. grid-item::
.. image:: index_files/tutorial_15_0.png
:target: _rst/tutorials/tutorial13/tutorial.html
.. grid:: 1 1 3 3
.. grid-item::
:columns: 12 12 6 6
Physics Informed Neural network for Advanced modeling (**PINA**) is
an open-source Python library providing an intuitive interface for
solving differential equations using PINNs, NOs or both together.
Based on `PyTorch <https://pytorch.org/>`_ and `PyTorchLightning <https://lightning.ai/docs/pytorch/stable/>`_, **PINA** offers a simple and intuitive way to formalize a specific (differential) problem
and solve it using neural networks . The approximated solution of a differential equation
can be implemented using PINA in a few lines of code thanks to the intuitive and user-friendly interface.
Contact us by email for further information or questions about **PINA**, or suggest pull requests.
.. toctree:: .. grid-item-card:: Contents
:maxdepth: 1 :class-title: sd-fs-5
:caption: Package Documentation: :class-body: sd-pl-4
API <_rst/_code>
.. the following is demo content intended to showcase some of the features you can invoke in reStructuredText .. toctree::
.. this can be safely deleted or commented out :maxdepth: 1
.. ........................................................................................
.. toctree:: Installing <_rst/_installation>
:maxdepth: 1 Tutorial <_rst/_tutorial>
:caption: Getting Started: API <_rst/_code>
Installation <_rst/_installation> .. .. grid-item-card:: Features
Tutorials <_rst/_tutorial> .. :columns: 12 12 4 4
.. :class-title: sd-fs-5
.. :class-body: sd-pl-3
.. toctree:: .. * :bdg-secondary:`New` Objects: :ref:`API <objects_api>` | :doc:`Tutorial <tutorial/objects_interface>`
:maxdepth: 1 .. * Relational plots: :ref:`API <relational_api>` | :doc:`Tutorial <tutorial/relational>`
:caption: Community: .. * Distribution plots: :ref:`API <distribution_api>` | :doc:`Tutorial <tutorial/distributions>`
.. * Categorical plots: :ref:`API <categorical_api>` | :doc:`Tutorial <tutorial/categorical>`
Team & Fundings <_team.rst> .. * Regression plots: :ref:`API <regression_api>` | :doc:`Tutorial <tutorial/regression>`
Contributing <_rst/_contributing> .. * Multi-plot grids: :ref:`API <grid_api>` | :doc:`Tutorial <tutorial/axis_grids>`
License <_LICENSE.rst> .. * Figure theming: :ref:`API <style_api>` | :doc:`Tutorial <tutorial/aesthetics>`
Cite PINA <_cite.rst> .. * Color palettes: :ref:`API <palette_api>` | :doc:`Tutorial <tutorial/color_palettes>`

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB