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 the set of fully-connected feedforward neural networks with input dimension , output dimension , and L hidden layers, each constituted of W neurons having σ as activation function. We consider here a neural network to approximate the mapping , where if Y denotes the spatial coordinates , and if Y denotes the space-time coordinates . Once its trainable parameters θ have been fixed, the network gives an approximation of u. The training procedure is as follows:
- 1.
-
Randomly select training parameters , for given.
- 2.
-
For each , set an appropriate discretization of Ω or , and compute a finite element approximation of . 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 , but implies that the discretizations used to compute the finite element solutions are different for each .
- 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 to minimize
Here, the objective function is an averaged sum over the training parameters of in the case of a stationary problem [3], and of 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 simply by from now on. In practice, the Nadam optimizer [19] has been used to find for the numerical experiments presented in the sequel.