Decoders
Decoders take as input node and/or edge embeddings and pass them though another neural network in such a way that the last layer has a shape that fits the downstream objective. For example, a predict_edge_type
objective requires the final shape to be the number of edge types, whereas a reconstruct_node_features
objective needs a shape that matches the input features given to the encoder.
Decoders are usually much simpler than encoders, and can be customed via edge_mlp
for edge-level tasks like predict_edge_type
or via node_mlp
for node-level tasks like reconstruct_node_features
.
- edge_mlp
- architecture_str: str (1)
- src_dst_projection_coef: int (2)
- node_mlp
- architecture_str: str
- magic_gat
- num_layers: int
- num_heads: int
- negative_slope: float
- alpha_l: float
- activation: str
- nodlink
- inner_product
- none
- A string describing a simple neural network. Example: if the encoder's output has shape
node_out_dim=128
settingarchitecture_str=linear(2) | relu | linear(0.5)
creates this MLP: nn.Linear(128, 256), nn.ReLU(), nn.Linear(256, 128), nn.Linear(128, y). Precisely, in linear(x), x is the multiplier of input neurons. The final layernn.Linear(128, y)
is added automatically such thaty
is the output size matching the downstream objective (e.g. edge type prediction involves predicting 10 edge types, so the output of the decoder should be 10). - Multiplier of input neurons to project src and dst nodes.