CodeLibrary/03_pycharm_python_coursework_20240427/DeepLearn.py
JRNitre 2092240e04 计算机专业前沿作业 Python
Date: 20240427
Design by JRNitre
2024-04-27 20:40:24 +08:00

19 lines
435 B
Python

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()