Meta-learning of Physics-informed Neural Networks for Efficiently
  Solving Newly Given PDEs
We propose a neural network-based meta-learning method to efficiently solve
partial differential equation (PDE) problems. The proposed method is designed
to meta-learn how to solve a wide variety of PDE problems, and uses the
knowledge for solving newly given PDE problems. We encode a PDE problem into a
problem representation using neural networks, where governing equations are
represented by coefficients of a polynomial function of partial derivatives,
and boundary conditions are represented by a set of point-condition pairs. We
use the problem representation as an input of a neural network for predicting
solutions, which enables us to efficiently predict problem-specific solutions
by the forwarding process of the neural network without updating model
parameters. To train our model, we minimize the expected error when adapted to
a PDE problem based on the physics-informed neural network framework, by which
we can evaluate the error even when solutions are unknown. We demonstrate that
our proposed method outperforms existing methods in predicting solutions of PDE
problems.
Tomoharu Iwata, Yusuke Tanaka, Naonori Ueda
# Meta-learning of Physics-informed Neural Networks for Efficiently Solving Newly Given PDEs

###### Abstract

We propose a neural network-based meta-learning method to efficiently solve partial differential equation (PDE) problems. The proposed method is designed to meta-learn how to solve a wide variety of PDE problems, and uses the knowledge for solving newly given PDE problems. We encode a PDE problem into a problem representation using neural networks, where governing equations are represented by coefficients of a polynomial function of partial derivatives, and boundary conditions are represented by a set of point-condition pairs. We use the problem representation as an input of a neural network for predicting solutions, which enables us to efficiently predict problem-specific solutions by the forwarding process of the neural network without updating model parameters. To train our model, we minimize the expected error when adapted to a PDE problem based on the physics-informed neural network framework, by which we can evaluate the error even when solutions are unknown. We demonstrate that our proposed method outperforms existing methods in predicting solutions of PDE problems.

## 1 Introduction

Partial differential equations (PDEs) have been used in many areas of science and engineering for modeling physical [13, 1], biological [8], and finaicial [4] systems. The finite element method (FEM) [19] is the standard method for numerically solving PDEs. Recently, physics-informed neural networks (PINNs) [17, 11] have been attracting attention as a machine learning approach for solving PDEs. However, both methods are computationally expensive. In addition, they solve PDE problems from scratch even when similar PDE problems have been solved before.

In this paper, we propose a meta-learning method for efficiently solving PDEs. The proposed method learns how to solve PDEs with our neural network-based model using many PDE problems, and uses the knowledge for solving newly given PDE problems. Figure 1 shows the framework of the proposed method. Our model takes a PDE problem and a point as input, and outputs a predicted solution at the point of the PDE problem. The neural networks are shared across problems, by which we can accumulate the knowledge of solving various problems in their parameters. Although meta-learning methods for PINNs have been proposed [2, 16, 7, 14], these existing methods transfer knowledge within a PDE problem with different physical parameters and/or different boundary conditions. On the other hand, the proposed method can transfer knowledge across different PDE problems if their governing equations are formulated as polynomial functions of partial derivatives.

In our model, we encode a PDE problem by neural networks. Each PDE problem consists of a governing equation and boundary conditions. We assume PDE problems with a governing equation defined by a polynomial function of partial derivatives, and Dirichlet boundary conditions. Many real-world PDE problems satisfy this assumption. Coefficients of
the polynomial are used as the representation of a governing equation, by which we can encode a governing equation by a fixed size of a vector. Dirichlet boundary conditions are represented by a set of pairs of points and their conditions, where points are randomly generated on the boundaries. Using such sets, we can encode boundary conditions flexibly, even when boundary shapes and/or conditions differ across problems. The set is transformed into a fixed size of a boundary representation vector using a permutation invariant neural network. A problem representation is obtained by a neural network from the governing equation coefficients and boundary representation. By feeding the problem representation and a point into a neural network, we can output a problem-specific solution. When a PDE problem is newly given, our model can efficiently predict its solution by only the forwarding process of the neural networks without updating parameters.

