Giter VIP home page Giter VIP logo

gpt-pinn's Introduction

Generative Pre-Trained Physics-Informed Neural Network Implementation

GPT-PINN: Generative Pre-Trained Physics-Informed Neural Networks toward non-intrusive Meta-learning of parametric PDEs

Yanlai Chen1, Shawn Koohy1

Update (7/4/2024): The code has been updated to be optimized for speed and readability

See also TGPT-PINN: Nonlinear model reduction with transformed GPT-PINNs (GitHub)

Image 1 GPT-PINN Architecture

Talk and Presentations

DDPS Seminar at the Lawrence Livermore Lab

Brown CRUNCH Group Seminar

Numerical Analysis of Galerkin ROMs Seminar

Abstract:

Physics-Informed Neural Network (PINN) has proven itself a powerful tool to obtain the numerical solutions of nonlinear partial differential equations (PDEs) leveraging the expressivity of deep neural networks and the computing power of modern heterogeneous hardware. However, its training is still time-consuming, especially in the multi-query and real-time simulation settings, and its parameterization often overly excessive. In this paper, we propose the Generative Pre-Trained PINN (GPT-PINN) to mitigate both challenges in the setting of parametric PDEs. GPT-PINN represents a brand-new meta-learning paradigm for parametric systems. As a network of networks, its outer-/meta-network is hyper-reduced with only one hidden layer having significantly reduced number of neurons. Moreover, its activation function at each hidden neuron is a (full) PINN pre-trained at a judiciously selected system configuration. The meta-network adaptively “learns” the parametric dependence of the system and “grows” this hidden layer one neuron at a time. In the end, by encompassing a very small number of networks trained at this set of adaptively-selected parameter values, the meta-network is capable of generating surrogate solutions for the parametric system across the entire parameter domain accurately and efficiently.

1 University of Massachusetts Dartmouth, Department of Mathematics, North Dartmouth, MA

Requirements:

KG/B:
Python     = 3.11.4
NumPy      = 1.24.3
PyTorch    = 2.1.2+cu121
Matplotlib = 3.7.1

AC:
Python     = 3.9.12 
NumPy      = 1.24.3
PyTorch    = 2.3.1+cu118
TensorFlow = 2.10.0
Matplotlib = 3.9.0

Combinations of different package versions will likely run the code with little to no change.

GPU and CPU Support:

The code was implemented with the intention of computation to be primarily performed on the GPU. CPU computation can be done however, it will take much longer.

Usage:

The Klein-Gordon, Allen-Cahn, and Burgers' equation files are currently available. Running KG_main.py, B_main.py, or AC_main.py (with the other files in the folder located in the respective directory) will begin the training of the full-PINN and GPT-PINN, growing the GPT-PINN hidden layer size from 1 to 15 (Klein-Gordon) or 9 (Burgers' and Allen-Cahn). The Final GPT-PINN is then tested on various parameters and the results of training and testing can visualized using the plotting files (KG_plotting.py, B_plotting.py, or AC_plotting.py). Various parameters within the PINN or GPT-PINN can easily be changed in the main files. As a default setting, once the total number of neurons is achieved, the GPT-PINN is trained once more in order to find the largest loss obtained using the final number of neurons. This is done to give more information about the final state of the GPT-PINN.

Image 2

Klein-Gordon Run Times

Image 2

Burgers' Run Times

Image 2

Allen-Cahn Run Times

Citation:

Below you can find the Bibtex citation:

@article{chen2024gpt,
  title={GPT-PINN: Generative Pre-Trained Physics-Informed Neural Networks toward non-intrusive Meta-learning of parametric PDEs},
  author={Chen, Yanlai and Koohy, Shawn},
  journal={Finite Elements in Analysis and Design},
  volume={228},
  pages={104047},
  year={2024},
  publisher={Elsevier}
}

gpt-pinn's People

Contributors

skoohy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gpt-pinn's Issues

Pytorch

Hello,

i wanted to ask what the reason was that you combine Tensorflow and Pytorch. Would it have been possible to write the whole code in PyTorch only?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.