torch_geometric.nn.models.MaskLabel
- class MaskLabel(num_classes: int, out_channels: int, method: str = 'add')[source]
Bases:
Module
The label embedding and masking layer from the “Masked Label Prediction: Unified Message Passing Model for Semi-Supervised Classification” paper.
Here, node labels
y
are merged to the initial node featuresx
for a subset of their nodes according tomask
.Note
For an example of using
MaskLabel
, see examples/unimp_arxiv.py.- Parameters:
num_classes (int) – The number of classes.
out_channels (int) – Size of each output sample.
method (str, optional) – If set to
"add"
, label embeddings are added to the input. If set to"concat"
, label embeddings are concatenated. In casemethod="add"
, thenout_channels
needs to be identical to the input dimensionality of node features. (default:"add"
)