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.
- class pygip.models.nn.backbones.GCN(*args: Any, **kwargs: Any)[source]¶
Bases:
Module
A simple GCN Network.
- 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