- class BaseNet(*args: Any, **kwargs: Any)
Bases:
Module
,ABC
The model for learning latent embeddings in unsupervised manner for Geom-GCN layer
- Parameters:
device – (device): Either ‘cuda’ or ‘cpu’
hidden_layer – (int): The size of hidden layer (default:64)
out_layer – (int): The size of output layer (default:128)
dropout – (float): Dropout (default:0.0)
num_layers – (int): Number of layers in the model (default:2)
heads – (int): Number of heads in GAT conv (default:1)
- forward(x: torch_geometric.typing.Tensor, adjs: torch_geometric.loader.neighbor_sampler.EdgeIndex) torch_geometric.typing.Tensor
Find representations of the node
- Parameters:
x – (Tensor): Features of nodes
adjs – (EdgeIndex): Edge indices of computational graph for each layer
- Returns:
(Tensor): Representations of nodes
- inference(data: Graph, dp: float = 0) torch_geometric.typing.Tensor
Count representations of the node
- Parameters:
data – (Graph): Input data
dp – (float): Dropout (default:0.0)
- Returns:
(Tensor): Representations of nodes
- abstract loss(out: torch_geometric.typing.Tensor, pos_neg_samples: torch_geometric.typing.Tensor) torch_geometric.typing.Tensor
Calculate loss
- Parameters:
out – Tensor
pos_neg_samples – Tensor
- Returns:
(Tensor) Loss
- reset_parameters() None
Reset parameters