To train our model, we minimize the expected error of predicted solutions when adapted to each PDE problem. The error is calculated using the PINN framework, which enables us to evaluate the error using governing equations and boundary conditions even when their solutions are unknown. It is essential for efficient meta-learning since obtaining solutions for many problems is very expensive to compute. The expectation is approximated by the Monte Carlo method, where PDE problems are randomly generated. In the proposed method, the meta-training data can be generated unlimitedly since we do not need any observational data. It is preferable since the performance of neural networks generally improves as the number of training data increases [10]. The meta-learned model can be finetuned to a PDE problem, by which we can improve the approximation performance of the solution.

The main contributions of this paper are as follows: 1) We present a meta-learning method for solving a broad class of PDE problems based on PINNs, where governing equations and boundary conditions are different across problems. 2) We propose a neural network-based model that takes a PDE problem and a point as input and outputs its solution. 3) We experimentally demonstrate that the proposed method can predict solutions of newly given PDE problems in about a second, and its performance is better than the existing methods.

## 2 Related work

Several meta-learning methods for PINNs have been proposed, such as Meta-PDE [16], HyperPINN [2], and Meta-auto-decoders [7]. Meta-PDE [16] meta-learns PINNs using model-agnostic meta-learning [5], where initial neural network parameters are trained such that it achieves good performance with gradient descent updates. Since backpropagation through such procedures is costly in terms of memory, the total number of updates must be kept small. It is difficult to adapt to a wide range of PDE problems with a small number of updates from a single initialization. HyperPINN [2] is a hyper-network that generates a PINN given a PDE problem. Meta-auto-decoders [7] implicitly encode PDE problems into vectors, and feed the encoded vectors to a PINN to predict their solutions. These existing methods share knowledge across a narrow range of PDE problems, e.g., the Burgers' equation with different parameters with a fixed boundary condition. In contrast, the proposed method shares the knowledge across different classes of PDE problems by considering a general form of governing equations and representing boundary conditions by a set of boundary points and their solutions. When PDE problems are encoded implicitly as in Meta-auto-decoders, the required memory linearly increases as the number of training PDE problems increases, which prohibits to use a huge amount of PDE problems for training. On the other hand, since the proposed method explicitly encodes PDE problems using neural networks, the

Figure 1: Our meta-learning framework. Left) In the meta-training phase, our neural network-based model is trained using many PDE problems with various governing equations and boundary conditions. Right) In the meta-test phase, we are given new PDE problems. The trained model is adapted to each PDE problem. The adapted model outputs approximated problem-specific solution \(\hat{u}\) at point \(\mathbf{x}\).
memory cost does not depend on the number of training PDE problems, and we can use an unlimited number of PDE problems for training.

The proposed method uses an encoder-decoder style meta-learning [20], or in-context learning [3], approach as with neural processes [6], where neural networks are used for encoding problem (task) representations and for decoding solutions. This approach approximates problem adaptation with neural networks, and does not require gradient descent iterations for problem adaptation, which enables us to perform meta-learning and inference efficiently.

## 3 Preliminaries

### PDE problem

We consider the following parametric PDE problem on domain \(\Omega^{(s)}\subset\mathbb{R}^{D}\) with boundary \(\partial\Omega^{(s)}\),

\[\mathcal{F}^{(s)}[u^{(s)}(\mathbf{x})]=0,\quad\mathbf{x}\in\Omega^{(s)},\qquad u ^{(s)}(\mathbf{x})=g^{(s)}(\mathbf{x}),\quad\mathbf{x}\in\partial\Omega^{(s)}, \tag{1}\]

where \(s\) is the index of the PDE problem, \(\mathcal{F}^{(s)}\) is the governing equation operator that involve \(u\) and partial derivatives of \(u\) with respect to point \(\mathbf{x}\), \(u^{(s)}(\mathbf{x})\) is the hidden solution, and \(g^{(s)}(\mathbf{x})\) is the Dirichlet boundary condition. Each PDE problem has its own governing equation, boundary condition, domain, boundary, and hidden solution. For example, in the case of the Burgers' equation with point \(\mathbf{x}=(t,x)\), the governing equation is \(\mathcal{F}^{(s)}=u_{t}+uu_{x}-\alpha u_{xx}\), and the boundary condition can be \(g^{(s)}(\mathbf{x})=-\sin(\pi x)\) if \(t=0\), and \(g^{(s)}(\mathbf{x})=0\) if \(x=-1\) or \(x=1\).

### Physics-informed neural networks

PINNs approximate the solution of a PDE problem using neural network \(\hat{u}^{(s)}(\mathbf{x};\boldsymbol{\theta})\). Here, \(\boldsymbol{\theta}\) is the parameters, and the neural network takes point \(\mathbf{x}\) as input, and outputs the predicted solution. The parameters are trained by minimizing the following objective function:

\[\hat{\boldsymbol{\theta}}=\operatorname*{arg\,min}_{\boldsymbol{\theta}}\frac {1}{N_{\text{f}}}\sum_{n=1}^{N_{\text{f}}}\parallel\mathcal{F}^{(s)}\big{(} \hat{u}^{(s)}(\mathbf{x}_{tn};\boldsymbol{\theta})\big{)}\parallel^{2}+\frac{ 1}{N_{\text{g}}}\sum_{n=1}^{N_{\text{g}}}\parallel g(\mathbf{x}_{\text{gn}})- \hat{u}^{(s)}(\mathbf{x}_{\text{gn}};\boldsymbol{\theta})\parallel^{2}, \tag{2}\]

where \(\{\mathbf{x}_{tn}\}_{n=1}^{N_{\text{f}}}\) is a set of randomly sampled points in domain \(\Omega^{(s)}\), and \(\{\mathbf{x}_{\text{gn}}\}_{n=1}^{N_{\text{g}}}\) is a set of randomly sampled points on boundary \(\partial\Omega^{(s)}\). The first and second terms enforce to satysify governing equation \(\mathcal{F}^{(s)}\) and boundary condition \(g^{(s)}\), respectively. We call the objective function in Eq. (2) the PINN error.

## 4 Proposed method

### Problem formulation

We consider parametric PDE problems described in Section 3.1. Governing equations \(\mathcal{F}^{(s)}\) for all problems are assumed to be a polynomial function of partial derivatives with a constant driving term, where the maximum degree of the polynomial is \(C\), and the maximum order of the derivatives is \(J\). In our experiments, we consider \(D=2\), \(C=2\), and \(J=2\). Many widely-used PDEs are included in this PDE class, such as Burgers' equation, \(u_{t}+uu_{x}-\alpha u_{xx}=0\), Fisher's equation, \(u_{t}-\alpha_{1}u_{xx}-\alpha_{2}u(1-u)=0\), Hunter-Saxton equation, \(u_{tx}+u_{x}u_{xx}-\alpha u_{x}^{2}=0\), heat equation, \(u_{t}-u_{xx}=0\), Laplace's equation, \(u_{xx}+u_{yy}=0\), and wave equation, \(u_{tt}-\alpha u_{xx}=0\). Unlike governing equations \(\mathcal{F}^{(s)}\), boundary condition \(g^{(s)}\) is difficult to assume a specific functional form in real-world PDE problems. Therefore, we do not assume such assumptions on the boundary condition. Our aim is to predict solutions efficiently of newly given PDE problems with a neural network by meta-learning from various PDEs.

### Model

Our neural network-based model outputs prediction of the problem-specific solution \(\hat{u}\) at point \(\mathbf{x}\) that is adapted to the given PDE problem with governing equation \(\mathcal{F}^{(s)}\), boundary \(\partial\Omega^{(s)}\), and boundary condition \(g^{(s)}\). Figure 2 illustrates our model.

Since we assume that the governing equation is a \(C\)th-degree polynomial of \(J\)th-order partial derivatives with \(D\)-dimensional point, it can be written in a general form of the polynomial. For example, in the case with \(D=2\) with
point \(\mathbf{x}=(t,x)\), the general form is given by

\[\mathcal{F}^{(s)}=\sum_{c_{1}+c_{2}+c_{3}+c_{4}+c_{5}+c_{6}\in\{0,1,\dots,C\}} \alpha_{c_{1}c_{2}c_{3}c_{4}c_{5}c_{4}}^{(s)}u^{c_{1}}u^{c_{2}}_{t}u^{c_{3}}_{ t}u^{c_{4}}_{tx}u^{c_{5}}_{xx}u^{c_{6}}_{xx}, \tag{3}\]

where \(\alpha_{c_{1}c_{2}c_{3}c_{4}c_{5}c_{6}}^{(s)}\in\mathbb{R}\) is the coefficient, and the degree for each term is \(C\) at most. Let \(\boldsymbol{\alpha}^{(s)}\) be a vector of coefficients \(\{\alpha_{c}^{(s)}\}\). The dimension of \(\boldsymbol{\alpha}^{(s)}\) is \(\binom{(D^{+}_{J})^{+}C}{C}\), where \(\binom{D+J}{J}\) is the number of partial derivatives \(\{u,u_{t},u_{x},\dots\}\). Governing equations with a lower degree of polynomial, lower order of partial derivatives, or lower dimensional points can be represented by setting zero to the corresponding coefficients. Our model uses the coefficients \(\boldsymbol{\alpha}^{(s)}\) as the governing equation representation.

We introduce boundary condition \(g^{(s)}\) into our model by representing it by a set of the boundary condition data at randomly sampled points. In particular, we randomly generate \(N_{\text{g}}\) points at boundary \(\partial\Omega^{(s)}\), \(\mathbf{X}_{\text{g}}=\left\{\mathbf{x}_{\text{gn}}\right\}_{n=1}^{N_{\text{g}}}\), and evaluate the solution at the boundary points, \(\{g^{(s)}(\mathbf{x}_{\text{gn}})\}_{n=1}^{N_{\text{g}}}\). The set of pairs \(\{(\mathbf{x}_{\text{gn}},g^{(s)}(\mathbf{x}_{\text{gn}}))\}_{n=1}^{N_{\text{g }}}\) are transformed into boundary representation \(\boldsymbol{\beta}^{(s)}\) using the following permutation invariant neural network [21]:

\[\boldsymbol{\beta}^{(s)}=\mathrm{NN}_{\mathrm{b}2}\left(\frac{1}{N_{\text{g}} }\sum_{n=1}^{N_{\text{g}}}\mathrm{NN}_{\mathrm{b}1}\left(\mathbf{x}_{\text{ gn}},g^{(s)}(\mathbf{x}_{\text{gn}})\right)\right), \tag{4}\]

where \(\mathrm{NN}_{\mathrm{b}1}\) and \(\mathrm{NN}_{\mathrm{b}2}\) are feed-forward neural networks. The output of the neural network in Eq. (4) is invariant even when the elements are permuted, which is desirable since the order of the randomly sampled points should not depend on the boundary representation. In addition, the neural network can take any number of points, \(N_{\text{g}}\), as input. With sampled points at problem-specific boundary \(\partial\Omega^{(s)}\), the boundary representation can consider not only the solution at the boundary but also the shape of the boundary.

Problem representation \(\mathbf{z}^{(s)}\) is obtained by a neural network from coefficients \(\boldsymbol{\alpha}^{(s)}\) and boundary representation \(\boldsymbol{\beta}^{(s)}\) as follows:

\[\mathbf{z}^{(s)}=\mathrm{NN}_{\mathbf{z}}(\boldsymbol{\alpha}^{(s)}, \boldsymbol{\beta}^{(s)}), \tag{5}\]

where \(\mathrm{NN}_{\mathbf{z}}\) is a feed-forward neural network.

Solution \(\hat{u}\) at point \(\mathbf{x}\) of PDE problem \(s\) is predicted by inputting its problem representation \(\mathbf{z}^{(s)}\) to a neural network as follows:

\[\hat{u}\left(\mathbf{x},\mathcal{F}^{(s)},g^{(s)},\mathbf{X}_{\text{g}}; \boldsymbol{\Theta}\right)=\mathrm{NN}_{\mathbf{u}}(\mathbf{x},\mathbf{z}^{(s )}), \tag{6}\]

where \(\mathrm{NN}_{\mathbf{u}}\) is a feed-forward neural network, and \(\boldsymbol{\Theta}\) is unknown parameters in our model to be trained, which are the parameters in neural networks \(\mathrm{NN}_{\mathrm{b}1}\), \(\mathrm{NN}_{\mathrm{b}2}\), \(\mathrm{NN}_{\mathbf{z}}\), and \(\mathrm{NN}_{\mathrm{u}}\). All of the parameters are shared across different PDE

