Abstract
While Graph Neural Networks (GNNs) have revolutionized relational data modeling, they are fundamentally limited to pairwise interactions. Real-world systems, such as protein-protein interactions or multi-author collaborations, often involve "multi-way" relationships better represented by higher-order topological structures. TopoX is a comprehensive Python ecosystem designed to bridge the gap between theoretical topology and applied deep learning. By providing unified tools for data representation (TopoNetX), representation learning (TopoEmbedX), and neural network construction (TopoModelX), TopoX offers a standardized framework for researchers to exploit the rich geometric properties of complex data.
Introduction
Traditional deep learning excels on Euclidean grids (images) or sequences (text). Geometric Deep Learning extended these capabilities to graphs, yet graphs only capture connections between two points at a time. Many scientific domains—from chemistry to social networks—feature interactions involving three or more entities simultaneously. These are best represented as topological domains, such as simplicial complexes, hypergraphs, or combinatorial complexes.
Historically, the barrier to entry for Topological Deep Learning (TDL) has been high due to the lack of interoperable software. Researchers often had to implement custom code for complex mathematical operations like incidence matrices and higher-order message passing. TopoX addresses this by providing a standardized, reliable, and well-documented software suite.
The TopoX Ecosystem
The TopoX suite is modular, consisting of three primary packages that mirror the standard machine learning workflow:
- TopoNetX: The foundation of the suite. It provides data structures for building topological domains, supporting nodes, edges, and higher-order cells. It automates the computation of incidence matrices, adjacency matrices, and the Hodge Laplacian—the topological equivalent of the graph Laplacian.
- TopoEmbedX: The representation layer. Similar to how
node2veccreates embeddings for graph nodes, TopoEmbedX provides algorithms likeCell2VecandDeepCellto embed entire cells or complexes into Euclidean space for downstream tasks. - TopoModelX: The learning engine. Built on PyTorch, it implements Topological Neural Networks (TNNs). It utilizes a tensor diagram formalism to define how messages are passed between nodes, edges, faces, and higher-order structures.
Comparative Analysis
TopoX distinguishes itself from existing libraries by its breadth of support and functional parity. While libraries like NetworkX focus exclusively on graphs or HyperNetX on hypergraphs, TopoX supports a full spectrum of domains including simplicial, cellular, path, and combinatorial complexes.
As shown in the comparison tables, TopoX implements a wide range of operators—from standard adjacency matrices to complex Hodge Laplacians and specialized merge/split operators for message passing—that are often missing in more specialized graph or hypergraph libraries.
Key Insights and Ideas
- Unified API: Simplicial complexes, hypergraphs, and cellular complexes are handled through a single, consistent interface, reducing the cognitive load for researchers.
- Higher-Order Message Passing: TopoX formalizes multi-directional information flow. In a TNN, information can flow "up" (nodes to edges), "down" (faces to edges), or "across" (between cells of the same dimension).
- Interoperability: The suite integrates seamlessly with the existing Python ML stack, using NumPy/SciPy backends for
TopoNetXand PyTorch/PyTorch Geometric forTopoModelX. - Rigorous Testing: With over 95% code coverage, the suite emphasizes reliability for applied engineering tasks.
Limitations and Future Work
While TopoX establishes a powerful foundation, several areas for growth remain. Computing Hodge Laplacians for massive datasets (millions of cells) is computationally expensive, necessitating future research into optimized sparse-matrix kernels. Additionally, while TopoModelX provides essential building blocks, the "model zoo" of pre-trained TNN architectures is still in its infancy compared to standard GNN libraries. Finally, extending these tools to handle dynamic topological structures that change over time is a promising future direction.
Summary updated