17.5 Using the Unsupervised EdgeWise Algorithm
UnsupervisedEdgeWise
is an inductive edge
representation learning algorithm which is able to leverage vertex and edge feature
information. It can be applied to a wide variety of tasks, including unsupervised learning
edge embeddings for edge classification.
Unsupervised EdgeWise is based on top of the GraphWise
model,
leveraging the source vertex embedding and the destination vertex embedding generated by
the GraphWise
model to generate inductive edge embeddings.
The training is based on Deep Graph Infomax (DGI) by Velickovic et al.
Model Structure
An UnsupervisedEdgeWise
model consists of graph
convolutional layers followed by an embedding layer which defaults to a DGI
layer.
First, the source and destination vertices of the target edge are processed through the convolutional layers. The forward pass through a convolutional layer for a vertex proceeds as follows:
- A set of neighbors of the vertex is sampled.
- The previous layer representations of the neighbors are mean-aggregated, and the aggregated features are concatenated with the previous layer representation of the vertex.
- This concatenated vector is multiplied with weights, and a bias vector is added.
- The result is normalized such that the layer output has unit norm.
The edge embedding layer concatenates the source vertex embedding, the edge features and the destination vertex embedding, and then forwards it through a linear layer to get the edge embedding.
The DGI Layer consists of three parts enabling unsupervised learning using embeddings produced by the convolution layers.
- Corruption function: Shuffles the node features while preserving the graph structure to produce negative embedding samples using the convolution layers.
- Readout function: Sigmoid activated mean of embeddings, used as summary of a graph.
- Discriminator: Measures the similarity of positive (unshuffled) embeddings with the summary as well as the similarity of negative samples with the summary from which the loss function is computed.
Since none of these contains mutable hyperparameters, the default DGI layer is always used and cannot be adjusted.
The second embedding layer available is the Dominant Layer.
Dominant is a model that detects anomalies based on the features and the neighbors' structure. Using GCNs to reconstruct the features in an autoencoder's settings, and the mask with the dot products of the embeddings.
The loss function is computed from the feature reconstruction loss and the structure reconstruction loss. The importance given to features or to the structure can be tuned with the alpha hyperparameter.
The following describes a few use cases where
UnsupervisedEdgeWise
algorithm can be applied:
- Supply Chain Optimization: To analyze relationships between different entities in a supply chain network. This helps to predict potential delays or disruptions, thereby optimizing logistics and inventory management.
- Collaboration Network Analysis: To understand collaboration patterns between individuals or departments in research or corporate environments. This helps to improve team structures and enhance productivity.
- Recommendation in E-commerce: To recommend products (using edge embeddings) that are frequently bought together by analyzing the relationship between different products in a purchasing network.
The following describes the usage of the main functionalities of
UnsupervisedEdgeWise
in PGX using the Movielens
graph as an example.
- Loading a Graph
- Building a Minimal Unsupervised EdgeWise Model
- Advanced Hyperparameter Customization
- Supported Property Types for Unsupervised EdgeWise Model
- Applying Unsupervised EdgeWise for Partitioned Graphs
- Setting the Edge Combination Production Method
- Training an Unsupervised EdgeWise Model
- Getting the Loss Value for an Unsupervised EdgeWise Model
- Getting the Training Log for an Unsupervised EdgeWise Model
- Inferring Embeddings for an Unsupervised EdgeWise Model
- Classifying the Edges Using the Obtained Embeddings
- Storing an Unsupervised EdgeWise Model
- Loading a Pre-Trained Unsupervised EdgeWise Model
- Destroying an Unsupervised Anomaly Detection GraphWise Model
- Example: Computing Edge Embeddings on the Movielens Dataset
Parent topic: Using the Machine Learning Library (PgxML) for Graphs