- class ModelNodeClassification(*args: Any, **kwargs: Any)
Bases:
Module
Model for Node Classification task with Layer, considering grph characteristics
- Parameters:
dataset – (Graph): Input Graph
device – (device): Device ‘cuda’ or ‘cpu’
hidden_layer – (int): The size of hidden layer (default: 64)
dropout – (float): Dropout (defualt: 0.0)
num_layers – (int): Number of layers in the model (default:2)
ssl_flag – (bool): If True, self supervised loss will be optimized additionally to semi-supervised (default: False)
loss_name – (str): Name of loss function for embedding learning in GeomGCN layer
- inference(data: Graph) Tuple[torch_geometric.typing.Tensor, torch_geometric.typing.Tensor]
Count the representation of the node on the next layer of the model
- Parameters:
data – (Graph): Input Graph
- Returns:
(Tensor, Tensor): Predicted probabilities of labels and predicted degrees of nodes
- static loss_sup(pred: torch_geometric.typing.Tensor, label: torch_geometric.typing.Tensor) torch_geometric.typing.Tensor
Count negative log likelihood loss function
- Parameters:
pred – (Tensor): Predicted labels
label – (Tensor): Genuine labels
- Returns:
(Tensor): Loss
- self_supervised_loss(deg_pred: torch_geometric.typing.Tensor, dat: torch_geometric.typing.Tensor) torch_geometric.typing.Tensor
Self supervised loss, predicting degrees of nodes
- Parameters:
deg_pred – (Tensor): Predicted degrees
dat – (Tensor): Train mask
- Returns:
(Tensor): Loss