Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Graph Neural Networks Using Python

You're reading from   Hands-On Graph Neural Networks Using Python Practical techniques and architectures for building powerful graph and deep learning apps with PyTorch

Arrow left icon
Product type Paperback
Published in Apr 2023
Publisher Packt
ISBN-13 9781804617526
Length 354 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Maxime Labonne Maxime Labonne
Author Profile Icon Maxime Labonne
Maxime Labonne
Arrow right icon
View More author details
Toc

Table of Contents (25) Chapters Close

Preface 1. Part 1: Introduction to Graph Learning
2. Chapter 1: Getting Started with Graph Learning FREE CHAPTER 3. Chapter 2: Graph Theory for Graph Neural Networks 4. Chapter 3: Creating Node Representations with DeepWalk 5. Part 2: Fundamentals
6. Chapter 4: Improving Embeddings with Biased Random Walks in Node2Vec 7. Chapter 5: Including Node Features with Vanilla Neural Networks 8. Chapter 6: Introducing Graph Convolutional Networks 9. Chapter 7: Graph Attention Networks 10. Part 3: Advanced Techniques
11. Chapter 8: Scaling Up Graph Neural Networks with GraphSAGE 12. Chapter 9: Defining Expressiveness for Graph Classification 13. Chapter 10: Predicting Links with Graph Neural Networks 14. Chapter 11: Generating Graphs Using Graph Neural Networks 15. Chapter 12: Learning from Heterogeneous Graphs 16. Chapter 13: Temporal Graph Neural Networks 17. Chapter 14: Explaining Graph Neural Networks 18. Part 4: Applications
19. Chapter 15: Forecasting Traffic Using A3T-GCN 20. Chapter 16: Detecting Anomalies Using Heterogeneous GNNs 21. Chapter 17: Building a Recommender System Using LightGCN 22. Chapter 18: Unlocking the Potential of Graph Neural Networks for Real-World Applications
23. Index 24. Other Books You May Enjoy

Why graphs?

The first question we need to address is: why are we interested in graphs in the first place? Graph theory, the mathematical study of graphs, has emerged as a fundamental tool for understanding complex systems and relationships. A graph is a visual representation of a collection of nodes (also called vertices) and edges that connect these nodes, providing a structure to represent entities and their relationships (see Figure 1.1).

Figure 1.1 – Example of a graph with six nodes and five edges

Figure 1.1 – Example of a graph with six nodes and five edges

By representing a complex system as a network of entities with interactions, we can analyze their relationships, allowing us to gain a deeper understanding of their underlying structures and patterns. The versatility of graphs makes them a popular choice in various domains, including the following:

  • Computer science, where graphs can be used to model the structure of computer programs, making it easier to understand how different components of a system interact with each other
  • Physics, where graphs can be used to model physical systems and their interactions, such as the relationship between particles and their properties
  • Biology, where graphs can be used to model biological systems, such as metabolic pathways, as a network of interconnected entities
  • Social sciences, where graphs can be used to study and understand complex social networks, including the relationships between individuals in a community
  • Finance, where graphs can be used to analyze stock market trends and relationships between different financial instruments
  • Engineering, where graphs can be used to model and analyze complex systems, such as transportation networks and electrical power grids

These domains naturally exhibit a relational structure. For instance, graphs are a natural representation of social networks: nodes are users, and edges represent friendships. But graphs are so versatile they can also be applied to domains where the relational structure is less natural, unlocking new insights and understanding.

For example, images can be represented as a graph, as in Figure 1.2. Each pixel is a node, and edges represent relationships between neighboring pixels. This allows for the application of graph-based algorithms to image processing and computer vision tasks.

Figure 1.2 – Left: original image; right: graph representation of this image

Figure 1.2 – Left: original image; right: graph representation of this image

Similarly, a sentence can be transformed into a graph, where nodes are words and edges represent relationships between adjacent words. This approach is useful in natural language processing and information retrieval tasks, where the context and meaning of words are critical factors.

Unlike text and images, graphs do not have a fixed structure. However, this flexibility also makes graphs more challenging to handle. The absence of a fixed structure means they can have an arbitrary number of nodes and edges, with no specific ordering. In addition, graphs can represent dynamic data, where the connections between entities can change over time. For example, the relationships between users and products can change as they interact with each other. In this scenario, nodes and edges are updated to reflect changes in the real world, such as new users, new products, and new relationships.

In the next section, we will delve deeper into how to use graphs with machine learning to create valuable applications.

You have been reading a chapter from
Hands-On Graph Neural Networks Using Python
Published in: Apr 2023
Publisher: Packt
ISBN-13: 9781804617526
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image