Simplical Complex Autoencoder Layer.

class topomodelx.nn.simplicial.sca_cmps_layer.SCACMPSLayer(channels_list, complex_dim, att: bool = False)[source]#

Layer of a Simplicial Complex Autoencoder (SCA) using the Coadjacency Message Passing Scheme (CMPS).

Implementation of the SCA layer proposed in [1].

Parameters:
channels_listlist[int]

Dimension of features at each dimension.

complex_dimint

Highest dimension of chains on the input simplicial complexes.

attbool, default=False

Whether to use attention.

Notes

This is the architecture proposed for complex classification.

References

[1]

Hajij, Zamzmi, Papamarkou, Maroulas, Cai. Simplicial complex autoencoder (2022). https://arxiv.org/pdf/2103.04046.pdf

[2]

Papillon, Sanborn, Hajij, Miolane. Architectures of topological deep learning: a survey on topological neural networks (2023). https://arxiv.org/abs/2304.10031.

[3]

Papillon, Sanborn, Hajij, Miolane. Equations of topological neural networks (2023). awesome-tnns/awesome-tnns

forward(x_list, down_lap_list, incidencet_list)[source]#

Forward pass.

The forward pass was initially proposed in [1]_. Its equations are given in [3]_ and graphically illustrated in [2]_.

Coadjacency message passing scheme:

\[\begin{split}\begin{align*} &🟥 \quad m_{y \rightarrow x}^{(r \rightarrow r'' \rightarrow r)} = M(h_{x}^{t, (r)}, h_{y}^{t, (r)},att(h_{x}^{t, (r)}, h_{y}^{t, (r)}),x,y,{\Theta^t}) \qquad \text{where } r'' < r < r'\\ &🟥 \quad m_{y \rightarrow x}^{(r'' \rightarrow r)} = M(h_{x}^{t, (r)}, h_{y}^{t, (r'')},att(h_{x}^{t, (r)}, h_{y}^{t, (r'')}),x,y,{\Theta^t})\\ &🟧 \quad m_x^{(r \rightarrow r)} = AGG_{y \in \mathcal{L}\_\downarrow(x)} m_{y \rightarrow x}^{(r \rightarrow r)}\\ &🟧 \quad m_x^{(r'' \rightarrow r)} = AGG_{y \in \mathcal{B}(x)} m_{y \rightarrow x}^{(r'' \rightarrow r)}\\ &🟩 \quad m_x^{(r)} = \text{AGG}\_{\mathcal{N}\_k \in \mathcal{N}}(m_x^{(k)})\\ &🟦 \quad h_{x}^{t+1, (r)} = U(h_x^{t, (r)}, m_{x}^{(r)}) \end{align*}\end{split}\]
Parameters:
x_listlist[torch.Tensor]

List of tensors holding the features of each chain at each level.

down_lap_listlist[torch.Tensor]

List of down laplacian matrices for skeletons from 1 dimension to the dimension of the simplicial complex.

incidencet_listlist[torch.Tensor]

List of transpose incidence matrices for skeletons from 1 dimension to the dimension of the simplicial complex.

Returns:
list[torch.Tensor]

Output for skeletons of each dimension (the node features are left untouched: x_list[0]).

intra_aggr(x)[source]#

Based on the use by [1]_.

Parameters:
xtorch.Tensor
Returns:
torch.Tensor
reset_parameters() None[source]#

Reset parameters of each layer.

weight_func(x)[source]#

Weight function for intra aggregation layer according to [1]_.

Parameters:
xtorch.Tensor
Returns:
torch.Tensor