Simplicial convolutional neural network implementation for complex classification.

class topomodelx.nn.simplicial.scnn.SCNN(in_channels, hidden_channels, conv_order_down, conv_order_up, aggr_norm=False, update_func=None, n_layers=2)[source]#

Simplicial convolutional neural network implementation for complex classification.

Note: At the last layer, we obtain the output on simplcies, e.g., edges. To perform the complex classification task for this challenge, we consider pass the final output to a linear layer and compute the average.

Parameters:
in_channelsint

Dimension of input features.

hidden_channelsint

Dimension of features of hidden layers.

out_channelsint

Dimension of output features.

conv_order_downint

Order of lower convolution.

conv_order_upint

Order of upper convolution.

aggrbool

Whether to aggregate features on the nodes into 1 feature for the whole complex. Default: False.

n_layersint

Number of layers.

forward(x, laplacian_down, laplacian_up)[source]#

Forward computation.

Parameters:
xtorch.Tensor, shape = (n_simplices, channels)

Tensor of features node/edge/face.

laplacian_downtorch.Tensor, shape = (n_simplices, n_simplices)

Down Laplacian. For node features, laplacian_down = None.

laplacian_up: torch.Tensor, shape = (n_edges, n_nodes)

Up Laplacian.

Returns:
torch.Tensor, shape = (n_simplices, hidden_channels)

Final hidden representation of one-dimensional cells.