I learned a nice way to make a neural network (nn) from this answer
When I edit it for my personal nn as follows:
\documentclass[article]{standalone}
\usepackage{tikz}
\usepackage{etoolbox} % for \ifnumcomp
\usepackage{listofitems} % for \readlist to create arrays
\tikzset{>=latex} % for LaTeX arrow head
\colorlet{myred}{red!80!black}
\colorlet{myblue}{blue!80!black}
\colorlet{mygreen}{green!60!black}
\colorlet{myorange}{orange!70!red!60!black}
\colorlet{mydarkred}{red!30!black}
\colorlet{mydarkblue}{blue!40!black}
\colorlet{mydarkgreen}{green!30!black}
\definecolor{iceberg}{rgb}{0.44, 0.65, 0.82}
\definecolor{firebrick}{rgb}{0.7, 0.13, 0.13}
\definecolor{outerspace}{rgb}{0.25, 0.29, 0.3}
\definecolor{lemonchiffon}{rgb}{1.0, 0.98, 0.8}
\definecolor{flavescent}{rgb}{0.97, 0.91, 0.56}
\definecolor{floralwhite}{rgb}{1.0, 0.98, 0.94}
\definecolor{airforceblue}{rgb}{0.36, 0.54, 0.66}
\definecolor{electriclime}{rgb}{0.8, 1.0, 0.0}
\tikzstyle{node}=[thick,circle,draw=myblue,minimum size=22,inner sep=0.5,outer sep=0.6]
\tikzstyle{node in}=[node,myblue!30!black,draw=myblue!30!black,fill=floralwhite]
\tikzstyle{node hidden}=[node,blue!20!black,draw=myblue!5!black,fill=airforceblue!15]
\tikzstyle{node convol}=[node,orange!20!black,draw=myorange!30!black,fill=myorange!20]
\tikzstyle{node out}=[node,red!20!black,draw=myred!30!black,fill=firebrick!20]
\tikzstyle{connect}=[thick,mydarkblue] %,line cap=round
\tikzstyle{connect arrow}=[-{Latex[length=4,width=3.5]},thick,mydarkblue,shorten <=0.5,shorten >=1]
\tikzset{ % node styles, numbered for easy mapping with \nstyle
node 1/.style={node in},
node 2/.style={node hidden},
node 3/.style={node out},
}
\def\nstyle{int(\lay<\Nnodlen?min(2,\lay):3)} % map layer number onto 1, 2, or 3
\begin{document}
% NEURAL NETWORK
\begin{tikzpicture}[x=2.2cm,y=1.4cm]
\message{^^JNeural network, shifted}
\readlist\Nnod{3,5,5,5,5,5,1} % array of number of nodes per layer
\readlist\Nstr{n,m,m,m,k} % array of string number of nodes per layer
\readlist\Cstr{\strut x,a^{(\prev)},a^{(\prev)},a^{(\prev)},y} % array of coefficient symbol per layer
\def\yshift{0.5} % shift last node for dots
\message{^^J Layer}
\foreachitem \N \in \Nnod{ % loop over layers
\def\lay{\Ncnt} % alias of index of current layer
\pgfmathsetmacro\prev{int(\Ncnt-1)} % number of previous layer
\message{\lay,}
\foreach \i [evaluate={\c=int(\i==\N); \y=\N/2-\i-\c*\yshift;
\index=(\i<\N?int(\i):"\Nstr[\lay]");
\x=\lay; \n=\nstyle;}] in {1,...,\N}{ % loop over nodes
% NODES
\node[node \n] (N\lay-\i) at (\x,\y){}; %{$\Cstr[\lay]_{\index}$};
% CONNECTIONS
\ifnum\lay>1 % connect to previous layer
\foreach \j in {1,...,\Nnod[\prev]}{ % loop over nodes in previous layer
\draw[connect,white,line width=1.2] (N\prev-\j) -- (N\lay-\i);
\draw[connect] (N\prev-\j) -- (N\lay-\i);
%\draw[connect] (N\prev-\j.0) -- (N\lay-\i.180); % connect to left
}
\fi % else: nothing to connect first layer
}
\path (N\lay-\N) --++ (0,1+\yshift) node[midway,scale=1.5] {$\vdots$};
}
% LABELS
\node[above=0.8,align=center,myblue!50!black] at (N1-1.90) {Input\[-0.2em]Layers};
\node[above=0,align=center,airforceblue] at (N4-1.90) {Hidden Layers};
\node[above=60,align=center,myred!60!black] at (N\Nnodlen-1.90) {Output\[-0.2em]Layer};
\end{tikzpicture}
\end{document}
As you can see, there are three vertical dots ($\vdots$) which express the nodes iteration among the "Input Layers," "Hidden Layers," and "Output Layer." When I tried to only delete (or cancel) the $\vdots$ for the "output layer," all $\vdots$ disappeared. So I have to keep the $\vdots$ as follows:
My question is: How can I only keep the $\vdots$ for my input layer and hidden layer, but not for the output layer? Or how to set any single layer should exclude the iteration sign $\vdots$ accordingly?
Thank you in advance, I hope the attached pic helps me illustrate my question.



\ifnum\lay=4 \path (N\lay-\N) --++ (0,1+\yshift) node[midway,scale=1.5] {$\vdots$}; \fi– hpekristiansen Oct 21 '22 at 08:42