LightGCN

class dhg.models.LightGCN(*args, **kwargs)[source]

Bases: torch.nn.Module

The LightGCN model proposed in LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation paper (SIGIR 2020).

Note

The user and item embeddings are initialized with normal distribution.

Parameters
  • num_users (int) – The Number of users.

  • num_items (int) – The Number of items.

  • emb_dim (int) – Embedding dimension.

  • num_layers (int) – The Number of layers. Defaults to 3.

  • drop_rate (float) – Dropout rate. Randomly dropout the connections in training stage with probability drop_rate. Default: 0.0.

forward(ui_bigraph)[source]

The forward function.

Parameters

ui_bigraph (dhg.BiGraph) – The user-item bipartite graph.