Figure 2: Our model outputs predicted solution \(\hat{u}\) at point \(\mathbf{x}\) given governing equation \(\mathcal{F}^{(s)}\), boundary \(\partial\Omega\), and boundary condition \(g^{(s)}\). 1) Governing equation \(\mathcal{F}^{(s)}\) is represented by its coefficients \(\boldsymbol{\alpha}^{(s)}\). 2) Points at boundary \(\partial\Omega^{(s)}\) are randomly generated. 3) Each pair of boundary point \(\mathbf{x}_{\text{gn}}\) and its condition \(g^{(s)}(\mathbf{x}_{\text{gn}})\) is transformed into a vector by neural network \(\mathrm{NN}_{\mathrm{b}1}\). 4) These vectors are averaged, and then transformed to boundary representation \(\boldsymbol{\beta}^{(s)}\) by neural network \(\mathrm{NN}_{\mathrm{b}2}\). 5) Coefficients \(\boldsymbol{\alpha}^{(s)}\) and boundary representation \(\boldsymbol{\beta}^{(s)}\) are transformed into problem representation \(\mathbf{z}^{(s)}\) by neural network \(\mathrm{NN}_{\mathrm{z}}\). 6) Using the problem representation, solution \(\hat{u}\) at point \(\mathbf{x}\) is predicted by neural network \(\mathrm{NN}_{\mathrm{u}}\). Shaded circles represent given information. Unshared circles represent variables calculated by our model. Rectangles represent operations in our model.
problems, by which we can learn how to solve various PDE problems and use the knowledge for newly given PDE problems. By taking governing problem representation \(\mathbf{z}^{(s)}\) as input, our model can output a problem-specific solution that depends on given governing equation \(\mathcal{F}^{(s)}\), boundary \(\partial\Omega^{(s)}\), and boundary condition \(g^{(s)}\).

### Meta-learning

We estimate unknown parameters \(\mathbf{\Theta}\) by minimizing the expected PINN error over PDE problems as follows:

\[\hat{\mathbf{\Theta}}=\operatorname*{arg\,min}_{\mathbf{\Theta}} \mathbb{E}_{s}\Bigg{[}\mathbb{E}_{\mathbf{x}_{\mathbf{z}}\in\partial\Omega^{(s )}N_{\text{g}}}\bigg{[}\,\parallel\mathcal{F}^{(s)}\left(\hat{u}^{(s)}( \mathbf{x}_{\text{f}},\mathcal{F}^{(s)},g^{(s)},\mathbf{X}_{\text{g}})\right) \,\parallel^{2}\,\bigg{]}\] \[+\frac{1}{N_{\text{g}}}\sum_{n=1}^{N_{\text{g}}}\parallel g( \mathbf{x}_{\text{gn}})-\hat{u}^{(s)}(\mathbf{x}_{\text{gn}},\mathcal{F}^{(s) },g^{(s)},\mathbf{X}_{\text{g}})\parallel^{2}\,\bigg{]}\Bigg{]}, \tag{7}\]

where \(\mathbb{E}_{s}\) is the expectation over PDE problems, \(\mathbb{E}_{\mathbf{X}_{\text{g}}\in\partial\Omega^{(s)}N_{\text{g}}}\) is the expectation over sets of boundary points \(\mathbf{X}_{\text{g}}\) at boundary \(\partial\Omega^{(s)}\), \(\mathbb{E}_{\mathbf{x}_{\mathbf{z}}\in\Omega^{(s)}}\) is the expectation over points \(\mathbf{x}_{\text{f}}\) in domain \(\Omega^{(s)}\), the first term is the discrepancy between governing equation \(\mathcal{F}^{(s)}\) and our model \(\hat{u}\) at point \(\mathbf{x}_{\text{f}}\), and the second term is the discrepancy between boundary condition \(g^{(s)}\) and the prediction by our model \(\hat{u}\) at boundary points \(\mathbf{X}_{\text{g}}\). Partial differentiation \(\mathcal{F}^{(s)}(\hat{u}^{(s)})\) of our model is calculated by automatic differentiation [15]. By using the PINN error in Eq. (7), we can meta-learn our model by feeding PDE problems without their solutions.

Algorithm 1 shows the meta-learning procedures of our model. The expectations are approximated with the Monte Carlo method by randomly sampling PDE problems at Lines 2-4, and sampling points at Lines 5 and 6. The algorithm requires a random generator for governing equation coefficients, domains, boundaries, and boundary conditions, by which we can specify a class of PDE problems we can solve. Since our model is differentiable, we can update parameters \(\mathbf{\Theta}\) using a stochastic gradient descent method [12]. By minimizing the expected error with Eq. (7), the generalization performance for unseen PDE problems can be improved. We can generate training data unlimitedly since the proposed method does not require any observational data.

