PINNs-Torch: Enhancing Speed and Usability of Physics-Informed Neural Networks with PyTorch

Abstract

Physics-informed neural networks (PINNs) stand out for their ability in supervised learning tasks that align with physical laws, especially nonlinear partial differential equations (PDEs). In this paper, we introduce "PINNs-Torch", a Python package that accelerates PINNs implementation using the PyTorch framework and streamlines user interaction by abstracting PDE issues. While we utilize PyTorch's dynamic computational graph for its flexibility, we mitigate its computational overhead in PINNs by compiling it to static computational graphs. In our assessment across 8 diverse examples, covering continuous, discrete, forward, and inverse configurations, naive PyTorch is slower than TensorFlow; however, when integrated with CUDA Graph and JIT compilers, training speeds can increase by up to 9 times relative to TensorFlow implementations. Additionally, through a real-world example, we highlight situations where our package might not deliver speed improvements. For community collaboration and future developments, our package code is accessible at: https://github.com/rezaakb/pinns-torch.

Cite

Text

Bafghi and Raissi. "PINNs-Torch: Enhancing Speed and Usability of Physics-Informed Neural Networks with PyTorch." NeurIPS 2023 Workshops: DLDE, 2023.

Markdown

[Bafghi and Raissi. "PINNs-Torch: Enhancing Speed and Usability of Physics-Informed Neural Networks with PyTorch." NeurIPS 2023 Workshops: DLDE, 2023.](https://mlanthology.org/neuripsw/2023/bafghi2023neuripsw-pinnstorch/)

BibTeX

@inproceedings{bafghi2023neuripsw-pinnstorch,
  title     = {{PINNs-Torch: Enhancing Speed and Usability of Physics-Informed Neural Networks with PyTorch}},
  author    = {Bafghi, Reza Akbarian and Raissi, Maziar},
  booktitle = {NeurIPS 2023 Workshops: DLDE},
  year      = {2023},
  url       = {https://mlanthology.org/neuripsw/2023/bafghi2023neuripsw-pinnstorch/}
}