Book Image

Hands-On Graph Neural Networks Using Python

By : Maxime Labonne
Book Image

Hands-On Graph Neural Networks Using Python

By: Maxime Labonne

Overview of this book

Graph neural networks are a highly effective tool for analyzing data that can be represented as a graph, such as networks, chemical compounds, or transportation networks. The past few years have seen an explosion in the use of graph neural networks, with their application ranging from natural language processing and computer vision to recommendation systems and drug discovery. Hands-On Graph Neural Networks Using Python begins with the fundamentals of graph theory and shows you how to create graph datasets from tabular data. As you advance, you’ll explore major graph neural network architectures and learn essential concepts such as graph convolution, self-attention, link prediction, and heterogeneous graphs. Finally, the book proposes applications to solve real-life problems, enabling you to build a professional portfolio. The code is readily available online and can be easily adapted to other datasets and apps. By the end of this book, you’ll have learned to create graph datasets, implement graph neural networks using Python and PyTorch Geometric, and apply them to solve real-world problems, along with building and training graph neural network models for node and graph classification, link prediction, and much more.
Table of Contents (25 chapters)
Part 1: Introduction to Graph Learning
Part 2: Fundamentals
Part 3: Advanced Techniques
Part 4: Applications
Chapter 18: Unlocking the Potential of Graph Neural Networks for Real-World Applications

Introducing graph properties

In graph theory, a graph is a mathematical structure consisting of a set of objects, called vertices or nodes, and a set of connections, called edges, which link pairs of vertices. The notation is used to represent a graph, where is the graph, is the set of vertices, and is the set of edges.

The nodes of a graph can represent any objects, such as cities, people, web pages, or molecules, and the edges represent the relationships or connections between them, such as physical roads, social relationships, hyperlinks, or chemical bonds.

This section provides an overview of fundamental graph properties that will be used extensively in later chapters.

Directed graphs

One of the most basic properties of a graph is whether it is directed or undirected. In a directed graph, also called a digraph, each edge has a direction or orientation. This means that the edge connects two nodes in a particular direction, where one node is the source and the other...