XPINNs

Model Overview

XPINNs (Extended Physics-Informed Neural Networks) decompose a complex computational domain into multiple subdomains and assign an independent neural network to each. In addition to enforcing PDE residuals and external boundary conditions, training constrains solution continuity and residual consistency across subdomain interfaces.

This model package reproduces the two-dimensional Poisson benchmark from the XPINNs paper. An irregular X-shaped domain is decomposed into three subdomains governed by:

u_xx + u_yy = exp(x) + exp(y)

Paper: Extended Physics-Informed Neural Networks (XPINNs): A Generalized Space-Time Domain Decomposition Based Deep Learning Framework for Nonlinear Partial Differential Equations
https://doi.org/10.4208/cicp.OA-2020-0164

Model Description

XPINNs assign a separate neural network to each of the three subdomains, using tanh, sin, and cos activation functions by default. The model solves the equation on the irregular domain by jointly optimizing boundary loss, PDE residual loss, interface-value loss, and interface-residual loss.

Use Cases

Use Case Description
PDE solving on complex domains Solve a two-dimensional Poisson equation on an irregular X-shaped domain
Domain-decomposition research Configure independent network architectures and activation functions for different subdomains
Interface-constraint research Compare losses for interface solution continuity and residual consistency
Pipeline validation Validate training and inference using the bundled data and a small-scale configuration

Usage

1. OneCode

Use the online OneCode environment for an intelligent, one-click AI for Science (AI4S) programming experience:

Launch OneCode for one-click AI4S programming

2. Manual Setup

Hardware Requirements

  • A GPU or DCU is recommended for training.
  • A CPU can be used for small-scale pipeline validation, but training with the full sample set will be slow.
  • DCU users must install DTK and a PyTorch environment compatible with the target cluster.

Download the Model Package

hf download OneScience-Group/XPINNs --local-dir ./XPINNs
cd XPINNs

Set Up the Runtime Environment

DCU Environment

# Activate DTK and Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[cfd-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai

GPU Environment

# Activate Conda first
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
pip install onescience[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai

Training Data

The model package includes the two-dimensional Poisson data file data/XPINN_2D_PoissonEqn.mat, which contains interior, boundary, and interface points for the three subdomains together with the exact solution. The number of training samples of each type can be adjusted in conf/config.yaml.

Training

python scripts/train.py

The default weights are saved to weight/xpinn_poisson_2d.pt.

Model Weights

This repository provides weights trained on the two-dimensional Poisson dataset in the weight/ directory.

Inference, Evaluation, and Visualization

After training, run:

python scripts/inference.py

The script reports the overall relative L2 error and saves plots of the exact solution, prediction, and absolute error to result/xpinn_poisson_2d.png. Model, data, loss, and inference parameters can all be modified in conf/config.yaml.

Official OneScience Resources

Citations and License

  • Jagtap, A. D., Kharazmi, E., and Karniadakis, G. E. Extended Physics-Informed Neural Networks (XPINNs): A Generalized Space-Time Domain Decomposition Based Deep Learning Framework for Nonlinear Partial Differential Equations. Communications in Computational Physics, 28(5), 2002-2041, 2020.
  • This model package is released under the Apache-2.0 license and retains attribution to the original paper and data sources.

中文说明

模型概述

XPINNs(扩展物理信息神经网络,Extended Physics-Informed Neural Networks)将复杂计算域分解成多个子域,并为每个子域分配一个独立的神经网络。训练除了约束 PDE 残差和外部边界条件,还约束子域交界面上的解连续性和残差一致性。

本模型包复现了 XPINNs 论文中的二维 Poisson 基准。将不规则 X 形区域拆分为三个子域,其控制方程如下。

u_xx + u_yy = exp(x) + exp(y)

论文《扩展物理信息神经网络(XPINNs):基于广义时空域分解的非线性偏微分方程深度学习框架》
https://doi.org/10.4208/cicp.OA-2020-0164

模型描述

XPINNs 为三个子域分别分配独立的神经网络,默认使用 tanh、sin 和 cos 激活函数。通过联合优化边界损失、PDE 残差损失、界面值损失和界面残差损失,模型求解不规则域上的方程。

使用场景

使用场景 说明
复杂区域上的 PDE 求解 求解不规则 X 形区域上的二维 Poisson 方程
区域分解研究 为不同子域配置独立的网络架构和激活函数
界面约束研究 比较界面上解连续性和残差一致性的损失
流程验证 使用随附数据和小规模配置验证训练和推理(inference)

使用方法

1. OneCode

通过 OneCode 在线环境体验智能一键科学智能(AI for Science,AI4S)编程。

启动 OneCode 进行一键 AI4S 编程

2. 手动配置

硬件要求

  • 建议使用 GPU 或 DCU 进行训练。
  • CPU 可用于小规模流程验证,但使用完整样本集训练的速度较慢。
  • DCU 用户必须安装 DTK 和与目标集群兼容的 PyTorch 环境。

下载模型包

hf download OneScience-Group/XPINNs --local-dir ./XPINNs
cd XPINNs

配置运行环境

DCU 环境

# Activate DTK and Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[cfd-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai

GPU 环境

# Activate Conda first
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
pip install onescience[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai

训练数据

模型包包含二维 Poisson 数据文件 data/XPINN_2D_PoissonEqn.mat,其中包含三个子域的内部点、边界点、界面点及精确解。各类训练样本的数量可在 conf/config.yaml 中调整。

训练

python scripts/train.py

默认权重保存到 weight/xpinn_poisson_2d.pt。

模型权重

本仓库在 weight/ 目录中提供使用二维 Poisson 数据集训练的权重。

推理、评估与可视化

训练后运行以下命令。

python scripts/inference.py

脚本报告总体相对 L2 误差,并将精确解、预测和绝对误差图保存至 result/xpinn_poisson_2d.png。模型、数据、损失和推理参数均可在 conf/config.yaml 中修改。

OneScience 官方资源

引用与许可证

  • Jagtap, A. D., Kharazmi, E., and Karniadakis, G. E. Extended Physics-Informed Neural Networks (XPINNs): A Generalized Space-Time Domain Decomposition Based Deep Learning Framework for Nonlinear Partial Differential Equations. Communications in Computational Physics, 28(5), 2002-2041, 2020.
  • 本模型包采用 Apache-2.0 许可证发布,并保留原始论文和数据来源的署名。
Downloads last month
8
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support