-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathfigure5-1-a-one_hidden_layer.tex
More file actions
63 lines (49 loc) · 1.45 KB
/
figure5-1-a-one_hidden_layer.tex
File metadata and controls
63 lines (49 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
\documentclass[tikz, border=50pt]{standalone}
\usepackage{tikz}
\usepackage{medl_colors}
\usetikzlibrary{shapes.multipart, shapes.geometric, arrows.meta}
\usetikzlibrary{matrix, calc, positioning,fit}
\begin {document}
% Layer A neurons'number
\newcommand{\numlayerA}{4}
% Layer B neurons'number
\newcommand{\numlayerB}{5}
% Layer C neurons'number
\newcommand{\numlayerC}{1}
\begin{tikzpicture}
% Layer A
\foreach \i in {1,...,\numlayerA}
{
\node[greenshape, circle, minimum size = 1cm] (layerA\i) at (0,-\i*2-1) {\Large $x_\i$};
}
% Layer B
\foreach \i in {1,...,\numlayerB}
{
\node[blueshape, circle, minimum size = 1cm] (layerB\i) at (4,-\i*2) {};
}
% Layer C
\foreach \i in {1,...,\numlayerC}
{
\node[redshape, circle, minimum size = 1cm] (layerC\i) at (8,-6) {\Large $\hat y$};
}
%connect Layer A and Layer B
\foreach \i in {1,...,\numlayerA}
{
\foreach \j in {1,...,\numlayerB}
{
\draw[-Triangle, thickline] (layerA\i) -- (layerB\j);
}
}
%connect Layer B and Layer C
\foreach \i in {1,...,\numlayerB}
{
\foreach \j in {1,...,\numlayerC}
{
\draw[-Triangle, thickline] (layerB\i) -- (layerC\j);
}
}
\node[above of=layerA1, align=center, node distance=2.5cm] {\Large Input\\\Large Layer};
\node[above of=layerB1, align=center, node distance=1.5cm] {\Large Hidden\\\Large Layer};
\node[above of=layerC1, align=center, node distance=5.5cm] {\Large Output\\\Large Layer};
\end{tikzpicture}
\end {document}