CodeLibrary/03_pycharm_python_coursework_20240427/DeepLearn.py

19 lines
435 B
Python
Raw Permalink Normal View History

import networkx as nx
import matplotlib.pyplot as plt
G = nx.DiGraph()
G.add_node("输入层")
G.add_node("隐藏层 1")
G.add_node("隐藏层 2")
G.add_node("输出层")
G.add_edge("输入层", "隐藏层 1")
G.add_edge("输入层", "隐藏层 2")
G.add_edge("隐藏层 1", "输出层")
G.add_edge("隐藏层 2", "输出层")
pos = nx.spring_layout(G)
nx.draw_networkx(G, pos)
plt.rcParams['font.sans-serif']=['SimHei']
plt.show()