First Step: Note that it is the responsibility of all students to familiarize themselves with the Honor Code and Submission Policy and to maintain the highest level of academic integrity.
Second Step: Create a GitHub Repository for the course with the name "graph_ml_course_assignments", and send its link to the course's group, as soon as possible.
- Part 1: Python Basics
Do these Python exercises up to the exercise "comparing and sorting tuples", and take a photo from your final score and put it on your GitHub repository of the course. - Part 2: Numpy, Pandas, and Matplotlib
In each of the following problem sets, do at least 30 exercises (the more, the better). Use Git to save the .ipynb files of your assignmentsfrom Labex to your GitHub repository (with a bonus)
, or use similar .ipynb files that I have already saved to the course repository using Git(without a bonus)
.
Understanding the concepts of these two assignment sets will help you to solve the next assignments. Study the concepts presented in the two assignment sets and execute the codes. Try to understand the concepts correctly by printing the outputs and changing the parameters in each of the code cells.
- First: networkx_tutorial_full.ipynb
- Second: intro_networkx_pyg.ipynb
This assignment will guide you through the process of learning node embeddings by following a full pipeline consisting of three steps. First, we will load the Karate Club Network, which is a classic graph in network science, and explore various graph statistics related to it. Next, we will work together to transform the graph structure into a PyTorch tensor, which will enable us to perform machine learning on the graph. Finally, we will write a node embedding model, which is the first learning algorithm on graphs. Although our model is simpler than DeepWalk and node2vec algorithms taught in the lecture, it is still challenging and rewarding as we will write it from scratch using PyTorch.
It is important to run all the cells sequentially to ensure that intermediate variables and packages carry over to the next cell.
Notebook: node_embeddings.ipynb
From the pdf file below, please solve exercises 2.1, 2.3, 2.6, 4.1, 4.2, and 4.3.
File: CS224W_Winter2223_HW1.pdf
Write the Mid-term exam answers and Upload them to your repo.
Inspired by this notebook and building upon the provided example, perform the following tasks:
- Choose a dataset from PyG's Dataset Cheatsheet, different from Cora, and train the node2vec model with 5 different sets of hyperparameters:
embedding_dim, walk_length, context_size, walks_per_node, p, q, number of epochs
. - Report the final test set results in a table and compare the outcomes obtained for each set of hyperparameters.
- Repeat the above steps for a given graph, for example, the graph provided in the example.