I want to create an FNN and DNN figures using tikz, I found on Internet this example for FNN and I like it:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\usetikzlibrary{matrix,chains,positioning,decorations.pathreplacing,arrows}
\usetikzlibrary{positioning,calc}
\tikzset{%
every neuron/.style={circle,draw,minimum size=1cm},
neuron missing/.style={draw=none,scale=4,text height=0.333cm,execute at begin node=\color{black}$\vdots$},
}
\begin{figure}
\centering
\begin{tikzpicture}[
plain/.style={
draw=none,
fill=none,
},
dot/.style={draw,shape=circle,minimum size=3pt,inner sep=0,fill=black
},
net/.style={
matrix of nodes,
nodes={
draw,
circle,
inner sep=8.5pt
},
nodes in empty cells,
column sep=0.5cm,
row sep=-11pt
},
>=latex
]
\matrix[net] (mat)
{
|[plain]| \parbox{1cm}{\centering Input\\layer}
& |[plain]| \parbox{1cm}{\centering Hidden\\layer}
& |[plain]| \parbox{1cm}{\centering ...}
& |[plain]| \parbox{2cm}{\centering Hidden\\layer n}
& |[plain]| \parbox{1cm}{\centering Output\\layer} \\
& |[plain]| & |[plain]| & |[plain]| & |[plain]| \\
|[plain]| & & |[plain]| & & |[plain]| \\
& |[plain]| & |[plain]| & |[plain]| & \\
|[plain]| & |[dot]| & |[plain]| & |[dot]| \\
& |[plain]| & |[plain]| & |[plain]| & |[dot]| \\
|[plain]| & |[dot]| & |[plain]| & |[dot]| & |[plain]| \\
|[dot]| & |[plain]| & |[plain]| & |[plain]| & |[dot]| \\
|[dot]| & |[dot]| & |[plain]| & |[dot]| & |[plain]| \\
|[dot]| & |[plain]| & |[plain]| & |[plain]| & \\
|[plain]| & & |[plain]| & & |[plain]| \\
& |[plain]| & |[plain]| \\
};
\foreach \ai/\mi in {2/Input feature 1,4/Input feature 2,6/Input feature 3,12/Input feature n}
\draw[<-] (mat-\ai-1) -- node[above] {\mi} +(-3cm,0);
\foreach \ai in {2,4,6,12}
{\foreach \aii/\mii in {3/N1,11/Nn}
\draw[->] (mat-\ai-1) -- (mat-\aii-2) node[yshift=0.6cm] {\mii};
}
\foreach \ai in {3,11}
{ \draw[->] (mat-4-3) -- node[above] {Output 1} +(2cm,0);}
\foreach \ai in {3,11}
{ \draw[->] (mat-\ai-2) -- (mat-10-3);
\draw[->] (mat-10-3) -- node[above] {Output n} +(2cm,0);}
\end{tikzpicture}
\caption{Feedforward Neural Network structure.}
\label{fig:FNN}
\end{figure}
\end{document}
But I am not so familiar with Latex and tikz so I do not know how to modify it so it can work for my DNN too.
This is how it looks my code after my modifications:

Here is how I want to look like:

How can I do that? Thank you!

\documentclass ...and ending with\end{document}which contain your image only. Searching this site will give you solution for many similar neural networks. – Zarko Nov 13 '18 at 09:11