Skip to main content

Description

PINNs-TF2 is a Python package built on the TensorFlow V2 framework. It not only accelerates PINNs implementation but also simplifies user interactions by abstracting complex PDE challenges. We underscore the pivotal role of compilers in PINNs, highlighting their ability to boost performance by up to 119x.


Each subplot corresponds to a problem, with its iteration count displayed at the top. The logarithmic x-axis shows the speed-up factor w.r.t the original code in TensorFlow v1, and the y-axis illustrates the mean relative error.

For more information, please refer to our paper:

PINNs-TF2: Fast and User-Friendly Physics-Informed Neural Networks in TensorFlow V2. Reza Akbarian Bafghi, and Maziar Raissi. ML4PS, NeurIPS, 2023.

Installation

PINNs-TF2 requires following dependencies to be installed:

Then, you can install PINNs-TF2 itself via [pip]:

pip install pinnstf2

If you intend to introduce new functionalities or make code modifications, we suggest duplicating the repository and setting up a local installation:

git clone https://github.com/rezaakb/pinns-tf2
cd pinns-tf2

# [OPTIONAL] create conda environment
conda create -n myenv python=3.9
conda activate myenv

# install package
pip install -e .

Quick start

Explore a variety of implemented examples within the examples folder. To run a specific code, such as the one for the Navier-Stokes PDE, you can use:

python examples/navier_stokes/train.py

You can train the model using a specified configuration, like the one found in examples/navier_stokes/configs/config.yaml. Parameters can be overridden directly from the command line. For instance:

python examples/navier_stokes/train.py trainer.max_epochs=20 n_train=3000

To utilize our package, there are two primary options:

  • Implement your training structures using Hydra, as illustrated in our provided examples.
  • Directly incorporate our package to solve your custom problem.

For a practical guide on directly using our package to solve the Schrödinger PDE in a continuous forward problem, refer to our tutorial here: tutorials/0-Schrodinger.ipynb.

Data

The data located on the server and will be downloaded automatically upon running each example.

Contributing

As this is the first version of our package, there might be scope for enhancements and bug fixes. We highly value community contributions. If you find any issues, missing features, or unusual behavior during your usage of this library, please feel free to open an issue or submit a pull request on GitHub. For any queries, suggestions, or feedback, please send them to Reza Akbarian Bafghi at reza.akbarianbafghi@colorado.edu.

License

Distributed under the terms of the [BSD-3] license, "pinnstf2" is free and open source software.

Resources

We employed this template to develop the package, drawing from its structure and design principles. For a deeper understanding, we recommend visiting their GitHub repository.

Citation

@inproceedings{Bafghi2023PINNsTF2FA,
  title={PINNs-TF2: Fast and User-Friendly Physics-Informed Neural Networks in TensorFlow V2},
  author={Reza Akbarian Bafghi and Maziar Raissi},
  year={2023},
  url={https://api.semanticscholar.org/CorpusID:265043331}
}

Metadata

Release files for pinnstf2 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pinnstf2 0.1.3
File Size Uploaded Provenance Actions
pinnstf2-0.1.3.tar.gz 35.9 kB Without provenance Details for pinnstf2-0.1.3.tar.gz

Release files / pinnstf2-0.1.3.tar.gz

Download URL pinnstf2-0.1.3.tar.gz
Size 35.9 kB
Tags Source
SHA-256 checksum
How to use checksums
de0af94e554c4240fbc9e105b595b6b679c2ef44f08790e82ae055035307bc1f
BLAKE2b-256 checksum
How to use checksums
deafdef52f65da38398945f646e2db6477603dfadfe459b047d4ccf33ed85355
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Security for pinnstf2 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page