Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PIFNO-LAW

PyTorch Lightning Config: Hydra Template Paper

This repository contains the official implementation for the paper:

Learned Adaptive Weighting for Physics-Informed Fourier Neural Operators: Solving Discontinuous PDEs with Limited Data

PIFNO-LAW is a physics-informed Fourier neural operator framework for solving partial differential equations with discontinuous solutions in limited-data settings. The method uses a dual-operator design: a solution operator predicts the PDE solution, while an auxiliary Fourier neural operator learns a dynamic spatial weight field for the physics loss. This learned adaptive weighting helps stabilize training near shocks and other discontinuities, where large localized residuals can otherwise dominate gradients and degrade the learned operator.

The codebase includes training and evaluation utilities for the discontinuous PDE benchmarks used in the paper, including configurations for PIFNO-LAW, unweighted physics-informed FNO baselines, static heuristic weighting baselines, and data-driven FNO variants.

Quick Start

We recommend using uv (a fast Python package manager), but you can also use pip or conda.

1. Install Dependencies

Option A: Using uv

# Clone and enter the repository
git clone https://github.com/Gxinhu/PIFNO-LAW.git
cd PIFNO-LAW

# Install all dependencies and create a virtual environment (.venv)
uv sync

Option B: Using pip

git clone https://github.com/Gxinhu/PIFNO-LAW.git
cd PIFNO-LAW

# We recommend using a virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install the project and dependencies
pip install -e .

Option C: Using conda

git clone https://github.com/Gxinhu/PIFNO-LAW.git
cd PIFNO-LAW

# Create and activate a conda environment
conda create -n pifno python=3.11
conda activate pifno

# Install the project and dependencies
pip install -e .

2. Configure the Dataset Directory

This project requires a .env file to define the system path to your dataset folders (so Hydra configurations can dynamically mount the data).

Create your .env file using the provided example:

# Copy the example template
cp .env.example .env

Open the newly created .env file and set the DATASET_PATH variable to point to the data/ folder you will be creating in the next step:

# Open .env and ensure it has this line:
DATASET_PATH="./data/"

3. Download the Datasets

The simulation data is hosted on Hugging Face at huxinchn/PIFNO-LAW.

Create a data/ directory in the repository root and download the dataset from Hugging Face into it:

mkdir -p data/
cd data/

# Download the 1D Burgers dataset using the Hugging Face CLI:
uv run huggingface-cli download huxinchn/PIFNO-LAW --repo-type dataset --local-dir ./
cd ..

After downloading, your root directory structure should cleanly look like this:

PIFNO-LAW/
├── configs/
├── data/
│   └── burgers.h5
├── script/
├── src/
└── pyproject.toml

4. Run Training Scripts

The application relies on Hydra for hierarchical configurations. You can run all foundational experiments and baselines using the provided bash script, which queues multiple network layouts iteratively over different data sample sizes:

# Make sure to run this from the project root!
bash script/experiment.sh

Alternatively, you can test a single specific experiment using your environment's python runner:

# If using uv (Recommended)
uv run src/train.py -m experiment=pino_shock_law data.n_train=50 seed=1 logger=csv

# If using pip/conda
python src/train.py -m experiment=pino_shock_law data.n_train=50 seed=1 logger=csv

References

PINO_Application

Citation

If this repository is useful for your research, please cite our paper:

@article{HU2026117079,
  title = {Learned Adaptive Weighting for Physics-Informed Fourier Neural Operators: Solving Discontinuous PDEs with Limited Data},
  journal = {Applied Mathematical Modelling},
  pages = {117079},
  year = {2026},
  issn = {0307-904X},
  doi = {https://doi.org/10.1016/j.apm.2026.117079},
  url = {https://www.sciencedirect.com/science/article/pii/S0307904X26003409},
  author = {Xin Hu and Bo An and Yongke Guan and Liang Xu and Min Yu and Dong Li},
}

About

Official implementation of PIFNO-LAW: Learned Adaptive Weighting for Physics-Informed Fourier Neural Operators for discontinuous PDEs with limited data.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages