Skip to text

2 An adaptive finite elements—neural networks method for the direct problem

Let us recall briefly the numerical method presented in [2], [3] for the solution of the direct problem (1.1). Similarly as in [4], we denote by ΥW,L(σ;din,dout) the set of fully-connected feedforward neural networks with input dimension din, output dimension dout, and L hidden layers, each constituted of W neurons having σ as activation function. We consider here a neural network N∈ΥW,L(σ;din,1) to approximate the mapping (Y;μ)↦u(Y;μ), where din=p+d if Y denotes the spatial coordinates x∈Ω, and din=p+d+1 if Y denotes the space-time coordinates (x,t)∈Ω×(0,T). Once its trainable parameters θ have been fixed, the network gives an approximation uN(·;θ):din→dout of u. The training procedure is as follows:

1.

Randomly select training parameters {μ˜j}j=1Ntrain⊆P, for Ntrain∈N given.

2.

For each μ˜j, set an appropriate discretization of Ω or Ω×[0,T], and compute a finite element approximation uh(·;μ˜j) of u(·;μ˜j). In order to do so, use appropriate a posteriori error analysis to estimate the local error and iteratively obtain the optimal mesh that balances the error over all finite elements (and time steps). This ensures that all the numerical solutions have an accuracy close to a preset tolerance uniformly in P, but implies that the discretizations used to compute the finite element solutions uh(·;μ˜j) are different for each μ˜j.

3.

Set the architecture of the neural network, that is, the number of layers L, the number of nodes per layer W, and the activation function σ.

4.

Choose the trainable parameters θ of N∈ΥW,L(σ;din,1) to minimize

Φ(θ):=LNtrain(uN(·;θ);uh).

Here, the objective function Φ(θ) is an averaged sum over the training parameters of ‖uh(·;μ˜j)−uN(·;μ˜j;θ)‖L2(Ω) in the case of a stationary problem [3], and of ‖uh(·;μ˜j)−uN(·;μ˜j;θ)‖ℓ2((0,T);L2(Ω)) in the case of an evolutive problem [2]. We let θ∗ be the set of parameters obtained by some random gradient descent type algorithm and denote uN(Y;μ;θ∗) simply by uN(Y;μ) from now on. In practice, the Nadam optimizer [19] has been used to find θ∗ for the numerical experiments presented in the sequel.