### Finetuning

The performance of our trained model on a PDE problem can be evaluated instantly using the PINN error. For applications that require low errors, we can improve the approximation performance of the predicted solution by our model with finetuning [7]. Suppose that our model is pretrained using various PDE problems with the procedures described in Section 4.3. First, given a PDE problem, we calculate its problem representation \(\mathbf{z}^{(s)}\) using pretrained neural networks \(\mathrm{NN_{b1}}\), \(\mathrm{NN_{b2}}\), and \(\mathrm{NN_{z}}\). Next, we finetune the parameters of neural network \(\mathrm{NN_{u}}\), and problem
representation \(\mathbf{z}^{(s)}\) by minimizing the PINN error while fixing \(\mathrm{NN_{b1}}\), \(\mathrm{NN_{b2}}\), and \(\mathrm{NN_{z}}\) as follows:

\[\hat{\mathbf{\theta}}_{\mathrm{u}}^{(s)},\hat{\mathbf{z}}^{(s)}=\underset{ \mathbf{\theta}_{\mathrm{u}}\mathbf{z}^{(s)}}{\arg\min} \frac{1}{N_{\mathrm{f}}}\sum_{n=1}^{N_{\mathrm{f}}}\parallel\mathcal{F}^{ (s)}\big{(}\mathrm{NN_{u}}(\mathbf{x}_{\mathrm{fn}},\mathbf{z}^{(s)};\mathbf{ \theta}_{\mathrm{u}})\big{)}\parallel^{2}\] \[+\frac{1}{N_{\mathrm{g}}}\sum_{n=1}^{N_{\mathrm{g}}}\parallel g( \mathbf{x}_{\mathrm{gn}})-\mathrm{NN_{u}}(\mathbf{x}_{\mathrm{gn}},\mathbf{z}^ {(s)};\mathbf{\theta}_{\mathrm{u}})\parallel^{2}, \tag{8}\]

where \(\mathbf{\theta}_{\mathrm{u}}\) is the parameters in \(\mathrm{NN_{u}}\), \(\{\mathbf{x}_{\mathrm{fn}}\}_{n=1}^{N_{\mathrm{f}}}\) and \(\{\mathbf{x}_{\mathrm{gn}}\}_{n=1}^{N_{\mathrm{g}}}\) are sets of randomly sampled points in domain \(\Omega^{(s)}\) and boundary \(\partial\Omega^{(s)}\), respectively. Here, \(\mathbf{\theta}_{\mathrm{u}}\) is initialized by the pretrained model, and \(\mathbf{z}^{(s)}\) is initialized by the obtained problem representation in the first step. Using these initializations, we can incorporate meta-learned knowledge for solving PDE problems. We do not need to finetune neural networks \(\mathrm{NN_{b1}}\), \(\mathrm{NN_{b2}}\), and \(\mathrm{NN_{z}}\) by finetuning problem representation \(\mathbf{z}^{(s)}\). Finetuning the problem representation is effective since the number of parameters in the problem representation is much smaller than the number of parameters in these neural networks.

## 5 Experiments

### Settings

We evaluated the proposed method using PDE problems with point \(\mathbf{x}=(t,x)\) of dimension \(D=2\), maximum degree of the polynomial \(C=2\), and maximum order of the derivatives \(J=2\). In this case, the dimension of coefficient vector \(\mathbf{\alpha}^{(s)}\) was 28. Each coefficient \(\alpha_{c}^{(s)}\) was set at zero with probability 0.75 and otherwise sampled uniformly from \([-1,1]\). The domains for all PDE problems were identical with \(t\in[0,1]\) and \(x\in[-1,1]\). The boundary conditions at \(x=-1\) and \(x=1\) were fixed at \(g^{(s)}(t,-1)=g^{(s)}(t,1)=0\) for all problems. The boundary conditions at \(t=0\) (or initial condition) depended on the problem, where \(g^{(s)}(0,x)=(x-1)(x+1)(r_{1}^{(s)}x^{2}+r_{2}^{(s)}x+r_{3}^{(s)})\), and \((r_{1}^{(s)},r_{2}^{(s)},r_{3}^{(s)})\) were problem-specific coefficients sampled uniform randomly from \([-1,1]\).

### Compared methods

