Graph Neural Networks
Uses
Encoder-Decoder models
Attributed graphs: each graph has a node, edges. Each graph is represented by a weighted symmetric adjacency matrix. Aij is a non-zero if there is an edge between node i and j. each node i has an attribute vector xi
how to obtain embeddings (Pre-NN Era)?
we cant take a node level vector as the embedding, but they do not capture any structural information on how nodes are connected.
graph tasks require knowing “what is happening in the neighborhood”, graph level tasks need neighborhood aggregation.
researchers use encoder-decoder approaches to generate embeddings
Shallow embeddings methods: compute node embeddings for nodes seen during training(no generalization) these shallow embeddings are not related to NNs, they date back to pre NN eraNN
shallow embeddings downsides:
after computing these shallow embeddings, we can use them as inputs to our traditional ML models.
since the node was not part of the training in shallow embeddings case, it wasnt a part of the original adjacency matrix or random walks, it doesnt has a precomputed row in the embedding matrix, therefore there is no way to compute its embedding without retraining on the expanded graph.
GNNs
Why GNNs
Encoder layers
GNN encoder can have three classes of layers:
GNN Types
Aggregation functions
GNN decoder and loss functions
GNN encoder produces node embeddings and decoder maps those embeddings to task specific outputs.
softmax function can be used to convert a probability distribution over K classes
different tasks at the end of decoder: