Logo
  • Installation
  • Introduction
  • Citing
  • Data Structures
    • Data Classes
    • Benchmark Datasets
    • Node Splitting
    • Edge Splitting
  • Real-World Data Set Descriptions
    • Directed Unsigned Real-World Data Sets
    • Signed Real-World Data Sets
  • Case Study Examples
    • Case Study on Signed Networks
    • Case Study on Directed Networks
  • External Resources
    • External Resources - Architectures
    • External Resources - Synthetic Data Generators
    • External Resources - Real-World Data Sets
  • PyTorch Geometric Signed Directed Models
    • Directed (Unsigned) Network Models and Layers
    • Signed (Directed) Network Models and Layers
    • Auxiliary Methods and Layers
  • PyTorch Geometric Signed Directed Data Generators and Data Loaders
    • Data Classes
    • Data Generators
    • Data Loaders
  • PyTorch Geometric Signed Directed Utils
    • Task-Specific Objectives and Evaluation Methods
    • Utilities and Preprocessing Methods
PyTorch Geometric Signed Directed
  • torch_geometric_signed_directed.nn.directed.DGCN_link_prediction
  • View page source

torch_geometric_signed_directed.nn.directed.DGCN_link_prediction

Classes

DGCN_link_prediction

An implementation of the DGCN link prediction model from `Directed Graph Convolutional Network

Module Contents

class DGCN_link_prediction(num_features: int, hidden: int, label_dim: int, dropout: float | None = None, improved: bool = False, cached: bool = False)

Bases: torch.nn.Module

An implementation of the DGCN link prediction model from Directed Graph Convolutional Network paper.

Parameters:
  • input_dim (int) – Dimention of input features.

  • filter_num (int) – Hidden dimention.

  • label_dim (int) – Output dimension.

  • dropout (float, optional) – Dropout value. Default: None.

  • improved (bool, optional) – If set to True, the layer computes \(\mathbf{\hat{A}}\) as \(\mathbf{A} + 2\mathbf{I}\). (default: False)

  • cached (bool, optional) – If set to True, the layer will cache the computation of \(\mathbf{\hat{D}}^{-1/2} \mathbf{\hat{A}} \mathbf{\hat{D}}^{-1/2}\) on first execution, and will use the cached version for further executions. This parameter should only be set to True in transductive learning scenarios. (default: False)

dropout = None
dgconv
linear
lin1
lin2
bias1
bias2
reset_parameters()
forward(x: torch.FloatTensor, edge_index: torch.LongTensor, edge_in: torch.LongTensor, edge_out: torch.LongTensor, query_edges: torch.LongTensor, in_w: torch.FloatTensor | None = None, out_w: torch.FloatTensor | None = None) → torch.FloatTensor

Making a forward pass of the DGCN node classification model.

Arg types:
  • x (PyTorch FloatTensor) - Node features.

  • edge_index (PyTorch LongTensor) - Edge indices.

  • edge_in, edge_out (PyTorch LongTensor) - Edge indices for input and output directions, respectively.

  • in_w, out_w (PyTorch FloatTensor, optional) - Edge weights corresponding to edge indices.

Return types:
  • x (PyTorch FloatTensor) - Logarithmic class probabilities for all nodes, with shape (num_nodes, num_classes).


© Copyright 2026, Yixuan He.

Built with Sphinx using a theme provided by Read the Docs.