pygip.models.nn package

Submodules

pygip.models.nn.backbones module

class pygip.models.nn.backbones.AttackNet(*args: Any, **kwargs: Any)[source]

Bases: Module

An attack model GCN.

forward(g, features)[source]
class pygip.models.nn.backbones.GAT(*args: Any, **kwargs: Any)[source]

Bases: Module

forward(x, edge_index)[source]
class pygip.models.nn.backbones.GCN(*args: Any, **kwargs: Any)[source]

Bases: Module

A simple GCN Network.

forward(g, features)[source]
class pygip.models.nn.backbones.GCN_PyG(*args: Any, **kwargs: Any)[source]

Bases: Module

forward(x, edge_index)[source]
class pygip.models.nn.backbones.GraphSAGE(*args: Any, **kwargs: Any)[source]

Bases: Module

A GraphSAGE model implemented with PyG’s SAGEConv module.

It consists of two SAGEConv layers: - The first layer projects features to ‘hidden_channels’, - The second layer outputs ‘out_channels’.

forward(blocks, x)[source]

Forward pass.

Parameters:
  • blocks (list of dgl.DGLGraph) – A list of subgraphs sampled for multiple layers.

  • x (torch.Tensor) – The node features of shape (num_nodes, in_channels).

Returns:

The model outputs (logits) of shape (num_nodes, out_channels).

Return type:

torch.Tensor

class pygip.models.nn.backbones.ShadowNet(*args: Any, **kwargs: Any)[source]

Bases: Module

A shadow model GCN.

forward(g, features)[source]

Module contents