We compared the proposed method with the neural process (NP) [6], model-agnostic meta-learning (MAML) [5], and multi-task learning (MT). All methods are trained by minimizing the expected PINN loss. The NP uses a neural network that takes boundary condition information and a point as input, and outputs a predicted solution at the point. NP corresponds to the proposed method without governing equation information. MAML and MT use neural networks that take a point as input, and outputs a predicted solution at the point, as with the PINN. In MAML, the initial values of the model parameters are estimated such that the expected PINN loss is minimized when adapted by gradient descent. In MT, the model parameters are estimated by minimizing the expected PINN loss without problem adaptation.

### Implementation

We used the same architecture of neural networks for all methods when applicable. For \(\mathrm{NN_{b1}}\) and \(\mathrm{NN_{b2}}\), we used four-layered feed-forward neural networks with 256 hidden and output units. For the input of \(\mathrm{NN_{b1}}\), boundary point \(\mathbf{x}_{gn}\) and it solution \(g^{(s)}(\mathbf{x}_{gn})\) were concatenated. In \(\mathrm{NN_{z}}\), coefficients \(\mathbf{\alpha}^{(s)}\) were transformed by a four-layered feed-forward neural network with 256 hidden and output units, its output was concatenated with boundary representation \(\mathbf{\beta}^{(s)}\), and then transformed into problem representation \(\mathbf{z}^{(s)}\) by a linear layer with 256 output units. In \(\mathrm{NN_{u}}\), point \(\mathbf{x}\) was transformed by a linear layer with 256 output units, its output was concatenated with problem representation \(\mathbf{z}^{(s)}\), and then transformed by a five-layered neural network with 256 hidden units. All hidden layers had residual connections. We used sinusoidal activation functions [18] in \(\mathrm{NN_{u}}\), and rectified linear activation functions in the other neural networks. With NP, the output of \(\mathrm{NN_{b2}}\) was used as problem representation \(\mathbf{z}^{(s)}\). In \(\mathrm{NN_{u}}\) of MAML and MT, there was no concatenation with problem representation \(\mathbf{z}^{(s)}\). In MAML, for adapting to each PDE problem, we used one step of the gradient descent with learning rate \(10^{-2}\), where a computational graph with more than one steps for the adaptation could not stored in memory.

In all methods, PDE problems were randomly generated in each meta-learning iteration based on the settings described in the first paragraph of Section 5. For evaluating the governing equation error at Line 7 in Algorithm 1, we used \(N_{\mathrm{f}}=50\) uniform ramdomly sampled points in the domain. For evaluating the boundary condition error at Line 8, we used \(N_{\mathrm{g}}=100\) randomly sampled points on the boundary. In particular, we used 50 initial points at \(t=0\), and 25 boundary points at \(x=-1\) and \(x=1\), respectively. The number of epochs was 30,000, where each epoch consisted of
9,800 PDE problems. We optimized using Adam [12] with initial learning rate \(10^{-3}\), which was decayed by half for every 5,000 epochs. In a mini-batch, we used 512 PDE problems. We implemented all methods with PyTorch [15].

For the evaluation measurement, we used the PINN error in Eq (2), the governing equation (GE) error, which is the first term in Eq (2), and boundary condition (BC) error, which is the second term in Eq (2). The errors were evaluated on 100 PDE problems, where we used \(N_{\text{f}}=10000\) sampled points in the domain, and \(N_{\text{g}}=100\) sampled points on the boundary.

### Results

Table 1 shows the average error. The proposed method achieved the best performance in terms of not only the total PINN error but also the governing equation and boundary condition errors. The error by NP was higher than that by the proposed method. This result indicates the effectiveness of including governing equation information in the proposed method. Since MAML could not perform many gradient descent steps for problem adaptation, the error was high. On the other hand, the proposed method approximates problem adaptation with neural networks, and the neural networks are trained with many randomly generated problems, it achieved a low error. Since MT does not output problem-specific solutions, its error was high.

Figure 3 shows examples of approximated solutions by the proposed method, NP, and MAML. The proposed method's outputs were more similar to the solution than the other methods. The proposed method predicted different patterns of solutions depending on the given PDE problems without any problem-specific parameter updates.

Table 2 shows the computation time in hours for meta-learning of 30,000 epochs using computers with Tesla v100 GPU, Xeon Gold 6148 2.40GHz, and 512GB memory. Since MAML requires gradient descent steps for problem adaptation in each meta-learning iteration, it took a longer time. MT does not have neural networks for calculating problem representations, which resulted in a shorter meta-training time.

