Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Hackathon 5th No.58】A physics-informed deep neural network for surrogate modeling in classical elasto-plasticity #701

Merged
merged 14 commits into from
Oct 30, 2023
111 changes: 111 additions & 0 deletions rfcs/Science/20230929_epnn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# EPNN 设计文档
co63oc marked this conversation as resolved.
Show resolved Hide resolved

| | |
| ------------ | -------------------------- |
| 提交作者 | co63oc |
| 提交时间 | 2023-09-29 |
| RFC 版本号 | v1.0 |
| 依赖飞桨版本 | develop/release 2.5.0 版本 |
| 文件名 | 20230929_epnn.md |

## 1. 概述

### 1.1 相关背景

[No.58:A physics-informed deep neural network for surrogate modeling in classical elasto-plasticity](https://github.com/PaddlePaddle/community/blob/master/hackathon/hackathon_5th/%E3%80%90PaddlePaddle%20Hackathon%205th%E3%80%91%E5%BC%80%E6%BA%90%E8%B4%A1%E7%8C%AE%E4%B8%AA%E4%BA%BA%E6%8C%91%E6%88%98%E8%B5%9B%E7%A7%91%E5%AD%A6%E8%AE%A1%E7%AE%97%E4%BB%BB%E5%8A%A1%E5%90%88%E9%9B%86.md#no58a-physics-informed-deep-neural-network-for-surrogate-modeling-in-classical-elasto-plasticity)

在这项工作中,我们提出了一种能够高效逼近经典弹塑性本构关系的深度神经网络架构。该网络富含经典弹塑性的关键物理方面,包括应变添加剂分解为弹性和塑性部分,以及非线性增量弹性。这导致了一个名为 Elasto-Plastic Neural Network (EPNN) 的 Physics-Informed Neural Network (PINN) 代理模型。详细的分析表明,将这些物理嵌入神经网络的架构中,可以更有效地训练网络,同时使用更少的数据进行训练,同时增强对训练数据外加载制度的推断能力。EPNN 的架构是模型和材料无关的,即它可以适应各种弹塑性材料类型,包括地质材料和金属;并且实验数据可以直接用于训练网络。为了证明所提出架构的稳健性,我们将其一般框架应用于砂土的弹塑性行为。我们使用基于相对先进的基于流变性的颗粒材料本构模型的材料点模拟生成的合成数据来训练神经网络。EPNN 在预测不同初始密度砂土的未观测应变控制加载路径方面优于常规神经网络架构。
co63oc marked this conversation as resolved.
Show resolved Hide resolved

参考代码 <https://github.com/meghbali/ANNElastoplasticity>

论文链接 <https://arxiv.org/abs/2204.12088>

### 1.2 功能目标

复现 epnn 模型,并根据代码中提供的数据训练、推理,并合入 PaddleScience

在神经网络中,信息通过连接的神经元流动。神经网络中每个链接的“强度”是由一个可变的权重决定的:

$$
z_l^{\mathrm{i}}=W_{k l}^{\mathrm{i}-1, \mathrm{i}} a_k^{\mathrm{i}-1}+b^{\mathrm{i}-1}, \quad k=1: N^{\mathrm{i}-1} \quad \text { or } \quad \mathbf{z}^{\mathrm{i}}=\mathbf{a}^{\mathrm{i}-1} \mathbf{W}^{\mathrm{i}-1, \mathrm{i}}+b^{\mathrm{i}-1} \mathbf{I}
$$

其中 b 是偏置项;N 为不同层中神经元数量;I 指的是所有元素都为 1 的单位向量。

在目前的工作中,我们复现了一个名为 Elasto-Plastic Neural Network (EPNN) 的简单神经网络,该神经网络结合了与这类塑料材料相关的某些关键物理学原理,并且是针对实验数据进行定制的。所提出的 EPNN 用更灵活的算法替换了传统的屈服函数、塑性势能和塑性流动规则。

### 1.3 意义

复现 epnn 模型,并根据代码中提供的数据训练、推理,并合入 PaddleScience

## 2. PaddleScience 现状

PaddleScience 套件暂无相关模型案例。

## 3. 目标调研
co63oc marked this conversation as resolved.
Show resolved Hide resolved

## 3.1 要解决的问题和使用的方法

在项目中使用弹塑性神经网络解决问题,控制方程为,具体可查看论文 Page 8:

$$
\begin{aligned}
& \dot{\sigma}_{i j}(\mathbf{x})=\Sigma_{i j}\left(\sigma_{i j}(\mathbf{x}), \mathcal{I}(\mathbf{x}), \varepsilon_{i j}(\mathbf{x}), \dot{\varepsilon}_{i j}(\mathbf{x})\right) \quad \forall \mathbf{x} \in \Omega \\
& \frac{\partial \sigma_{i j}(\mathbf{x})}{\partial x_j}+b_i(\mathbf{x})=0 \quad \forall \mathbf{x} \in \Omega \\
& \varepsilon_{i j}(\mathbf{x})=\frac{1}{2}\left(\frac{\partial u_i(\mathbf{x})}{\partial x_j}+\frac{\partial u_j(\mathbf{x})}{\partial x_i}\right) \quad \forall \mathbf{x} \in \Omega \\
& u_i(\mathbf{x})=\bar{u}_i(\mathbf{x}) \quad \forall \mathbf{x} \in \Gamma^{\mathrm{u}} \\
& \sigma_{i j}(\mathbf{x}) n_j(\mathbf{x})=\bar{t}_i(\mathbf{x}) \quad \forall \mathbf{x} \in \Gamma^{\mathrm{t}}
\end{aligned}
$$
co63oc marked this conversation as resolved.
Show resolved Hide resolved

弹塑性网络使用方程组,具体可查看论文 Page 9:

$$
\begin{aligned}
& \dot{\sigma}_{i j}=C_{i j k l}\left(\dot{\varepsilon}_{k l}-\dot{\varepsilon}_{k l}^{\mathrm{p}}\right), \\
& F\left(\sigma_{i j}, \mathcal{H}\right) \leq 0, \\
& \dot{\varepsilon}_{i j}^{\mathrm{p}}=\dot{\lambda} \frac{\partial P\left(\sigma_{i j}, \mathcal{H}\right)}{\partial \sigma_{i j}}, \\
& \dot{\lambda} \geq 0, \quad F \leq 0, \quad \dot{\lambda} F=0, \\
& \dot{\mathcal{H}}=H\left(\mathcal{H}, \sigma_{i j}, \varepsilon_{i j}, \mathcal{I}, \dot{\sigma}_{i j}, \dot{\varepsilon}_{i j}, \dot{\mathcal{I}}\right),
\end{aligned}
$$

## 3.2 复现目标

1. 对齐 loss
2. 对齐预测结果 error 误差
co63oc marked this conversation as resolved.
Show resolved Hide resolved

## 4. 设计思路与实现方案

参考已有代码实现复现 epnn 模型

1. 模型构建
2. 方程构建
3. 计算域构建
4. 约束构建
5. 超参数设定
6. 优化器构建
7. 评估器构建
8. 模型训练、评估

### 4.1 补充说明[可选]


## 5. 测试和验收的考量
co63oc marked this conversation as resolved.
Show resolved Hide resolved

原代码使用脚本 epnn_wrapper.py 运行,精度为 Loss 值 0.098,复现需要达到原有代码精度,并使用 PaddleScience 复现,增加训练和验证集上的 error 值和参数的预测值的对比图。

## 6. 可行性分析和排期规划

参考代码修改为 paddle 实现,使用 PaddleScience API,测试精度对齐。

202309:调研

202310:基于 Paddle API 的复现,基于 PaddleScience 的复现

202311:整理项目产出,撰写案例文档

## 7. 影响面
co63oc marked this conversation as resolved.
Show resolved Hide resolved

在 ppsci.arch 下新增 EPNN 模型。