# Topology Optimisation under Uncertainties with Neural Networks
## 3 Neural Network Architectures
### Topology Convolutional Neural Networks (TCNN)
#### 3.1.2 Data Preparation  
On the algorithmic level, our goal is to replace the computationally costly lines 5 and 6 of all \(c_{m}\in\mathbb{N}\) loop iterations of Algorithm A1 with a TCNN. This is not directly possible (at least for a TCNN) since the input space \(\mathbb{R}^{\mathbb{C}_{\text{in}}\times H\times W}\) of a TCNN does not match the mesh \(\mathcal{T}_{m}\) on which the finite element discretisation and thus the optimisation of \(\varphi_{n}\) takes place in the current optimisation step \(t\). Hence, it is necessary to project the evaluation of \(\varphi\) onto the format of a CNN. For this we define a transformation between \(\mathbb{R}^{|V(\mathcal{T}_{m})|\times C_{\text{in}}}\) and the input tensor \(\mathbb{R}^{H\times W\times C_{m}}\) of \(\mathcal{N}_{\text{CNN}}\). As described in Appendix B, we do not assume that the mesh \(\mathcal{T}_{m}\) stays fixed in the optimisation algorithm and we instead generate a sequence of different meshes \(\mathcal{T}_{m}\) by some adaptive mesh refinement, which has led to significant efficiency improvements in [1]. To obtain unique transformations between the discretisation  
Figure 1: Visualisation of the TCNN from Example 1.  
finite element space and the input space of the NN, one can interpolate the current solutions of \(\varphi_{n}\) and \(u_{n+1}\) from \(\mathcal{T}_{m}\) onto a constant reference mesh \(\mathcal{T}_{\text{const}}\) by polynomial interpolations  
\[p:\mathbb{R}^{|V(\mathcal{T}_{m})|\times C_{\text{in}}}\to \mathbb{R}^{H\cdot W\times C_{\text{in}}},\] \[q:\mathbb{R}^{H\cdot W\times C_{\text{out}}}\to\mathbb{R}^{|V( \mathcal{T}_{m})|\times C_{\text{out}}}.\]  
Hence, during the optimisation, the current solutions are interpolated via the operator \(p\) to the reference mesh, rendering the prediction independent from the actual adaptive mesh. After the \(\mathcal{N}_{\text{CNN}}\) prediction of the gradient step on the reference mesh, it is mapped back to the actual computation mesh via \(q\). Consequently, we define the reference mesh \(\mathcal{T}_{\text{const}}=(V(\mathcal{T}_{\text{const}}),E(\mathcal{T}_{ \text{const}}))\) with vertices \(V\) and edges \(E\) as a graph such that \(|V(\mathcal{T}_{\text{const}})|=H\cdot W\). Each node \(v_{i}\in V(\mathcal{T}_{\text{const}})\) corresponds to the values of \(\varphi_{n}^{i}=\varphi_{n}(v_{i})\in\mathbb{R}\) and \(u_{n}^{i}=u_{n}(v_{i})\in\mathbb{R}^{d}\), \(i\leq H\cdot W=|V(\mathcal{T}_{\text{const}})|\) at node \(v_{i}\). The features of the nodes can hence be interpreted as rows of a feature matrix,  
\[\widetilde{\mathcal{T}}_{n}= \begin{bmatrix}\varphi_{1}&u_{1}\\ \vdots&\vdots\\ \varphi_{n_{H\cdot W}}&u_{n_{H\cdot W}}\end{bmatrix} \in\mathbb{R}^{H\cdot W \times C_{in}}. \tag{19}\]  
The structure of \(\mathcal{T}_{\text{const}}\) is illustrated in Figure 2.  
One can now define a transformation between \(\mathbb{R}^{H\cdot W\times C_{in}}\) and \(\mathbb{R}^{C_{in}\times H\times W}\) by  
\[\Phi_{C_{in}}:\mathbb{R}^{H\cdot W\times C_{\text{in}}}\to \mathbb{R}^{C_{\text{in}}\times H\times W}, \tag{20}\] \[\Phi_{C_{\text{out}}}:\mathbb{R}^{C_{\text{out}}\times H\times W} \to\mathbb{R}^{H\cdot W\times C_{\text{out}}}.\]  
Hence, the approximation of the gradient step 6 of Algorithm 1 is basically a coupling of the mappings \(p\), \(\Phi\) and \(\mathcal{N}_{\text{CNN}}\), namely  
\[\mathbb{R}^{|V(\mathcal{T}_{m})|\times C_{\text{in}}}\xrightarrow{ p}\mathbb{R}^{H\cdot W\times C_{\text{in}}}\xrightarrow{\Phi_{C_{\text{in}}}} \mathbb{R}^{C_{\text{in}}\times H\times W}\xrightarrow{\mathcal{N}_{\text{CNN }}}\] \[\xrightarrow{\mathcal{N}_{\text{CNN}}}\mathbb{R}^{C_{\text{out}} \times H\times W}\xrightarrow{\Phi_{\text{Cout}}}\mathbb{R}^{H\cdot W\times C _{\text{out}}}\xrightarrow{q}\mathbb{R}^{|V(\mathcal{T}_{m})|\times C_{\text{ out}}}. \tag{21}\]  
**Example 2** (Illustrating the TCNN).