Companion code for Hands-On Graph Neural Networks Using Python, Second Edition, published by Packt.
This repository contains per-chapter runnable scripts, figure generators, and pinned requirements so you can reproduce the examples from the book.
- Chapter03/ — Creating Node Representations with DeepWalk
- Chapter04/ — Improving Embeddings with Biased Random Walks in Node2Vec
- Chapter05/ — Including Node Features with Vanilla Neural Networks
Each chapter folder contains:
run.py— the main script for the chapterrequirements.txt— pinned Python dependenciesfigures/— scripts that regenerate the figures used in the book
The code targets Python 3.10+.
-
Clone the repository:
git clone https://github.com/PacktPublishing/Hands-On-Graph-Neural-Networks-Using-Python-Second-Edition.git cd Hands-On-Graph-Neural-Networks-Using-Python-Second-Edition -
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # on Windows: .venv\Scripts\activate
-
Install the dependencies for the chapter you want to run:
pip install -r Chapter03/requirements.txt
From the repository root:
python Chapter03/run.pyTo regenerate the figures for a chapter:
python Chapter03/figures/generate_figures.pySee LICENSE.