Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBC Layer #252

Merged
merged 6 commits into from
Mar 1, 2024
Merged

PBC Layer #252

merged 6 commits into from
Mar 1, 2024

Conversation

dario-coscia
Copy link
Collaborator

Introducing a PBC layer for square domains.

@dario-coscia dario-coscia added the pr-to-review Label for PR that are ready to been reviewed label Feb 24, 2024
can correctly compute the PBC on the derivatives up to the order
:math:`\sim 2,3`, while it is not guarantee the periodicity for
:math:`>3`. The PINA code is tested only for function PBC and not for
its derivatives.
Copy link
Member

Choose a reason for hiding this comment

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

A small example to show the minimal usage

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok I will add it.

@@ -0,0 +1,142 @@
""" Embedding modulus. """
Copy link
Member

Choose a reason for hiding this comment

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

Periodic Boundary Embedding module

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the future I plan to put other embeddings, that's why I used this name. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

But I would keep one class per file, it's cleaner

from pina.utils import check_consistency


class PBCEmbedding(torch.nn.Module):
Copy link
Member

Choose a reason for hiding this comment

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

What about the extended class name? PeriodicBoundaryEmbedding maybe? Too many acronyms make things very complex for new user

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

PeriodicBoundaryEmbeddingBlock ?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah nice

@ndem0 ndem0 merged commit 4cfd90b into mathLab:master Mar 1, 2024
15 of 16 checks passed
@dario-coscia dario-coscia deleted the trigfeatures branch March 1, 2024 17:27
AleDinve pushed a commit to AleDinve/PINA that referenced this pull request Mar 4, 2024
* update docs/tests
* tutorial and device fix

---------

Co-authored-by: Dario Coscia <[email protected]>
Co-authored-by: Dario Coscia <[email protected]>
Co-authored-by: Dario Coscia <[email protected]>
Co-authored-by: Dario Coscia <[email protected]>
AleDinve pushed a commit to AleDinve/PINA that referenced this pull request Mar 25, 2024
* update docs/tests
* tutorial and device fix

---------

Co-authored-by: Dario Coscia <[email protected]>
Co-authored-by: Dario Coscia <[email protected]>
Co-authored-by: Dario Coscia <[email protected]>
Co-authored-by: Dario Coscia <[email protected]>
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.

None yet

2 participants