\makeatletter
\ifx\du\undefined
  \newlength{\du}
\fi
\setlength{\du}{\unitlength}
\ifx\spacing\undefined
  \newlength{\spacing}
\fi
\setlength{\spacing}{60\unitlength}
\begin{tikzpicture}
\pgfsetlinewidth{0.5\du}
\pgfsetmiterjoin
\pgfsetbuttcap

\node[circle, draw=black] (x1) at (-\spacing, 0) {$x_1$};
\node[circle, draw=black] (x2) at (0, 0) {$x_2$};
\node[circle, draw=white] (x3) at (\spacing, 0) {$\ldots$};
\node[circle, draw=black] (x4) at (2\spacing, 0) {$x_{D}$};

\node[anchor=center] (w) at (0\spacing, 2.5\spacing) {$\WW_3$};
\node[anchor=center] (w) at (-0.2\spacing, 1.5\spacing) {$\WW_2$};
\node[anchor=center] (w) at (-0.2\spacing, 0.5\spacing) {$\WW_1$};

\node[circle, draw=black, minimum size=10\du] (h1) at (-\spacing, \spacing) {$h^1_1$};
\node[circle, draw=black] (h2) at (0, \spacing) {$h^1_2$};
\node[circle, draw=white] (h3) at (\spacing, \spacing) {$\ldots$};
\node[circle, draw=black, minimum size=10\du] (h4) at (2\spacing, \spacing) {$h^1_{J}$};

\node[circle, draw=black, minimum size=10\du] (g1) at (-\spacing, 2\spacing) {$h^2_1$};
\node[circle, draw=black] (g2) at (0, 2\spacing) {$h^2_2$};
\node[circle, draw=white] (g3) at (\spacing, 2\spacing) {$\ldots$};
\node[circle, draw=black, minimum size=10\du] (g4) at (2\spacing, 2\spacing) {$h^2_{K}$};

\node[circle, draw=black] (o) at (0.5\spacing, 3\spacing) {$y$};

\draw[->] (x1) -- (h1);
\draw[->] (x1) -- (h2);
\draw[->] (x1) -- (h4);

\draw[->] (x2) -- (h1);
\draw[->] (x2) -- (h2);
\draw[->] (x2) -- (h4);

\draw[->] (x4) -- (h1);
\draw[->] (x4) -- (h2);
\draw[->] (x4) -- (h4);

\draw[->] (h1) -- (g1);
\draw[->] (h1) -- (g2);
\draw[->] (h1) -- (g4);

\draw[->] (h2) -- (g1);
\draw[->] (h2) -- (g2);
\draw[->] (h2) -- (g4);

\draw[->] (h4) -- (g1);
\draw[->] (h4) -- (g2);
\draw[->] (h4) -- (g4);



\draw[->] (g1) -- (o);
\draw[->] (g2) -- (o);
\draw[->] (g4) -- (o);
\end{tikzpicture}
