I'm new to draw latex. The below is my code:
\documentclass{article}
\usepackage{tikz}
\usepackage{verbatim}
% Basis: http://www.texample.net/tikz/examples/neural-network/
\begin{document}
\pagestyle{empty}
\def\layersep{2.5cm}
\begin{tikzpicture}[shorten >=1pt,->,draw=black!100, node distance=\layersep]
\tikzstyle{every pin edge}=[<-,shorten <=1pt]
\tikzstyle{neuron}=[circle,fill=black!25,minimum size=17pt,inner sep=0pt]
\tikzstyle{input neuron}=[neuron, fill=white!100,draw=black];
\tikzstyle{output neuron}=[neuron, fill=white!100,draw=black];
\tikzstyle{hidden neuron}=[neuron, fill=white!100,draw=black];
\tikzstyle{annot} = [text width=4em, text centered]
% Draw the input layer nodes
\foreach \name / \y in {1,...,3}
% This is the same as writing \foreach \name / \y in {1/1,2/2,3/3,4/4}
\node[input neuron, pin=left:Word \y] (I-\name) at (0,-\y) {};
% Draw the hidden layer nodes
\foreach \name / \y in {1,...,3}
\path[yshift=0cm]
node[hidden neuron] (H-\name) at (\layersep,-\y cm) {};
% Draw the output layer node
\node[output neuron,pin={[pin edge={->}]right:Sentiment Result}, right of=H-2] (O1) {};
% Connect every node in the input layer with every node in the
% hidden layer.
\foreach \source in {1,...,3}
\foreach \dest in {1,...,3}
\path (I-\source) edge (H-\dest);
% Connect every node in the hidden layer with the output layer
\foreach \source in {1,...,3}
\path (H-\source) edge (O1);
% Annotate the layers
\node[annot,above of=H-1, node distance=1cm] (hl) {Vector layer};
\node[annot,left of=hl] {Input layer};
\node[annot,right of=hl] {Output layer};
\end{tikzpicture}
% End of code
\end{document}
I want to: add 2 notations among Input layer, Vector layer and Output Layer. Also, change the Word 3 to Word n and add dots between Word 2 and Word n.
ThanK you a lot!


pgf/tikzmanual? So far you have copied the example code fromhttp://www.texample.net/tikz/examples/neural-network/(it's mentioned in the code as a comment) and have modified it slightly. In addition, I changed your title so that is more meaningful. I would start with a less complex code (maybe without a loop) and build the system step-by-step in order to learn the basics. – Dr. Manuel Kuehner Apr 11 '17 at 20:13