# Nearest Neighbours Graph Variational AutoEncoder
## 4 Discussion  
In this work, we presented our Nearest Neighbour Graph VAE, a Variational AutoEncoder that can generate graph data with a regular geometry. Such a model fully takes advantage of the Graph convolutional layers in both encoding and decoding phases. For the encoding, we introduced a pooling technique (ReNN-Pool), based on the graph connectivity that allows us to sub-sample graph nodes in a spatially uniform way and to alter the graph adjacency matrix consequently. The decoding is carried out using a symmetrical un-pooling operation to retrieve the original graphs. We demonstrated how our model can reconstruct well the cylindrical-shaped graph data of energy deposition distributions of a particle beam in a medium. We also evaluated the performance of the model on the sprite benchmark dataset, after transforming the image data into graphs. Although it can not be directly compared with more sophisticated and task specific algorithms for image synthesis, our model has the ability to generate good quality images, create disentangled representations of features, and interpolate through samples as well as a standard CNN VAE. Finally, we performed an ablation study on pooling. The results show how, on our task on large regular graphs, using the ReNN-Pool is more efficient and leads to better performances versus using a state-of-the-art technique, such as Top-k Pool. Finally, we believe that ReNN-Pool represents a simple, lightweight and efficient solution to pool regular graphs. It requires no computation during either the training or inference of models because node masks and adjacency matrices can be computed and stored early on. Thus, it is directly scalable to graphs of any size, contrarily to state-of-the-art pooling techniques. Moreover, the definition of a symmetrical un-pooling technique enables the construction of graph decoding modules, which can take advantage of graph convolutional layers. The current limitation of our pooling is that it has been only tested on regular graphs. However, a test on irregular graphs is among our future research directions. Although ReNN-Pool is not directly usable on all types of graphs, such as fully or highly connected ones, we believe that it could also be an efficient solution for irregular graphs \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Pooling** & \(z\) **Profile Error** & \(r\) **Profile Error** & **Total Energy Error** & \(\delta<3\%\) \\ \hline ReNN-Pool & 6.9 \(\pm\) 3.4\% & 3.0 \(\pm\) 1.2\% & 2.2 \(\pm\) 1.6\% & 98.6 \(\pm\) 0.3\% \\ ReNN Mean Pool & 6.4 \(\pm\) 3.0\% & 2.8 \(\pm\) 1.1\% & 2.0 \(\pm\) 1.4\% & 98.6 \(\pm\) 0.3\% \\ ReNN Max Pool & 22.6 \(\pm\) 9.9\% & 5.0 \(\pm\) 1.8\% & 3.2 \(\pm\) 2.3\% & 97.5 \(\pm\) 0.7\% \\ Random Pool & 172.6 \(\pm\) 21.7\% & 52.2 \(\pm\) 3.7\% & 2.0 \(\pm\) 1.5\% & 92.4 \(\pm\) 0.4\% \\ Top-k Pool & 51.7 \(\pm\) 3.4\% & 75.1 \(\pm\) 9.1\% & 4.0 \(\pm\) 2.6\% & 79.9 \(\pm\) 1.3\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: **Results of ablation study on pooling**. Comparison of the results on the test set of the Water + Slab dataset using different pooling and un-pooling techniques. Mean relative errors on energy profiles and total energy along with the mean 3% \(\delta\)-index passing rate on test sets are reported. with small to medium-sized node neighbourhoods. We also plan to test our method on graph U-Net architectures, where the symmetry between encoding and decoding is needed. Conceptualization, L.A., B.C., A.C., S.G. and C.M.T. ; methodology, L.A., B.C., A.C., S.G. and C.M.T. ; software, L.A.; validation, L.A. and A.C.; formal analysis, L.A.; investigation, L.A. and A.C.; resources, B.C., S.G. and C.M.T. ; data curation, L.A. and C.M.T. ; writing--original draft preparation, L.A.; writing--review and editing, L.A., A.C. and S.G.; visualization, L.A.; supervision, S.G. and C.M.T. All authors have read and agreed to the published version of the manuscript. This research received no external funding.