From the course: Learning Graph Neural Networks
Unlock this course with a free trial
Join today to access over 24,500 courses taught by industry experts.
Exercise: Visualizing and exploring a directed graph
From the course: Learning Graph Neural Networks
Exercise: Visualizing and exploring a directed graph
- [Instructor] Let's set up another graph visualizing using network X and view the graph's properties. Here is my graph. I've specified the edges on lines one through six, the nodes on line eight, and I've instantiated the graph structure on line 10. This is a graph with a total of six nodes and a total of six edges. Notice that this is a directed graph. Observe on line five in the edge connectivity there is an edge from three to four, but there is no edge from four to three. Also, on line six, notice that there is an edge from node five to node five, so this graph also has a self loop. Let's visualize this as a directed graph. I'm using network X for this. You're familiar with this basic setup. The one difference here is that I create an empty di graph on line two. The di graph is the class that is used to represent a directed graph in network X. Once again, on lines five and six, I get the number of nodes from the original graph data structure and add the range of nodes to this di…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Introducing PyTorch Geometric2m 1s
-
(Locked)
Exercise: Set up the Colab environment and libraries4m 15s
-
(Locked)
Exercise: Setting up a graph data structure in PyG5m 26s
-
(Locked)
Exercise: Visualizing graphs and exploring graph methods5m 31s
-
(Locked)
Exercise: Visualizing and exploring a directed graph2m 42s
-
(Locked)
Exercise: Exploring the cora dataset6m 2s
-
(Locked)
Exercise: Mini batches of data3m 45s
-
(Locked)
Exercise: Representing heterogeneous graphs in PyG7m 31s
-
(Locked)
-
-