torch_geometric.nn.models.MaskLabel
- class MaskLabel(num_classes: int, out_channels: int, method: str = 'add')[source]
Bases:
ModuleThe label embedding and masking layer from the “Masked Label Prediction: Unified Message Passing Model for Semi-Supervised Classification” paper.
Here, node labels
yare merged to the initial node featuresxfor 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_channelsneeds to be identical to the input dimensionality of node features. (default:"add")