Skip to content

Commit e105318

Browse files
authored
Update Tutorials 0.2 (#490)
1 parent 1320f52 commit e105318

File tree

30 files changed

+1528
-5229
lines changed

30 files changed

+1528
-5229
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,9 @@ cython_debug/
139139

140140
# Lightning logs dir
141141
**lightning_logs
142+
143+
# Tutorial logs dir
144+
**tutorial_logs
145+
146+
# tmp dir
147+
**tmp*

pina/problem/zoo/supervised_problem.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from ..abstract_problem import AbstractProblem
44
from ... import Condition
5-
from ... import Graph
5+
from ... import LabelTensor
66

77

88
class SupervisedProblem(AbstractProblem):
@@ -22,16 +22,22 @@ class SupervisedProblem(AbstractProblem):
2222

2323
conditions = {}
2424
output_variables = None
25+
input_variables = None
2526

26-
def __init__(self, input_, output_):
27+
def __init__(
28+
self, input_, output_, input_variables=None, output_variables=None
29+
):
2730
"""
2831
Initialize the SupervisedProblem class.
2932
3033
:param input_: Input data of the problem.
34+
:type input_: torch.Tensor | LabelTensor | Graph | Data
3135
:param output_: Output data of the problem.
32-
:type output_: torch.Tensor | Graph
36+
:type output_: torch.Tensor | LabelTensor | Graph | Data
3337
"""
34-
if isinstance(input_, Graph):
35-
input_ = input_.data
38+
# Set input and output variables
39+
self.input_variables = input_variables
40+
self.output_variables = output_variables
41+
# Set the condition
3642
self.conditions["data"] = Condition(input=input_, target=output_)
3743
super().__init__()

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies = [
2222
requires-python = ">=3.8"
2323

2424
[project.optional-dependencies]
25-
docs = [
25+
doc = [
2626
"sphinx>5.0",
2727
"sphinx_rtd_theme",
2828
"sphinx_copybutton",
@@ -37,8 +37,13 @@ test = [
3737
dev = [
3838
"black @ git+https://github.com/psf/black"
3939
]
40-
tutorials = [
40+
tutorial = [
41+
"jupyter",
4142
"smithers @ git+https://github.com/mathLab/smithers.git",
43+
"torchvision",
44+
"tensorboard",
45+
"scipy",
46+
"numpy",
4247
]
4348

4449
[project.urls]

tutorials/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ Time dependent Kuramoto Sivashinsky equation using the Averaging Neural Operator
3333
|---------------|-----------|
3434
Unstructured convolutional autoencoder via continuous convolution |[[.ipynb](tutorial4/tutorial.ipynb), [.py](tutorial4/tutorial.py), [.html](http://mathlab.github.io/PINA/_rst/tutorials/tutorial4/tutorial.html)]|
3535
POD-RBF and POD-NN for reduced order modeling| [[.ipynb](tutorial8/tutorial.ipynb), [.py](tutorial8/tutorial.py), [.html](http://mathlab.github.io/PINA/_rst/tutorials/tutorial8/tutorial.html)]|
36+
POD-RBF for modelling Lid Cavity| [[.ipynb](tutorial14/tutorial.ipynb), [.py](tutorial14/tutorial.py), [.html](http://mathlab.github.io/PINA/_rst/tutorials/tutorial14/tutorial.html)]|

tutorials/tutorial1/tutorial.ipynb

Lines changed: 151 additions & 115 deletions
Large diffs are not rendered by default.

tutorials/tutorial1/tutorial.py

Lines changed: 0 additions & 322 deletions
This file was deleted.

0 commit comments

Comments
 (0)