PINN variants addition and Solvers Update (#263)
* gpinn/basepinn new classes, pinn restructure * codacy fix gpinn/basepinn/pinn * inverse problem fix * Causal PINN (#267) * fix GPU training in inverse problem (#283) * Create a `compute_residual` attribute for `PINNInterface` * Modify dataloading in solvers (#286) * Modify PINNInterface by removing _loss_phys, _loss_data * Adding in PINNInterface a variable to track the current condition during training * Modify GPINN,PINN,CausalPINN to match changes in PINNInterface * Competitive Pinn Addition (#288) * fixing after rebase/ fix loss * fixing final issues --------- Co-authored-by: Dario Coscia <dariocoscia@Dario-Coscia.local> * Modify min max formulation to max min for paper consistency * Adding SAPINN solver (#291) * rom solver * fix import --------- Co-authored-by: Dario Coscia <dariocoscia@Dario-Coscia.local> Co-authored-by: Anna Ivagnes <75523024+annaivagnes@users.noreply.github.com> Co-authored-by: valc89 <103250118+valc89@users.noreply.github.com> Co-authored-by: Monthly Tag bot <mtbot@noreply.github.com> Co-authored-by: Nicola Demo <demo.nicola@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import pytorch_lightning
|
||||
from ..utils import check_consistency
|
||||
from ..problem import AbstractProblem
|
||||
import torch
|
||||
import sys
|
||||
|
||||
|
||||
class SolverInterface(pytorch_lightning.LightningModule, metaclass=ABCMeta):
|
||||
@@ -141,6 +142,20 @@ class SolverInterface(pytorch_lightning.LightningModule, metaclass=ABCMeta):
|
||||
"""
|
||||
The problem formulation."""
|
||||
return self._pina_problem
|
||||
|
||||
def on_train_start(self):
|
||||
"""
|
||||
On training epoch start this function is call to do global checks for
|
||||
the different solvers.
|
||||
"""
|
||||
|
||||
# 1. Check the verison for dataloader
|
||||
dataloader = self.trainer.train_dataloader
|
||||
if sys.version_info < (3, 8):
|
||||
dataloader = dataloader.loaders
|
||||
self._dataloader = dataloader
|
||||
|
||||
return super().on_train_start()
|
||||
|
||||
# @model.setter
|
||||
# def model(self, new_model):
|
||||
|
||||
Reference in New Issue
Block a user