Skip to content

Add batching support for self-adaptive pinns#606

Merged
GiovanniCanali merged 1 commit into
mathLab:devfrom
GiovanniCanali:fix_self_adaptive_pinn
Jul 25, 2025
Merged

Add batching support for self-adaptive pinns#606
GiovanniCanali merged 1 commit into
mathLab:devfrom
GiovanniCanali:fix_self_adaptive_pinn

Conversation

@GiovanniCanali
Copy link
Copy Markdown
Collaborator

Description

This PR fixes #605

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 Jul 23, 2025
@GiovanniCanali GiovanniCanali added enhancement New feature or request pr-to-fix Label for PR that needs modification labels Jul 23, 2025
@GiovanniCanali GiovanniCanali force-pushed the fix_self_adaptive_pinn branch from 882d32e to e505ea1 Compare July 23, 2025 07:25
@GiovanniCanali GiovanniCanali requested review from FilippoOlivo and dario-coscia and removed request for FilippoOlivo July 23, 2025 07:30
@GiovanniCanali GiovanniCanali added pr-to-review Label for PR that are ready to been reviewed and removed pr-to-fix Label for PR that needs modification labels Jul 23, 2025
@GiovanniCanali GiovanniCanali linked an issue Jul 23, 2025 that may be closed by this pull request
@GiovanniCanali GiovanniCanali marked this pull request as ready for review July 23, 2025 07:31
@GiovanniCanali GiovanniCanali requested a review from Copilot July 25, 2025 14:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds batching support for self-adaptive PINNs by removing the previous restriction that required full batch processing and implementing proper batch handling with self-adaptive weights.

Key changes:

  • Remove the batch size restriction that previously threw NotImplementedError
  • Implement proper batch indexing for self-adaptive weights using modulus operations
  • Refactor loss computation to support batched operations with per-point weight application

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tests/test_solver/test_self_adaptive_pinn.py Remove test for batch restriction and add loss function parameterization to existing tests
pina/solver/physics_informed_solver/self_adaptive_pinn.py Major refactor to support batching with proper weight indexing and loss computation

Comment thread pina/solver/physics_informed_solver/self_adaptive_pinn.py
Comment thread pina/solver/physics_informed_solver/self_adaptive_pinn.py
Comment thread pina/solver/physics_informed_solver/self_adaptive_pinn.py
@GiovanniCanali GiovanniCanali merged commit 6d1d4ef into mathLab:dev Jul 25, 2025
18 of 19 checks passed
@GiovanniCanali GiovanniCanali deleted the fix_self_adaptive_pinn branch July 25, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request 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.

Support batching for SelfAdaptivePINN

3 participants