torch_geometric.nn.models.PMLP
- class PMLP(in_channels: int, hidden_channels: int, out_channels: int, num_layers: int, dropout: float = 0.0, bias: bool = True)[source]
Bases:
ModuleThe P(ropagational)MLP model from the “Graph Neural Networks are Inherently Good Generalizers: Insights by Bridging GNNs and MLPs” paper.
PMLPis identical to a standard MLP during training, but then adopts a GNN architecture during testing.- Parameters
in_channels (int) – Size of each input sample.
hidden_channels (int) – Size of each hidden sample.
out_channels (int) – Size of each output sample.
num_layers (int) – The number of layers.
dropout (float, optional) – Dropout probability of each hidden embedding. (default:
0.)bias (bool, optional) – If set to
False, the module will not learn additive biases. (default:True)