COSIE.model_component.GraphAutoencoder

class GraphAutoencoder(encoder_dim, activation='relu', base_model=<class 'torch_geometric.nn.conv.gcn_conv.GCNConv'>)[source]

Bases: Module

Graph autoencoder architecture for learning embeddings.

This class implements a symmetric encoder-decoder structure using GNN layers (e.g., GCNConv).

Parameters

encoder_dimlist of int

A list specifying the hidden and output dimensions of each GNN layer in the encoder.

activationstr, optional

Activation function to use between GNN layers. Must be one of {‘relu’, ‘sigmoid’, ‘tanh’, ‘leakyrelu’}. Default is ‘relu’.

base_modelnn.Module, optional

The GNN layer to use. Must follow the PyTorch Geometric GNN interface (e.g., GCNConv, SAGEConv, GATConv). Default is GCNConv.

Methods

encoder(x, edge_index)

Encode input features into latent embedding.

decoder(x, edge_index)

Decode latent features back into original feature space.

forward(x, edge_index)

Perform full encoder-decoder reconstruction and return output.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

Methods

decoder

Decode latent embeddings to reconstruct original node features.

encoder

Encode input node features into latent embeddings.

forward

Perform full encoder-decoder forward pass.

Attributes