导入
什么是图神经网络?
了解图神经网络。
...
Graph neural network illustration
...
Image convolution
...
Graph convolution
1import networkx as nx 2import matplotlib.pyplot as plt 3 4# read graph 5G = nx.karate_club_graph() 6# compute node degrees 7degree = dict(G.degree()) 8 9# plot 10fig, ax = plt.subplots(figsize=(3, 2),dpi=300) 11# set node label as degree 12nx.draw(G, with_labels=True, node_size=30,width=0.2, font_size=4, labels=degree)
1import networkx as nx 2import matplotlib.pyplot as plt 3 4# read graph 5G = nx.karate_club_graph() 6# compute node coloring number 7coloring_number = nx.coloring.greedy_color(G, strategy="largest_first") 8 9# plot 10fig, ax = plt.subplots(figsize=(3, 2),dpi=300) 11# set node label as coloring_number 12nx.draw(G, with_labels=True, node_size=30,width=0.2, font_size=4, labels=coloring_number)