[Tex/LaTex] Draw single neural unit using tizk

tikz-pgf

I would like to draw the following picture:
enter image description here

The following is my latex code:

  \documentclass{article}

\usepackage{tikz}
\usetikzlibrary{positioning,arrows.meta,calc}

\tikzset{
  arro/.style={
    ->,
    >=latex
  },
  bloque/.style={
    draw,
    minimum height=1cm,
    minimum width=0.5cm
  }  
}

\begin{document}

\begin{tikzpicture}[]
\node[]
  (input)
  {Input};
\node[below=of input,label={left:$x_{1}$}]
  (inputi)
  {};
\node[below=of inputi,label={left:$x_{2}$}]
  (inputii)
  {};
\coordinate[below=of inputii] (aux);  
\node[below=of aux,label={left:$x_{3}$}]
  (inputiii)
  {};
\node[below=of inputiii,label={left:$+1$}]
  (inputiv)
  {};

\node[right=of input]
  (proje)
  {Projection};
\node[circle,label={above:\textsc{sum}}]
  at (proje|-aux)
  (projei)
  {};

\node[right=of proje]
  (out)
  {Output};
\node[label={right:$h_{w,b}(x)$}]
  at (out|-aux)
  (outi)
  {};

\foreach \Valor in {i,ii,iii,iv}
{
  \draw[arro] (input\Valor) -- (projei);
}  
\draw[arro] (projei) -- (outi);
\end{tikzpicture}

\end{document}

What I get is:
enter image description here

I try to add the following code:\begin{tikzpicture}[every node/.style={draw=black,circle}]

and get this:
enter image description here

Could someone help me? Thank you!

Best Answer

You've almost answered the question yourself, but you don't want to draw the outline of every node, just one. So you need to add draw as an option to just that one node. To increase the size you can add e.g minimum size=1cm as well, and add a color name if you want to change the color.

In the code below I've just added one line, indicated by the comment.

enter image description here

  \documentclass{article}

\usepackage{tikz}
\usetikzlibrary{positioning,arrows.meta,calc}

\tikzset{
  arro/.style={
    ->,
    >=latex
  },
  bloque/.style={
    draw,
    minimum height=1cm,
    minimum width=0.5cm
  }  
}

\begin{document}

\begin{tikzpicture}[]
\node[]
  (input)
  {Input};
\node[below=of input,label={left:$x_{1}$}]
  (inputi)
  {};
\node[below=of inputi,label={left:$x_{2}$}]
  (inputii)
  {};
\coordinate[below=of inputii] (aux);  
\node[below=of aux,label={left:$x_{3}$}]
  (inputiii)
  {};
\node[below=of inputiii,label={left:$+1$}]
  (inputiv)
  {};

\node[right=of input]
  (proje)
  {Projection};
\node[circle,
   draw,minimum size=1cm,orange, %% <-- these are added
   label={above:\textsc{sum}}]
  at (proje|-aux)
  (projei)
  {};

\node[right=of proje]
  (out)
  {Output};
\node[label={right:$h_{w,b}(x)$}]
  at (out|-aux)
  (outi)
  {};

\foreach \Valor in {i,ii,iii,iv}
{
  \draw[arro] (input\Valor) -- (projei);
}  
\draw[arro] (projei) -- (outi);
\end{tikzpicture}

\end{document}

I would also suggest that you don't use label for the input nodes on the left and the output node. With a couple of other minor changes:

enter image description here

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{positioning,arrows.meta,calc}

\tikzset{
  arro/.style={
    ->,
    >=latex
  },
  bloque/.style={
    draw,
    minimum height=1cm,
    minimum width=0.5cm
  }  
}

\begin{document}

\begin{tikzpicture}[node distance=0.5cm and 1cm] % first value vertical distance, second horizontal
\node
  (input)
  {Input};
\node[below=of input]
  (inputi)
  {$x_{1}$};
\node[below=of inputi]
  (inputii)
  {$x_{2}$};
\coordinate[below=of inputii] (aux);  
\node[below=of aux]
  (inputiii)
  {$x_{3}$};
\node[below=of inputiii]
  (inputiv)
  {$+1$};

\node[right=of input]
  (proje)
  {Projection};
\node[circle,
   draw,minimum size=1cm,orange, 
   label={above:\textsc{sum}}]
  at (proje|-aux)
  (projei)
  {};

\node[right=of proje]
  (out)
  {Output};
\node
  at (out|-aux)
  (outi)
  {$h_{w,b}(x)$};

\foreach \Valor in {i,ii,iii,iv}
{
  \draw[arro] (input\Valor) -- (projei);
}  
\draw[arro] (projei) -- (outi);
\end{tikzpicture}
\end{document}