Skip to content

Support batching for rbapinns#589

Merged
GiovanniCanali merged 3 commits into
mathLab:devfrom
GiovanniCanali:fix_rba
Jun 25, 2025
Merged

Support batching for rbapinns#589
GiovanniCanali merged 3 commits into
mathLab:devfrom
GiovanniCanali:fix_rba

Conversation

@GiovanniCanali

@GiovanniCanali GiovanniCanali commented Jun 15, 2025

Copy link
Copy Markdown
Collaborator

Description

This PR fixes #588

In this PR, I have added the support for batching while using RBAPINN solver class.

Checklist

  • Code follows the project’s Code Style Guidelines
  • Tests have been added or updated
  • Documentation has been updated if necessary
  • Pull request is linked to an open issue

@GiovanniCanali GiovanniCanali self-assigned this Jun 15, 2025
@GiovanniCanali GiovanniCanali added the enhancement New feature or request label Jun 15, 2025
@GiovanniCanali GiovanniCanali linked an issue Jun 15, 2025 that may be closed by this pull request
@GiovanniCanali GiovanniCanali marked this pull request as ready for review June 15, 2025 10:53

@dario-coscia dario-coscia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the logic for batching weights is very clean, this actually solves the problem nicely!

I put some consideration on the code, I am wondering about future maintainability, I think we can clean it more

Comment thread pina/solver/physics_informed_solver/rba_pinn.py Outdated
Comment thread pina/solver/physics_informed_solver/rba_pinn.py
Comment thread pina/solver/physics_informed_solver/rba_pinn.py Outdated
Comment thread pina/solver/physics_informed_solver/rba_pinn.py
Comment thread pina/solver/physics_informed_solver/rba_pinn.py
@GiovanniCanali

Copy link
Copy Markdown
Collaborator Author

I think the logic for batching weights is very clean, this actually solves the problem nicely!

I put some consideration on the code, I am wondering about future maintainability, I think we can clean it more

Hi @dario-coscia, thank you for your insightful review. Please, see the comments attached to your suggestions.

I understand the proposed RBAPINN implementation is a bit forced. However, I feel like the logic behind PINNs is way too complicated and messy at times, leading to weird artifacts when the training step and validation/test steps differ. Also, it is confusing to have both _optimization_cycle and optimization_cycle.

My suggestion is to discuss in the near future a reorganization of the whole logic behind the PINN-based solvers. Nothing would change under the user's perspective.

@GiovanniCanali GiovanniCanali force-pushed the fix_rba branch 2 times, most recently from 52a73c1 to e91264f Compare June 24, 2025 09:02
@GiovanniCanali GiovanniCanali merged commit 1572e97 into mathLab:dev Jun 25, 2025
17 of 18 checks passed
@GiovanniCanali GiovanniCanali deleted the fix_rba branch August 28, 2025 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support batching for Residual Based Attention PINNs (RBAPINNs)

3 participants