Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

"This repository contains the implementation code for the book, which serves as a practical guide to understanding and applying Graph Neural Networks (GNNs) using Python."

License

NotificationsYou must be signed in to change notification settings

jElhamm/Hands-On-Graph-Neural-Networks-Using-Python

Repository files navigation

Hands-On Graph Neural Networks Book Cover

Hands-On Graph Neural Networks Using Python

Welcome to the complete code implementation for the bookHands-On Graph Neural Networks Using Python. This repository contains all the code examples from the book, organized into chapters for easy navigation, with each chapter provided in both `.py` and `.ipynb` formats. A `README.md` file accompanies each chapter to guide users through the respective code implementations. This repository is an excellent resource for learners, researchers, and developers interested in exploring and building powerful graph neural networks.

  • Author:Maxime Labonne
  • Focus Areas: Graph Neural Networks, PyTorch Geometric, Machine Learning, Node Classification, Graph Embedding, and more
  • Book Reference:Hands-On Graph Neural Networks Using Python
  • Repository Contents: 17 Chapters |.py and.ipynb files | Detailed chapter-wiseREADME.md guides
  • Download and buy the book:www.amazon.com

⭐️ Book Description

Graph Neural Networks (GNNs) have quickly emerged as a cutting-edge technology in deep learning, only a decade after their inception. They are transforming industries worth billions, such as drug discovery, where they played a pivotal role in predicting a novel antibiotic named Halicin. Today, tech companies are exploring their applications in various fields, including recommender systems for food, videos, and romantic partners, as well as fake news detection, chip design, and 3D reconstruction.

In this book, "Graph Neural Networks," we will delve into the core principles of graph theory and learn how to create custom datasets from raw or tabular data. We will explore key graph neural network architectures to grasp essential concepts like graph convolution and self-attention. This foundational knowledge will then be used to understand and implement specialized models tailored for specific tasks such as link prediction and graph classification, as well as various contexts including spatio-temporal data and heterogeneous graphs. Ultimately, we will apply these techniques to solve real-world problems and begin building a professional portfolio.


📂 Repository Structure

Here’s a summary of the chapters implemented in this repository, along with a brief description of each:

ChapterTitleDescription
01Getting Started with Graph LearningLearn the basics of graph learning and graph neural networks (GNNs), and understand how to set up your first graph-based model.
02Graph Theory for Graph Neural NetworksDive into essential graph theory concepts that form the backbone of GNNs and understand their relevance to deep learning models.
03Creating Node Representations with DeepWalkLearn how to create node embeddings using the DeepWalk algorithm, transforming graph nodes into feature vectors for machine learning.
04Node2VecImplement the Node2Vec algorithm to generate improved node embeddings through biased random walks.
05Vanilla Neural NetworkBuild and understand a basic, fully connected neural network to apply on graph data as a foundation for more complex GNN architectures.
06Normalizing Features with Graph Convolutional NetworksImplement Graph Convolutional Networks (GCNs) to normalize node features and learn how to apply convolutional operations on graph data.
07Graph Attention NetworkIntroduce attention mechanisms in graph learning through Graph Attention Networks (GAT) for enhanced performance on node classification tasks.
08Scaling Graph Neural NetworksLearn techniques to scale GNNs for large-scale graph data, ensuring efficient training on massive datasets.
09Graph ClassificationImplement GNNs for graph classification tasks, using real-world datasets to classify entire graphs rather than individual nodes.
10Link PredictionUse GNNs to predict links in graphs, helping identify missing or future connections between nodes.
11Graph GenerationExplore generative models for graphs, learning how to create new graphs and complete partial ones using GNNs.
12Learning from Heterogeneous GraphsUnderstand how to work with heterogeneous graphs and implement models like Heterogeneous Attention Networks (HAN) to process different types of nodes and edges.
13Temporal Graph Neural NetworksLearn to work with dynamic or temporal graphs and build GNNs that can handle evolving data over time.
14ExplainabilityImplement GNNExplainer and other tools to interpret GNN models and make sense of the learned representations and predictions.
15Traffic ForecastingUse GNNs to forecast traffic patterns and other spatio-temporal data, improving decision-making in real-time applications.
16Anomaly DetectionApply GNNs to detect anomalies in graph data, identifying unusual patterns in networks such as fraud detection or outlier nodes.
17Recommender SystemsBuild recommender systems using GNNs to provide personalized recommendations for users, applying GNNs to problems like product, movie, or partner recommendations.

💡 Prerequisites

Before running the code, make sure you have the following tools and libraries installed:

  • Python
  • PyTorch
  • PyTorch Geometric
  • NetworkX
Python LogoPyTorch LogoPyTorch Geometric LogoNetworkX Logo

For each chapter of this repository, there may be additional libraries required. Please refer to the specificREADME.md files in each chapter directory to find detailed information about the libraries needed and installation instructions.


💡 Running the Code

Each chapter folder contains:

  • A Python script (.py file)
  • A Jupyter Notebook (.ipynb file)
  • AREADME.md with instructions and explanations for that specific chapter

You can either run the Python scripts directly or execute the Jupyter notebooks interactively:

# Run the Python script   python chapter_x/script_name.py# Or, open the Jupyter notebook   jupyter notebook chapter_x/notebook_name.ipynb

✨ Features

  • Learn the fundamentals of graph theory for data science and machine learning

  • Implement state-of-the-art graph neural network architectures

  • Build creative and powerful applications in various fields

  • Real-World Applications: Learn how to apply GNNs to various real-world problems such as molecular graphs, recommendation systems, and social networks.

  • Diverse GNN Architectures: Explore implementations of GCN, GAT, GraphSAGE, VGAE, HAN, and more.

  • Cutting-Edge Techniques: Learn about dynamic graphs, heterogeneous graphs, explainability in GNNs, and large-scale GNNs.


🤝 Contribution

Contributions are welcome! If you find any issues or want to add improvements to the code, feel free to submit a pull request or open an issue.

  1. Fork the repository

  2. Create your feature branch (git checkout -b feature/AmazingFeature)

  3. Commit your changes (git commit -m 'Add some AmazingFeature')

  4. Push to the branch (git push origin feature/AmazingFeature)

  5. Open a pull request


📝 License

This repository is licensed under the Apache License 2.0.See theLICENSE file for more details.

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp