如何使用 Tikz 在 Latex 上绘制以下神经网络

问题描述 投票:0回答:0

我想将图像复制到乳胶 tikz 代码中,有什么好的指南吗?

enter image description here

我试过了,但效果不是很好:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning, arrows.meta}

\begin{document}
\begin{tikzpicture}[>=Stealth, thick]

  % Circle nodes
  \foreach \i [count=\j] in {1, 2, 3, 4}
    \node[circle, draw, minimum size=1cm] (n\i) at (\j*2, 0) {\i};
  \foreach \i/\x in {5/1, 6/3}
    \node[circle, draw, minimum size=1cm] (n\i) at (\x*2, -2) {\i};
  \node[circle, draw, minimum size=1cm] (n7) at (5, -4) {7};

  % Arrows from the empty left side to circle nodes
  \foreach \i/\name in {1/Entropy, 2/Contrast, 3/Hue, 4/Intensity} {
    \draw[->] (n\i.west) -- ++(-1, 0) node[midway, above] {\name};
  }

  % Vertices from nodes 1 to 4 to nodes 5 and 6
  \foreach \i/\w/\wp in {1/-5/6, 2/3/-1, 3/2/-2, 4/4/5} {
    \draw[->] (n\i) -- (n5) node[midway, left] {\w};
    \draw[->] (n\i) -- (n6) node[midway, right] {\wp};
  }

  % Vertices from nodes 5 and 6 to node 7
  \draw[->] (n5) -- (n7) node[midway, left] {-1};
  \draw[->] (n6) -- (n7) node[midway, right] {2};

  % Vertex going forward from node 7
  \draw[->] (n7) -- ++(0, -1);

\end{tikzpicture}
\end{document}

latex tikz
© www.soinside.com 2019 - 2024. All rights reserved.