Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,9 @@ cython_debug/

# Lightning logs dir
**lightning_logs

# Tutorial logs dir
**tutorial_logs

# tmp dir
**tmp*
16 changes: 11 additions & 5 deletions pina/problem/zoo/supervised_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from ..abstract_problem import AbstractProblem
from ... import Condition
from ... import Graph
from ... import LabelTensor


class SupervisedProblem(AbstractProblem):
Expand All @@ -22,16 +22,22 @@ class SupervisedProblem(AbstractProblem):

conditions = {}
output_variables = None
input_variables = None

def __init__(self, input_, output_):
def __init__(
self, input_, output_, input_variables=None, output_variables=None
):
"""
Initialize the SupervisedProblem class.

:param input_: Input data of the problem.
:type input_: torch.Tensor | LabelTensor | Graph | Data
:param output_: Output data of the problem.
:type output_: torch.Tensor | Graph
:type output_: torch.Tensor | LabelTensor | Graph | Data
"""
if isinstance(input_, Graph):
input_ = input_.data
# Set input and output variables
self.input_variables = input_variables
self.output_variables = output_variables
# Set the condition
self.conditions["data"] = Condition(input=input_, target=output_)
super().__init__()
3 changes: 0 additions & 3 deletions pina/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ def __init__(

# logging
self.logging_kwargs = {
"logger": bool(
kwargs["logger"] is not None or kwargs["logger"] is True
),
"sync_dist": bool(
len(self._accelerator_connector._parallel_devices) > 1
),
Expand Down
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies = [
requires-python = ">=3.8"

[project.optional-dependencies]
docs = [
doc = [
"sphinx>5.0",
"sphinx_rtd_theme",
"sphinx_copybutton",
Expand All @@ -37,8 +37,13 @@ test = [
dev = [
"black @ git+https://github.com/psf/black"
]
tutorials = [
tutorial = [
"jupyter",
"smithers @ git+https://github.com/mathLab/smithers.git",
"torchvision",
"tensorboard",
"scipy",
"numpy",
]

[project.urls]
Expand Down
1 change: 1 addition & 0 deletions tutorials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ Time dependent Kuramoto Sivashinsky equation using the Averaging Neural Operator
|---------------|-----------|
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)]|
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)]|
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)]|
266 changes: 151 additions & 115 deletions tutorials/tutorial1/tutorial.ipynb

Large diffs are not rendered by default.

Loading
Loading