答案1
这将给你一个开始。箭头是自动绘制的,方框是用 完成的shapes.multipart
。split row
希望风格是不言自明的,其余部分完成得非常快。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,shapes.multipart}
\begin{document}
\begin{tikzpicture}[font=\sffamily,every text node part/.style={text
width=2cm,align=center},split row/.style={nodes={draw,rectangle split,
rectangle split draw splits=true,rectangle split parts=#1}}]
\matrix[matrix of nodes,
row 2/.style={split row=2},
row 3/.style={split row=4},
row sep=2em,column sep=2em,
execute at end matrix={% automatically add vertical arrows
\foreach \Y [evaluate=\Y as \Z using {int(\Y-1)}] in
{2,...,\the\pgfmatrixcurrentrow}
{\foreach \X in {1,...,\the\pgfmatrixcurrentcolumn}
{\draw[-stealth] (\tikzmatrixname-\Y-\X) -- (\tikzmatrixname-\Z-\X);}}}
] { $y^1$ & $y^2$ \\
Sigmoid\nodepart{two}Dense & Sigmoid\nodepart{two}Dense\\
Dropout\nodepart{two}blabla\nodepart{three}blabla%
\nodepart{four}\vphantom{\raisebox{-1.5ex}{\Huge A}}xyz &
Dropout\nodepart{two}blabla\nodepart{three}blabla%
\nodepart{four}\vphantom{\raisebox{-1.5ex}{\Huge A}}xyz\\
};
\end{tikzpicture}
\end{document}