Deep Ritz PDE Solver: Deep Ritz Method for Partial Differetial Equations
🪐 A project for solving Partial Differential Equations with Deep Neural Network!
This project is mainly inspired by Deep Ritz Method proposed by E Weinan, et al. And some codes are adopted from
https://github.com/ZeyuJia/DeepRitzMethod
(back to top )
How to use this project?
Install Python and related packages
conda install --file requirements.txt
You should know a little bit about Finite Element Method or Functional Analysis for using this project. The basic procedure is following:
$$
\begin{equation}
\begin{split}
-\sum_{i, k}\partial_i(a_{ik}\partial_ku)+a_0u &= f\quad x\in\Omega,\\
u &= 0\quad x\in\partial\Omega
\end{split}
\end{equation}
$$
the corresponding functional optimization problem is
$$
J[v]=\int_\Omega\Big[\frac{1}{2}\sum_{i,k}a_{ik}\partial_iv\partial_kv +\frac{1}{2}a_0v^2-fv\Big]dx
$$
and the solution satisfies
$$
u = \arg\min_{v\in H} J[v]
$$
Here, $H$ is DNN functional space
Insert Boundary Condition
For a typical machine learning algorithm, loss function is essential, here, we use
$$
\begin{split}
l(u) &= J[u] + \beta \int_{\partial\Omega}|u-u_{\text{bnd}}|^2\textrm dx\\
&= \int_\Omega\Big(\frac{1}{2}\sum_{i,k}a_{i,k}\partial_i u\partial_j u +\frac{1}{2}a_0u^2-fu\Big)\textrm dx + \beta \int_{\partial\Omega}|u-u_{\text{bnd}}|^2\textrm ds
\end{split}
$$
as our loss function
Define the architecture of DNN
We use basic ResNet-like architecture to avoid gradient vanishing, with GELU activation.
In dimension is as same as $\dim \Omega$ , out dimension is set as $1$ (For real-valued equations).
Randomly sample points inside $\Omega$ and $\partial \Omega$ , pass through the NN, and get the output and loss value, use Adam or SGD to take gradient descent.
(back to top )
No further maintenance for this project, you can just fort this project and make changes without contacting me.
(back to top )
Jianting Feng - gianting01@gmail.com
(back to top )