Skip to content

Conversation

@ndem0
Copy link
Member

@ndem0 ndem0 commented Jun 21, 2024

No description provided.

This was referenced Jun 21, 2024
@dario-coscia dario-coscia changed the base branch from master to 0.2 June 21, 2024 14:39
@ndem0 ndem0 requested a review from dario-coscia August 13, 2024 12:47

class DomainEquationCondition(ConditionInterface):
"""
Condition for input/output data.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typos to fix, let's remember to do it later!

from abc import ABCMeta


class Optimizer(metaclass=ABCMeta): # TODO improve interface
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like both Optimizer and Scheduler classes! I think the hook method can be made an abstract method for the base classes. In this way all the classes that inherit from those need to have this function (which is fundamental to attach the network parameters to optimize).

The only thing that I am concerned about is the back compatibility with Lightning, as by default Lightning will use built-in functions inherited from Torch Optimizers and Schedulers. Maybe in the base classes Optimizer and Scheduler we should inherit from torch base classes of optimizer and scheduler as well?

@@ -0,0 +1,10 @@
__all__ = [
'Condition',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree to divide conditions in multiple classes but I do not think that the residual method should be inside conditions. I see conditions more like an object that encapsulates data, if we constrain also to what the model should do we can't cover all test cases. I think that the loss to minimize should be defined only inside the solver (physics-informed, data-driven whatever), in this way is user responsibility to know how to use the data

Maybe we can think more of something like PhysicsConditions, DataConditions, GraphConditions (like the division in the dataloading)... These conditions are needed to call loss_data, loss_phys, and loss_graph (which are defined inside the solver). This helps us to do two things:

  1. We know which functions need to be defined in the solver by looking at the conditions the problem has (we can raise errors before training)
  2. We don't need to cover all classes of possible ways residuals are defined, we only need to pass the data that are needed to compute it.

return tmp
from .utils import check_consistency
check_consistency(labels, dict)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand completely this. Is this back-compatible? Do we need to specify for each tensor all labels for all columns or is it done automatically? What is the format?

@dario-coscia dario-coscia added pr-to-review Label for PR that are ready to been reviewed v0.2 labels Sep 6, 2024
Dario Coscia and others added 14 commits September 9, 2024 12:00
* Tutorial Equation 12
* .rst and readme fix for tutorial12
* small fix
* modified rst

---------

Co-authored-by: Dario Coscia <[email protected]>
* Update label_tensor.py cpu/gpu
* Update test_adaptive_refinment_callbacks.py
* Update test_optimizer_callbacks.py
* 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 <[email protected]>

* Modify min max formulation to max min for paper consistency
* Adding SAPINN solver (#291)
* rom solver
* fix import

---------

Co-authored-by: Dario Coscia <[email protected]>
Co-authored-by: Anna Ivagnes <[email protected]>
Co-authored-by: valc89 <[email protected]>
Co-authored-by: Monthly Tag bot <[email protected]>
Co-authored-by: Nicola Demo <[email protected]>
This was referenced Sep 9, 2024
@ndem0 ndem0 merged commit 36c447a into 0.2 Sep 9, 2024
@ndem0 ndem0 deleted the new-version branch October 22, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-to-review Label for PR that are ready to been reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants