Giter Site home page Giter Site logo

cpinn's Introduction

CPINN

Overview

This repository contains code examples for the paper Competitive Physics Informed Neural Networks in Pytorch.

CPINN uses an adversarial architecture to train Physics Informed Neural Networks (PINNs) against a discriminator in a zero-sum minimax game to reach higher accuracy beyond PINNs' capability.

In addition to the PyTorch optimizers, we use ExtraGradient and Competitive Gradient Descent optimizers, both avaliable under MIT license. The Weak Adversarial Networks is obtained from Weak Adversarial Networks repo, avaliable under MIT license..

We obtain the training and testing data from the original PINNs directory, avaliable under MIT license.

Run The Code

The system environment requirement is in requirements.txt (You might need to change "python3" to "python", depending on your system) In the same directory as this readme is in, use the following commands to run the experiments for Poisson equation:

python3 Poisson/train_1Dis_CGD.py for the CGD training (CPINN)

python3 Poisson/train_1Dis_ExtraAdam.pyfor the ExtraAdam training (CPINN)

python3 Poisson/train_1Dis_ExtraSGD.pyfor the ExtraSGD training (CPINN)

python3 Poisson/train_1Dis_GACGD.pyfor the GMRES-based ACGD training (CPINN)

python3 Poisson/train_Adam.py -rng 12for the Adam training (PINN)

python3 Poisson/train_SGD.pyfor the SGD training (PINN)

python3 WAN/train_WAN_copy_comb_activation_Adam_resample_no_log.py for the WAN training with Adam/AdaGrad (WAN)

python3 WAN/train_WAN_2D_Poisson_comb_activation_algo1_no_log.py for the WAN training with ACGD (WAN)

use the following commands to run the experiments for the Schrodinger's equation:

python3 Schrodinger/train_Schrodinger_1_Dis_CPINN_GACGD.py -lrmin 0.001 -lrmax 0.001 -pinn 4 100 -dis 4 200 for the GMRES-based ACGD training (CPINN)

python3 Schrodinger/train_Schrodinger_Adam.py -lr 0.0001 -pinn 4 100 for the Adam training (PINN)

use the following commands to run the experiments for the Burgers' equation:

python3 Burger/BurgerTrainGACGD.py -lrmin 0.001 -lrmax 0.001 -disLayer 8 -disNeu 60 -pinnLayer 8 -pinnNeu 60for GMRES-based ACGD training (CPINN)

python3 Burger/BurgerTrainAdam.py -lr 0.001 -pinnLayer 8 -pinnNeu 60(PINN)

use the following commands to run the experiments for the Allen-Cahn equation:

python3 AC/TrainAC_1Dis_GACGD_adaptive.py -PINN_neurons 128 -dis_neurons 256(CPINN)

python3 AC/TrainAC_Adam_Adaptive.py -adaptiveTol 0.0000001 (PINN)

cpinn's People

Contributors

hengruibaicn avatar q1zeng avatar

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.