Table 3 shows the average computation time in seconds for predicting solutions of at 10,000 points in the domain and 100 points on the boundary using computers with Xeon Gold 6130 CPU 2.10GHz and 256GB memory without GPU. The proposed method can predict solutions of newly given PDE problems in about a second. The solutions in Figure 3 were calculated by the PINN with 30,000 training epochs, which took 27.7 hours per PDE problem on average.

In the proposed method, we randomly generate PDE problems for each meta-learning iteration as described in Algorithm 1. Table 4 shows the PINN errors when we used a fixed number of PDE problems \(\{1000,2000,4000,6000,8000\}\) for meta-training in the proposed method. When our model is trained with a fixed set of PDE problems, even when many (8,000) PDE problems were used, the performance was low. This result indicates the importance of using a wide variety of PDE problems for meta-learning by random sampling. In our model, since we use neural networks to obtain problem representations given PDE problems, we can use different PDE problems in each iteration for meta-learning. On the other hand, implicit encoding of problem representation in Meta-Auto-Decoder [7] requires to infer the representation for each meta-learning PDE problem, which prohibits to use randomly generated problems for each iteration.

Figure 4 shows the PINN errors when finetuned for each PDE problem. Here, PINN represents the physics-informed neural network with the same architecture as MAML and MT, where its parameters were initialized randomly. The

\begin{table}
\begin{tabular}{l c c c c} \hline  & Ours & NP & MAML & MT \\ \hline PINN error & **0.034 \(\pm\) 0.004** & 0.157 \(\pm\) 0.026 & 0.131 \(\pm\) 0.021 & 0.201 \(\pm\) 0.025 \\ GE error & **0.009 \(\pm\) 0.001** & 0.089 \(\pm\) 0.025 & 0.062 \(\pm\) 0.018 & 0.082 \(\pm\) 0.023 \\ BC error & **0.024 \(\pm\) 0.003** & 0.068 \(\pm\) 0.005 & 0.069 \(\pm\) 0.006 & 0.119 \(\pm\) 0.009 \\ \hline \end{tabular}
\end{table}
Table 1: Average PINN errors, governing equation (GE) errors, and boundary condition (BC) errors with their standard errors. Values in bold typeface are not statistically significantly different at the 5% level from the best performing method in each row according to a paired t-test.

\begin{table}
\begin{tabular}{l c c c} \hline Ours & NP & MAML & MT \\ \hline
1.457 \(\pm\) 0.015 & 1.468 \(\pm\) 0.013 & 7.030 \(\pm\) 0.067 & 1.287 \(\pm\) 0.016 \\ \hline \end{tabular}
\end{table}
Table 2: Computation time in hours for meta-learning.

\begin{table}
\begin{tabular}{l c c c} \hline  & Ours & NP & MAML & MT \\ \hline
51.1 & 50.2 & 209.2 & 37.2 \\ \hline \end{tabular}
\end{table}
Table 3: Average computation times in seconds for predicting solutions at 10,100 points, and their standard errors.
Figure 3: Approximated solutions by the proposed method (Ours), NP, and MAML for six PDE problems. The equations show the governing equations. The value below the figure shows the PINN error. The left column (Solution) shows the solutions by PINNs with 30,000 training epochs for each problem.
proposed method achieved a low error with finetuning. Since NP and MAML were meta-learning methods, their errors were lower than PINN but higher than the proposed method. The error by MT without finetuning was lower than PINN, but after a few dozen finetuning epochs, PINN outperformed MT. Since MT does not have problem-specific parameters, it is difficult for MT to adapt to various PDE problems flexibly. In contrast, since the proposed method has a problem representation to be finetuned, it outperformed MT. The performance by the proposed method without any finetuning was comparable to PINN with 94 finetuning epochs, which took 312 seconds on average.

## 6 Conclusion

In this paper, we proposed a meta-learning method for solving PDE problems based on physics-informed neural networks. Although we believe that our work is an important step for accumulating reusable knowledge of efficiently solving PDE problems, we must extend our approach in several directions. First, we plan to enlarge the class of governing equations by encoding their mathematical expressions using neural networks [9]. Second, we will use our method for discovering governing equations from observational data by estimating the coefficients of governing equations in our model.
