Uncovering the power and applications of a rising deep learning algorithm
Through this article, I aim to introduce you to a growingly popular deep learning algorithm, Graph Neural Networks (GNNs). GNNs are gradually emerging from the realm of research and are already demonstrating impressive results on real-world problems, suggesting their vast potential. The main objective of this article is to demystify this algorithm. If, by the end, you can answer questions like, Why would I use a GNN? How does a GNN work? I would consider my mission accomplished.
Before delving into the subject, it’s necessary to recall two concepts intrinsically related to our topic:
Graphs and Embeddings
Graphs in Computer Science
Let’s start with a quick reminder of what a graph is. Graphs are used in countless domains. Particularly in computer science, a graph is a data structure composed of two elements: a set of vertices, or nodes, and a set of edges connecting these nodes.
A graph can be directed or undirected. A directed graph is a graph in which edges have a direction, as shown below.
So, a graph is a representation of relationships (edges) between objects (nodes).
Embeddings
Embeddings are a way to represent information. Let me explain with an example before discussing it more formally. Suppose I have a set of 10,000 objects to know about. The “natural” representation of these objects is the discrete representation, which is a vector with as many components as elements in the set. So, in the image, the discrete representation is the one on the right, where only one of the vector components is 1 (black) and the rest are 0.
This representation clearly poses a dimensionality problem. This is where embeddings come into play. They reduce the dimensionality of the problem by representing data in a much lower-dimensional space. The representation is continuous, meaning the vector components’ values are different from 0 and 1. However, determining what each component represents in this new space is not straightforward, as is the case with discrete representation.