Sparse Implementation of Versatile Graph-Informed Layers
Francesco Della Santa
TL;DR
The paper tackles the memory inefficiency of Graph-Informed (GI) layers used in Graph-Informed Neural Networks (GINNs) by introducing a sparse implementation that leverages adjacency sparsity. It also generalizes GI layers to a versatile form that operates on subgraphs defined by node subsets and a tunable self-loop scaling, enabling learning functions on subsets of nodes. The authors provide a TensorFlow based sparse implementation, including pseudocode and usage documentation, highlighting the use of sparse Dense operations to avoid storing zeros. The resulting approach reduces memory usage proportional to the number of nonzeros in the relevant submatrix $(A + \lambda I_n)|_{V_1,V_2}$, enabling deeper and more scalable GINNs for large graphs.
Abstract
Graph Neural Networks (GNNs) have emerged as effective tools for learning tasks on graph-structured data. Recently, Graph-Informed (GI) layers were introduced to address regression tasks on graph nodes, extending their applicability beyond classic GNNs. However, existing implementations of GI layers lack efficiency due to dense memory allocation. This paper presents a sparse implementation of GI layers, leveraging the sparsity of adjacency matrices to reduce memory usage significantly. Additionally, a versatile general form of GI layers is introduced, enabling their application to subsets of graph nodes. The proposed sparse implementation improves the concrete computational efficiency and scalability of the GI layers, permitting to build deeper Graph-Informed Neural Networks (GINNs) and facilitating their scalability to larger graphs.
