Tutorials WIP
This commit is contained in:
3074
tutorials/tutorial1/tutorial.ipynb
vendored
3074
tutorials/tutorial1/tutorial.ipynb
vendored
File diff suppressed because one or more lines are too long
98242
tutorials/tutorial13/tutorial.ipynb
vendored
98242
tutorials/tutorial13/tutorial.ipynb
vendored
File diff suppressed because one or more lines are too long
22
tutorials/tutorial2/tutorial.ipynb
vendored
22
tutorials/tutorial2/tutorial.ipynb
vendored
@@ -16,7 +16,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"id": "ad0b8dd7",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -32,6 +32,8 @@
|
||||
"\n",
|
||||
"import torch\n",
|
||||
"from torch.nn import Softplus\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"plt.style.use('tableau-colorblind10')\n",
|
||||
"\n",
|
||||
"from pina.problem import SpatialProblem\n",
|
||||
"from pina.operator import laplacian\n",
|
||||
@@ -40,7 +42,7 @@
|
||||
"from pina.trainer import Trainer\n",
|
||||
"from pina.domain import CartesianDomain\n",
|
||||
"from pina.equation import Equation, FixedValue\n",
|
||||
"from pina import Condition, LabelTensor#,Plotter\n",
|
||||
"from pina import Condition, LabelTensor\n",
|
||||
"from pina.callback import MetricTracker"
|
||||
]
|
||||
},
|
||||
@@ -512,14 +514,20 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"execution_count": null,
|
||||
"id": "2855cea1",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#plotter.plot_loss(trainer, logy=True, label='Standard')\n",
|
||||
"#plotter.plot_loss(trainer_feat, logy=True,label='Static Features')\n",
|
||||
"#plotter.plot_loss(trainer_learn, logy=True, label='Learnable Features')\n"
|
||||
"trainer_metrics = trainer.callbacks[list_[0]].metrics\n",
|
||||
"\n",
|
||||
"loss = trainer_metrics['val_loss']\n",
|
||||
"epochs = range(len(loss))\n",
|
||||
"plt.plot(epochs, loss.cpu())\n",
|
||||
"# plotting\n",
|
||||
"plt.xlabel('epoch')\n",
|
||||
"plt.ylabel('loss')\n",
|
||||
"plt.yscale('log')\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -557,7 +565,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.12.3"
|
||||
"version": "3.12.7"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
5
tutorials/tutorial3/tutorial.ipynb
vendored
5
tutorials/tutorial3/tutorial.ipynb
vendored
@@ -16,7 +16,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"id": "d93daba0",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -31,8 +31,9 @@
|
||||
" !pip install \"pina-mathlab\"\n",
|
||||
" \n",
|
||||
"import torch\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"plt.style.use('tableau-colorblind10')\n",
|
||||
"\n",
|
||||
"import matplotlib.pylab as plt\n",
|
||||
"from pina.problem import SpatialProblem, TimeDependentProblem\n",
|
||||
"from pina.operator import laplacian, grad\n",
|
||||
"from pina.domain import CartesianDomain\n",
|
||||
|
||||
3
tutorials/tutorial4/tutorial.ipynb
vendored
3
tutorials/tutorial4/tutorial.ipynb
vendored
@@ -28,7 +28,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"id": "5ae7c0e8",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -45,6 +45,7 @@
|
||||
"import torch \n",
|
||||
"import matplotlib.pyplot as plt \n",
|
||||
"plt.style.use('tableau-colorblind10')\n",
|
||||
"\n",
|
||||
"from pina.problem import AbstractProblem\n",
|
||||
"from pina.solver import SupervisedSolver\n",
|
||||
"from pina.trainer import Trainer\n",
|
||||
|
||||
Reference in New Issue
Block a user