Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Keita Broadwater, Namid Stillman

Rating No ratings yet

A hands-on guide to powerful graph-based deep learning models. Graph Neural Networks in Action teaches you to build cutting-edge graph neural networks for recommendation engines, molecular modeling, and more. This comprehensive guide contains coverage of the essential GNN libraries, including PyTorch Geometric, DeepGraph Library, and Alibaba’s GraphScope for training at scale. In Graph Neural Networks in Action, you will learn how to: • Train and deploy a graph neural network • Generate node embeddings • Use GNNs at scale for very large datasets • Build a graph data pipeline • Create a graph data schema • Understand the taxonomy of GNNs • Manipulate graph data with NetworkX In Graph Neural Networks in Action you’ll learn how to both design and train your models, and how to develop them into practical applications you can deploy to production. Go hands-on and explore relevant real-world projects as you dive into graph neural networks perfect for node prediction, link prediction, and graph classification. About the technology Graphs are a natural way to model the relationships and hierarchies of real-world data. Graph neural networks (GNNs) optimize deep learning for highly-connected data such as in recommendation engines and social networks, along with specialized applications like molecular modeling for drug discovery. About the book Graph Neural Networks in Action teaches you how to analyze and make predictions on data structured as graphs. You’ll work with graph convolutional networks, attention networks, and auto-encoders to take on tasks like node classification, link prediction, working with temporal data, and object classification. Along the way, you’ll learn the best methods for training and deploying GNNs at scale—all clearly illustrated with well-annotated Python code! About the reader For Python programmers familiar with machine learning and the basics of deep learning.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# Graph Neural Networks in Action ## 【One-Line Pitch】 A practical, hands-on guide for Python programmers and ML practitioners who want to master graph neural networks—from foundational concepts to production-ready implementations—using real-world datasets and industry-standard libraries like PyTorch Geometric, DeepGraph Library, and GraphScope. ## 【Book Arc】 - **Opening (~0%–9%)**: Introduces graph fundamentals and the GNN landscape, establishing why graphs matter for relational data and what makes a problem suitable for GNNs. Includes a taxonomy of graph types and a primer on graph-based learning. - **Early (~9%–25%)**: Covers the core mechanics of GNNs—message passing, training loops, and the basic architecture—then dives into node embeddings with Node2Vec, demonstrating how to generate and visualize embeddings using real datasets like Political Books. - **Early–Middle (~25%–38%)**: Bridges unsupervised embedding methods (Node2Vec) with supervised GNN approaches, showing how to build a simple GNN in PyTorch Geometric, evaluate with accuracy and F1 scores, and understand the relationship between network depth and message-passing hops. - **Middle (~38%–47%)**: Focuses on convolutional GNNs (GCN and GraphSAGE) applied to product category prediction using the Amazon Products dataset, covering baseline models, neighborhood aggregation, and optimization techniques. - **Late (~47%–end)**: Extends into advanced architectures and practical deployment—graph attention networks (GATs), autoencoders for molecular prediction, temporal data handling, and scaling GNNs for large datasets with tools like GraphScope. ## 【Key Takeaways】 - **Graphs are the natural language of relational data** (Opening): Understanding graph structure—nodes, edges, hypergraphs, self-loops—is essential before tackling GNNs. The book provides a refresher that even experienced ML practitioners should skim, as GNN-specific terminology and use-cases differ from traditional deep learning. - **Message passing is the heart of GNNs** (Early): Each node collects information from its neighbors, transforms it, and passes it along—this is how GNNs learn rich representations. The number of hidden layers corresponds to the number of hops, and coverage grows exponentially with depth (the "six degrees of separation" principle). - **Node2Vec offers a fast, unsupervised path to embeddings** (Early): By performing random walks on graphs, Node2Vec summarizes local neighborhoods into vector representations. The book demonstrates 2D embeddings for direct visualization with UMAP, making it ideal for exploratory analysis before building full GNN models. - **PyTorch Geometric simplifies GNN implementation** (Early): The book walks through converting node embeddings to PyTorch tensors, defining a SimpleGNN model, and using `model.eval()` with `torch.no_grad()` for inference—practical patterns you'll reuse in production. - **Evaluation requires more than accuracy** (Early): For imbalanced graph data, F1 score provides a better measure of model quality than accuracy alone. The book emphasizes this distinction early, preparing you for real-world classification tasks where class distributions are rarely uniform. - **Convolutional GNNs extend CNN intuition to graphs** (Middle): GCN and GraphSAGE perform local averaging across node neighborhoods, analogous to how CNNs average across pixel subdomains. The book clarifies terminology—GCN is a specific architecture, while "convolutional GNNs" is the broader class. - **Training GNNs follows standard deep learning patterns** (Middle): The training loop—forward pass, loss computation, backpropagation, and validation—mirrors traditional neural networks, but each epoch corresponds to one message-passing iteration. The book provides complete code for training and validation loops you can adapt. ## 【Reading Tips】 - **Skim the graph fundamentals if you're experienced** (Opening): The early sections on graph basics are valuable for beginners, but if you already know graph theory, focus on the GNN-specific terminology and the taxonomy of graph types—these are essential for later chapters. - **Run the code as you go** (Early): The authors strongly advise hands-on practice. The Node2Vec and PyTorch Geometric examples are self-contained and ideal for experimentation—don't just read them, execute them in a notebook. - **Deep-read the theory sections** (Middle): Chapters on convolutional GNNs and attention networks include "under the hood" sections that explain the mathematics and design choices. These are worth careful study if you want to innovate rather than just apply existing architectures. - **Pay attention to the dataset deep-dives** (Middle): The Amazon Products dataset is used throughout the book, so understanding its structure early will help you follow later examples. The book provides context on why specific datasets were chosen for each task. - **Use the appendix for reference** (Throughout): The book includes a full tutorial on graph concepts in the appendix—use it as a lookup resource when you encounter unfamiliar terminology in later chapters. ## 【Coverage Limits】 This guide covers the opening through the middle sections (~47% of the book), focusing on fundamentals, embeddings, and convolutional GNNs. The later chapters on attention networks, autoencoders, temporal data, and large-scale deployment with GraphScope are not covered in this sample. ##
Excerpt 1
strated with well-annotated Python code! About the reader For Python programmers familiar with machine learning and the basics of deep learning. Keita Broadw...
View in text
Excerpt 2
ph neural networks1. Input data. 2. Pass the data through 3. Output a representation 5. Repeat for a neural network layers. from the final layer. number of t...
View in text
Excerpt 3
we use UMAP to visualize them, as we did in sec- tion 2.1.3. Since we’ve been working with PyTorch tensor data types running on a GPU, we need to convert our...
View in text
Excerpt 4
derstanding. This holistic approach aims to not only enable you to apply GNNs but to innovate and adapt them to the nuanced demands of real- world problems....
View in text
Excerpt 5
alization, a JumpingKnowledge layer is initialized with the mode set to 'cat' (concatenate), indicating that the features from each layer will be concatenate...
View in text
Excerpt 6
aph attention networks4.2 Exploring the review spam dataset Derived from a broader Yelp review dataset, our data focuses on reviews from Chi- cago’s hotels a...
View in text
Excerpt 7
2022) self.conv1 = GATConv(data.num_node_features,\ hidden_layers, heads, dropout=dropout_p) self.bn1 = nn.BatchNorm1d(hidden_layers*heads) self.conv2 = GATC...
View in text
Excerpt 8
= model.encode(data.x, data.edge_index) Decodes the graph out = model.decode(z, \ using the full edge data.edge_label_index).view(-1).sigmoid() label index l...
View in text
Tags
AI categories
AIPythonProgramming Language
ISBN: 1617299057
Publish Year: 2025
Language: English
Pages: 394
File Format: PDF
File Size: 18.3 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…