Package: pinnstorch
[Paper]-[TensorFlow v2]-[TensorFlow v1]DescriptionOur package introduces Physics-Informed Neural Networks (PINNs) implemented using PyTorch. The standout feature is the incorporation of CUDA Graphs and JIT Compilers (TorchScript) for compiling models, resulting in significant performance gains up to 9x compared to the original TensorFlow v1 implementation.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-Torch: Enhancing Speed and Usability of Physics-Informed Neural Networks with PyTorch.Reza Akbarian Bafghi, and Maziar Raissi. DLDE III, NeurIPS, 2023.InstallationPINNs-Torch requires following dependencies to be installed:PyTorch>=2.0.0PyTorch Lightning>= 2.0.0Hydra>= 1.3Then, you can install PINNs-Torch itself via [pip]:pipinstallpinnstorchIf you intend to introduce new functionalities or make code modifications, we suggest duplicating the repository and setting up a local installation:gitclonehttps://github.com/rezaakb/pinns-torchcdpinns-torch# [OPTIONAL] create conda environmentcondacreate-nmyenvpython=3.9
condaactivatemyenv# install packagepipinstall-e.Quick startExplore a variety of implemented examples within theexamplesfolder. To run a specific code, such as the one for the Navier-Stokes PDE, you can use:pythonexamples/navier_stokes/train.pyYou can train the model using a specified configuration, like the one found inexamples/navier_stokes/configs/config.yaml. Parameters can be overridden directly from the command line. For instance:pythonexamples/navier_stokes/train.pytrainer.max_epochs=20n_train=3000To 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.DataThe data located on the server and will be downloaded automatically upon running each example.ContributingAs 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 toReza Akbarian Bafghiatreza.akbarianbafghi@colorado.edu.LicenseDistributed under the terms of the [BSD-3] license, "pinnstorch" is free and open source software.ResourcesWe employedthis templateto develop the package, drawing from its structure and design principles. For a deeper understanding, we recommend visiting their GitHub repository. We also recommend consulting the official documentation ofHydraandPyTorch Lightningfor additional insights.CitationIf you find this useful in your research, please consider citing:@inproceedings{
bafghi2023pinnstorch,
title={{PINN}s-Torch: Enhancing Speed and Usability of Physics-Informed Neural Networks with PyTorch},
author={Reza Akbarian Bafghi and Maziar Raissi},
booktitle={The Symbiosis of Deep Learning and Differential Equations III},
year={2023},
url={https://openreview.net/forum?id=nl1ZzdHpab}
}