BGNN_Adv

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

Bases: torch.nn.Module

The BGNN-Adv model proposed in Cascade-BGNN: Toward Efficient Self-supervised Representation Learning on Large-scale Bipartite Graphs paper (TNNLS 2020).

Parameters
  • u_dim (int) – The dimension of the vertex feature in set \(U\).

  • v_dim (int) – The dimension of the vertex feature in set \(V\).

  • layer_depth (int) – The depth of layers.

forward(X_u, X_v, g)[source]

The forward function.

Parameters
  • X_u (torch.Tensor) – The feature matrix of vertices in set \(U\).

  • X_v (torch.Tensor) – The feature matrix of vertices in set \(V\).

  • g (BiGraph) – The bipartite graph.

train_with_cascaded(X_u, X_v, g, lr, weight_decay, max_epoch, drop_rate=0.5, device='cpu')[source]

Train the model with cascaded strategy.

Parameters
  • X_u (torch.Tensor) – The feature matrix of vertices in set \(U\).

  • X_v (torch.Tensor) – The feature matrix of vertices in set \(V\).

  • g (BiGraph) – The bipartite graph.

  • lr (float) – The learning rate.

  • weight_decay (float) – The weight decay.

  • max_epoch (int) – The maximum number of epochs.

  • drop_rate (float) – The dropout rate. Default: 0.5.

  • device (str) – The device to use. Default: "cpu".