修复和 ANN 图

修复和 ANN 图

我有下图(见下面的代码),这是我之前在该小组的帮助下完成的。现在,我试图修复它以匹配下图,但似乎我忘记了 tikz。你能帮帮我吗?

我的代码

\documentclass[]{article}
\usepackage{tikz}
\usepackage{graphicx}
\definecolor{mc}{RGB}{255,51,76}

\begin{document}

\begin{tikzpicture}
 [   cnode/.style={draw=black,fill=#1,minimum width=2mm,circle},
     thick,scale=1.5, every node/.style={scale=1.2}
 ]
\node[cnode=white,draw=mc,label=0:$\bar{y}_1$] (s1) at (6,-3.25) {};
\node[cnode=white,draw=mc,label=0:$\bar{y}_2$] (s2) at (6,-2.25) {};
\node at (0.0,-4) {$\vdots$};
\node at (1,-4) {$\vdots$};
\node at (2,-4) {$\vdots$};
\node at (3,-4) {$\vdots$};
\node at (4.0,-4) {$\vdots$};
\node at (5,-4) {$\vdots$};

\foreach \x in {1,...,4}
 {   \pgfmathparse{\x<4 ? \x : "n"}
 \node[circle,scale=.5,draw=black,label=180:$\bar{x}_{\pgfmathresult}{(k)}$]    (x-\x) at  (0,{-\x-div(\x,4)}) {};
\node[cnode=white,draw=orange,label=90:] (A-\x) at (1,{-\x-div(\x,4)}) {};
\node[cnode=white,draw=orange,label=90:] (B-\x) at (2,{-\x-div(\x,4)}) {};
\node[cnode=white,draw=orange,label=90:] (C-\x) at (3,{-\x-div(\x,4)}) {};
\node[cnode=white,draw=orange,label=90:] (D-\x) at (4,{-\x-div(\x,4)}) {};
\node[cnode=white,draw=orange,label=90:] (E-\x) at (5,{-\x-div(\x,4)}) {};
\draw (E-\x) -- node[above,sloped,pos=0.53] {} (s1);
\draw (E-\x) -- node[above,sloped,pos=0.3] {} (s2);

}

\foreach \x in {1,...,4}
 {   \foreach \y in {1,...,4}
    {   \draw (x-\x) -- (A-\y);
        \draw (A-\x) -- (B-\y);
        \draw (B-\x) -- (C-\y);
        \draw (C-\x) -- (D-\y);
        \draw (D-\x) -- (E-\y);
    }
}

\node[above=.1cm] at (A-1) {$h_1$};
\node[above=.1cm] at (B-1) {$h_2$};
\node[above=.1cm] at (C-1) {$h_3$};
\node[above=.1cm] at (D-1) {$h_4$};
\node[above=.1cm] at (E-1) {$h_5$};

\node[below=.1cm] at (D-4) {$\bar{y}'_d$};
\end{tikzpicture}
\end{document}

**我的手写图表**

在此处输入图片描述

相关内容