torch_geometric.nn.conv.FastRGCNConv
- class FastRGCNConv(in_channels: Union[int, Tuple[int, int]], out_channels: int, num_relations: int, num_bases: Optional[int] = None, num_blocks: Optional[int] = None, aggr: str = 'mean', root_weight: bool = True, is_sorted: bool = False, bias: bool = True, **kwargs)[source]
基础类:
RGCNConv参见
RGCNConv。- forward(x: Union[Tensor, None, Tuple[Optional[Tensor], Tensor]], edge_index: Union[Tensor, SparseTensor], edge_type: Optional[Tensor] = None)[source]
运行模块的前向传播。
- Parameters:
x (torch.Tensor or tuple, optional) – The input node features. Can be either a
[num_nodes, in_channels]node feature matrix, or an optional one-dimensional node index tensor (in which case input features are treated as trainable node embeddings). Furthermore,xcan be of typetupledenoting source and destination node features.edge_index (torch.Tensor or SparseTensor) – The edge indices.
edge_type (torch.Tensor, optional) – The one-dimensional relation type/index for each edge in
edge_index. Should be onlyNonein caseedge_indexis of typetorch_sparse.SparseTensor. (default:None)
- reset_parameters()
重置模块的所有可学习参数。