# Physics-Informed Neural Networks for Modal Wave Field Predictions in 3D Room Acoustics
## 3 Physics-Informed Neural Networks for Wave-Based Room Acoustics  
PINNs combine neural networks and partial differential equations (PDEs) using automatic differentiation and a modified loss function [33]. Figure 1 shows an \(L\)-layer-feed-forward neural network [34; 35] PINN that can solve the Helmholtz Equation (2) with Neumann boundary conditions. The following description gives the mathematical definitions of the individual blocks of the schematic in Figure 1. The prediction behavior of an \(L\)-layer-feed-forward neural network is defined by an operator from the input \(\mathbf{x}\) (spatial locations) to the estimated output (pressure of the acoustic wave field) \(\hat{p}(\mathbf{x})\). Let \(\mathcal{N}(\mathbf{x}):\mathbb{R}^{d_{\mathrm{in}}}\to\mathbb{R}^{d_{\mathrm{out}}}\) be an \(L\)-layer-feed-forward neural network which predicts \(\hat{p}(\mathbf{x})\), with \(N_{\ell}\) neurons in the \(\ell\)-th layer. The argument of the nonlinear activation function \(\sigma\) is a tensor product of a weight matrix and inputs, and a bias vector is added  
\[\sigma\left(\mathbf{W}^{\ell}\sigma\left(\mathcal{N}^{\ell-1}(\mathbf{x})\right)+\mathbf{ b}^{\ell}\right). \tag{8}\]  
The weight matrix in the \(\ell\)-th layer is denoted by \(\mathbf{W}^{\ell}\in\mathbb{R}^{N_{\ell}\times N_{\ell-1}}\) and the bias vector by \(\mathbf{b}^{\ell}\in\mathbb{R}^{N_{\ell}}\), respectively. The feed-forward neural network is recursively defined by \begin{table}
\begin{tabular}{c c c c} \hline \hline \(N_{\mathit{dof}}/\lambda\) & \(\mathbf{e_{\mathrm{rel}}\ \mathrm{in}\ \%}\) & & & **CPU Time** \\  & \(\mathbf{s\to\infty}\) & \(\mathbf{s=1}\) & \(\mathbf{s=0.2}\) & \\ \hline
20 & \(1.3\times 10^{-2}\) & 1.35 & 1.69 & 5 s \\
25 & \(4.5\times 10^{-3}\) & 0.73 & 1.18 & 15 s \\
30 & \(1.8\times 10^{-3}\) & 0.34 & 0.66 & 33 s \\
35 & \(8.0\times 10^{-4}\) & 0.35 & 0.46 & 1 min 11 s \\
40 & \(3.5\times 10^{-4}\) & 0.43 & 0.33 & 3 min 43 s \\
45 & \(1.5\times 10^{-4}\) & 0.22 & 0.20 & 5 min 12 s \\
50 & \(5.0\times 10^{-5}\) & - & - & 15 min 30 s \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Convergence of the finite element results for varying source sharpness parameters \(s\). For \(s\to\infty\), the errors are compared to the analytic case. In the other two cases, the error is compared to the \(N_{\mathit{dof}}/\lambda=50\) case. Figure 1: Schematic representation of a standard PINN. A neural network of L = 3 and N = 4 learns the mapping \(x\to p(x)\). The residual includes the partial differential equation. The neural network trainable parameters are optimized towards the optimal parameters \(\hat{\theta}\). In an outer loop, the network’s hyperparameters are optimized regarding a validation dataset. Input layer: \(\mathcal{N}^{0}(\mathbf{x})=\mathbf{x}\in\mathbb{R}^{d_{\text{in}}}\)  
\[\text{Hidden layers:}\sigma\Big{(}\mathcal{N}^{\ell}(\mathbf{x})\Big{)}=\sigma \Big{(}\mathbf{W}^{\ell}\sigma\Big{(}\mathcal{N}^{\ell-1}(\mathbf{x})\Big{)}+\mathbf{b }^{\ell}\Big{)}\in\mathbb{R}^{N_{\ell}},\quad\text{ for }\quad 1\leq\ell\leq L-1, \tag{9}\]  
\[\text{Output layer:}\ \mathcal{N}^{L}(\mathbf{x})=\mathbf{W}^{L}\sigma\Big{(}\mathcal{N} ^{L-1}(\mathbf{x})\Big{)}+\mathbf{b}^{L}\in\mathbb{R}^{d_{\text{out}}}\,.\]  
In the 3D case, the coordinates of one point \(\mathbf{x}=(x,y,z)\) are provided as the input at the input layer. Defined by the neural network, the output prediction at the output layer \(L\) is calculated by  
\[\hat{p}(\mathbf{x})= W^{L}\sigma(\mathcal{N}^{L-1}(\mathbf{x}))+\mathbf{b}^{L}=\mathbf{W}^{L} \sigma\Big{(}\mathbf{W}^{L-1}\sigma(\mathcal{N}^{L-2}(\mathbf{x}))+\mathbf{b}^{L-1} \Big{)}+\mathbf{b}^{L}=\ldots \tag{10}\] \[= \mathcal{N}^{L}\circ\sigma\circ\mathcal{N}^{L-1}\circ\sigma \circ\cdots\circ\sigma\circ\mathcal{N}^{1}\circ\mathbf{x}=\mathcal{N}(\mathbf{\theta},\mathbf{x})\,, \tag{11}\]  
being a series of consecutive transformation functions of \(\mathcal{N}^{\ell}\) and sigma. The transformation is determined by the nonlinear operation \(\mathcal{N}(\mathbf{\theta},\mathbf{x})\).