Skip to content

YZ-Cai/Colabs-CS224W-Machine-Learning-with-Graphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview of CS224W Colabs

Colabs with my solutions for CS224W: Machine Learning with Graphs (2021 Fall)


Related resoures:


The following tools/packages are used in these colabs (Python>=3.7):

  • NetworkX: to create, manipulate, and mine graphs.
  • PyTorch: machine learning framework.
  • PyTorch Geometric (PyG): to develop graph deep learning models.
  • DeepSNAP: flexible graph manipulation, standard pipeline and heterogeneous graph supports for graph deep learning.

Notes:

  • Solutions are not guaranteed to be all correct, which are only for your references.
  • Each colab has its own directory, in which CS224W_Colab_{i}.ipynb contains all solutions and CS224W_Colab_{i} origin.ipynb is the origin empty version downloaded from course website.
  • Outputs and other required materials are also contained (although most of them could be generated by codes automatically).

Colab 0

  1. Toy examples for using NetworkX.

  2. Installation of PyG.

  3. Example impletementations of graph neural network, including GCN training.


Colab 1

  1. Use NetworkX APIs, including degree, clustering coefficient, pagerank value and closeness centrality.

  2. Transfer edges to torch.tensor, including negative edge sampling.

  3. Train node embeddings for two-way edge classification.


Colab 2

  1. Use PyG datasets APIs, including getting meta data, labels and edges.

  2. Use Open Graph Benchmark (OGB) to obtain dataset.

  3. Design GCN model for node classification, including training, validation and testing.

  4. Design GCN model for graph classification, including mini-batching, training, validation and testing.


Colab 3

Implement layer module of GraphSage for node classification task, including forward, message and aggregate function.


Colab 4

Implement layer module of graph attention network (GAT) for node classification task, including forward, message and aggregate function.


Colab 5

  1. Add node types, labels and features as node attributes, add edge types as edge attributes in network X.

  2. Transform homogenous graphs in networkX to heterogeneous graphs in DeepSNAP.

  3. Count number of node types and edge types for heterogeneous graphs in DeepSNAP.

  4. Use PyG and DeepSNAP to implement a GNN model for heterogeneous graph node classification, including heterogeneous message passing layer, wrapper layer, GNN layer, model training and testing.


References

Github | cs224w(图机器学习)2021冬季课程的colab

About

Colab overviews and solutions of CS224W

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published