fix tutorials latex and links (#261)
This commit is contained in:
4
tutorials/README.md
vendored
4
tutorials/README.md
vendored
@@ -6,8 +6,8 @@ In this folder we collect useful tutorials in order to understand the principles
|
||||
|
||||
| Description | Tutorial |
|
||||
|---------------|-----------|
|
||||
Introduction to PINA for Physics Informed Neural Networks training|[[.ipynb](tutorial1/tutorial.ipynb), [.py](tutorial1/tutorial.py), [.html](http://mathlab.github.io/PINA/_rst/tutorial1/tutorial.html)]|
|
||||
Building custom geometries with PINA `Location` class|[[.ipynb](tutorial6/tutorial.ipynb), [.py](tutorial6/tutorial.py), [.html](https://mathlab.github.io/PINA/_rst/tutorials/tutorial6/tutorial.html)]|
|
||||
Introduction to PINA for Physics Informed Neural Networks training|[[.ipynb](tutorial1/tutorial.ipynb), [.py](tutorial1/tutorial.py), [.html](http://mathlab.github.io/PINA/_rst/tutorials/tutorial1/tutorial.html)]|
|
||||
Building custom geometries with PINA `Location` class|[[.ipynb](tutorial6/tutorial.ipynb), [.py](tutorial6/tutorial.py), [.html](http://mathlab.github.io/PINA/_rst/tutorials/tutorial6/tutorial.html)]|
|
||||
|
||||
|
||||
## Physics Informed Neural Networks
|
||||
|
||||
65
tutorials/tutorial1/tutorial.ipynb
vendored
65
tutorials/tutorial1/tutorial.ipynb
vendored
@@ -78,19 +78,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"id": "2373a925",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.\n",
|
||||
"Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from pina.problem import SpatialProblem, TimeDependentProblem\n",
|
||||
"from pina.geometry import CartesianDomain\n",
|
||||
@@ -113,10 +104,10 @@
|
||||
"where we have included the `temporal_domain` variable, indicating the time domain wanted for the solution.\n",
|
||||
"\n",
|
||||
"In summary, using **PINA**, we can initialize a problem with a class which inherits from different base classes: `SpatialProblem`, `TimeDependentProblem`, `ParametricProblem`, and so on depending on the type of problem we are considering. Here are some examples (more on the official documentation):\n",
|
||||
"* `SpatialProblem` $\\rightarrow$ a differential equation with spatial variable(s)\n",
|
||||
"* `TimeDependentProblem` $\\rightarrow$ a time-dependent differential equation\n",
|
||||
"* `ParametricProblem` $\\rightarrow$ a parametrized differential equation\n",
|
||||
"* `AbstractProblem` $\\rightarrow$ any **PINA** problem inherits from here"
|
||||
"* ``SpatialProblem`` $\\rightarrow$ a differential equation with spatial variable(s) ``spatial_domain``\n",
|
||||
"* ``TimeDependentProblem`` $\\rightarrow$ a time-dependent differential equation with temporal variable(s) ``temporal_domain``\n",
|
||||
"* ``ParametricProblem`` $\\rightarrow$ a parametrized differential equation with parametric variable(s) ``parameter_domain``\n",
|
||||
"* ``AbstractProblem`` $\\rightarrow$ any **PINA** problem inherits from here"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -340,44 +331,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"execution_count": null,
|
||||
"id": "3bb4dc9b",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"GPU available: False, used: False\n",
|
||||
"TPU available: False, using: 0 TPU cores\n",
|
||||
"IPU available: False, using: 0 IPUs\n",
|
||||
"HPU available: False, using: 0 HPUs\n",
|
||||
"/Users/alessio/opt/anaconda3/envs/pina/lib/python3.11/site-packages/pytorch_lightning/trainer/connectors/logger_connector/logger_connector.py:67: Starting from v1.9.0, `tensorboardX` has been removed as a dependency of the `pytorch_lightning` package, due to potential conflicts with other packages in the ML ecosystem. For this reason, `logger=True` will use `CSVLogger` as the default logger, unless the `tensorboard` or `tensorboardX` packages are found. Please `pip install lightning[extra]` or one of them to enable TensorBoard support by default\n",
|
||||
"Missing logger folder: /Users/alessio/Downloads/lightning_logs\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Epoch 1499: | | 1/? [00:00<00:00, 167.08it/s, v_num=0, x0_loss=1.07e-5, D_loss=0.000792, mean_loss=0.000401]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"`Trainer.fit` stopped: `max_epochs=1500` reached.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Epoch 1499: | | 1/? [00:00<00:00, 102.49it/s, v_num=0, x0_loss=1.07e-5, D_loss=0.000792, mean_loss=0.000401]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from pina import Trainer\n",
|
||||
"from pina.solvers import PINN\n",
|
||||
@@ -535,12 +492,6 @@
|
||||
"\n",
|
||||
"4. Many more..."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "2931091d",
|
||||
"metadata": {},
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
11
tutorials/tutorial1/tutorial.py
vendored
11
tutorials/tutorial1/tutorial.py
vendored
@@ -68,10 +68,13 @@ class TimeSpaceODE(SpatialProblem, TimeDependentProblem):
|
||||
# where we have included the `temporal_domain` variable, indicating the time domain wanted for the solution.
|
||||
#
|
||||
# In summary, using **PINA**, we can initialize a problem with a class which inherits from different base classes: `SpatialProblem`, `TimeDependentProblem`, `ParametricProblem`, and so on depending on the type of problem we are considering. Here are some examples (more on the official documentation):
|
||||
# * `SpatialProblem` $\rightarrow$ a differential equation with spatial variable(s)
|
||||
# * `TimeDependentProblem` $\rightarrow$ a time-dependent differential equation
|
||||
# * `ParametricProblem` $\rightarrow$ a parametrized differential equation
|
||||
# * `AbstractProblem` $\rightarrow$ any **PINA** problem inherits from here
|
||||
# SpatialProblem → a differential equation with spatial variable(s)
|
||||
# spatial_domain
|
||||
# TimeDependentProblem → a time-dependent differential equation
|
||||
# with temporal variable(s) temporal_domain
|
||||
# ParametricProblem → a parametrized differential equation with
|
||||
# parametric variable(s) parameter_domain
|
||||
# AbstractProblem → any PINA problem inherits from here
|
||||
|
||||
# ### Write the problem class
|
||||
#
|
||||
|
||||
2
tutorials/tutorial3/tutorial.ipynb
vendored
2
tutorials/tutorial3/tutorial.ipynb
vendored
@@ -309,7 +309,7 @@
|
||||
"\n",
|
||||
"A valid option is to impose the initial condition as hard constraint as well. Specifically, our solution is written as:\n",
|
||||
"\n",
|
||||
"$$ u_{\\rm{pinn}} = xy(1-x)(1-y)\\cdot NN(x, y, t)\\cdot t + \\cos(\\sqrt{2}\\pi t)sin(\\pi x)\\sin(\\pi y), $$\n",
|
||||
"$$ u_{\\rm{pinn}} = xy(1-x)(1-y)\\cdot NN(x, y, t)\\cdot t + \\cos(\\sqrt{2}\\pi t)\\sin(\\pi x)\\sin(\\pi y), $$\n",
|
||||
"\n",
|
||||
"Let us build the network first"
|
||||
]
|
||||
|
||||
2
tutorials/tutorial7/tutorial.ipynb
vendored
2
tutorials/tutorial7/tutorial.ipynb
vendored
@@ -5,7 +5,7 @@
|
||||
"id": "dbbb73cb-a632-4056-bbca-b483b2ad5f9c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Tutorial 7: Resolution of an inverse problem"
|
||||
"# Tutorial: Resolution of an inverse problem"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
2
tutorials/tutorial7/tutorial.py
vendored
2
tutorials/tutorial7/tutorial.py
vendored
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
# coding: utf-8
|
||||
|
||||
# # Tutorial 7: Resolution of an inverse problem
|
||||
# # Tutorial: Resolution of an inverse problem
|
||||
|
||||
# ### Introduction to the inverse problem
|
||||
|
||||
|
||||
2
tutorials/tutorial8/tutorial.ipynb
vendored
2
tutorials/tutorial8/tutorial.ipynb
vendored
@@ -5,7 +5,7 @@
|
||||
"id": "dbbb73cb-a632-4056-bbca-b483b2ad5f9c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Tutorial 8: Reduced order model (PODNN) for parametric problems"
|
||||
"# Tutorial: Reduced order model (PODNN) for parametric problems"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
2
tutorials/tutorial8/tutorial.py
vendored
2
tutorials/tutorial8/tutorial.py
vendored
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
# coding: utf-8
|
||||
|
||||
# # Tutorial 8: Reduced order model (PODNN) for parametric problems
|
||||
# # Tutorial: Reduced order model (PODNN) for parametric problems
|
||||
|
||||
# The tutorial aims to show how to employ the **PINA** library in order to apply a reduced order modeling technique [1]. Such methodologies have several similarities with machine learning approaches, since the main goal consists of predicting the solution of differential equations (typically parametric PDEs) in a real-time fashion.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user