-
Notifications
You must be signed in to change notification settings - Fork 22
/
chapter5.html
372 lines (306 loc) · 16.5 KB
/
chapter5.html
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<!-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> -->
<!-- Social media -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@OKAI" />
<!-- BB Change this--><meta name="twitter:title" content="Chapter 5: Introduction to Feedforward Neural Networks" />
<!-- CC Change this--><meta name="twitter:description" content="This chapter presents the anatomy of the simplest type of artificial neural networks - feedforward neural networks." />
<!-- AA Change this--><meta name="twitter:image" content="https://okai.brown.edu/img/share/en/en_5.png" />
<!-- Change this--><meta property="og:url" content="https://okai.brown.edu/chapter5.html" />
<meta property="og:type" content="article" />
<!-- BB Change this--><meta property="og:title" content="Chapter 5: Introduction to Feedforward Neural Networks" />
<!-- CC Change this--><meta property="og:description" content="This chapter presents the anatomy of the simplest type of artificial neural networks - feedforward neural networks." />
<!-- AA Change this--><meta property="og:image" content="https://okai.brown.edu/img/share/en/en_5.png" />
<!-- ................... -->
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:400,700" rel="stylesheet">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ"
crossorigin="anonymous">
<!-- Bootstrap CSS CDN -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"
integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4"
crossorigin="anonymous">
<!-- Scrollbar Custom CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.min.css">
<!-- My stylesheet -->
<link rel="stylesheet" href="./css/general.css">
<!-- change to own stylesheet -->
<link rel="stylesheet" href="./css/chapter5.css">
<!-- language annotations -->
<link rel="alternate" hreflang="zh-Hans" href="https://okai.brown.edu/zh/chapter5.html" />
<link rel="alternate" hreflang="en" href="https://okai.brown.edu/chapter5.html" />
<link rel="canonical" href="https://okai.brown.edu/chapter5.html" />
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-133914635-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-133914635-1');
</script>
<title>Chapter 5 - OKAI</title>
</head>
<body>
<!-- scrollbar -->
<div class="scrollBar" id="myBar"></div>
<!-- navbar place holder -->
<div id="nav-placeholder"></div>
<!-- ######################### -->
<!-- Chapter content beginning -->
<!-- ######################### -->
<!-- landing section -->
<div id="openingText" class="d-flex align-items-center justify-content-center">
<!-- start of row 1 -->
<div class="row align-items-center justify-content-center">
<!-- col 1 -->
<div class="d-none d-md-block col-1 arrowIcon" style="position: absolute; left: 5px;">
<a href="./chapter4.html" data-toggle="tooltip" title="Chapter 4"><i class="fas fa-caret-left fa-2x"></i></a>
</div>
<!-- col 2 -->
<div class="col-10 col-md-4 order-2 order-md-1 text-center">
<div class="text-left">
<p>Chapter 5</p>
<h2>Introduction to Feedforward Neural Networks</h2>
<p>Feedforward neural networks combine multiple perceptrons to complete far
more challenging tasks. This chapter presents the anatomy of this simplest
type of artificial neural networks. Keep scrolling!</p>
</div>
</div>
<!-- col 3 -->
<div class="col-md-5 order-1 order-md-2">
<div id="openingLottie" class="openingAnimation mx-auto"></div>
</div>
<!-- col-4 -->
<div class="d-none d-md-block col-1 arrowIcon" style="position: absolute; right: 5px;">
<a href="./chapter6.html" data-toggle="tooltip" title="Chapter 6"><i class="fas fa-caret-right fa-2x"></i></a>
</div>
</div>
<!-- end of row 1 -->
<!-- start of row 2 -->
<div class="" style="position: absolute; bottom: 20px;">
<div>
<p class="iconHeight" id="scrollIcon">Scroll</p>
<i class="iconHeight fas fa-angle-down fa-lg"></i>
</div>
<!-- end of row 2 -->
</div>
</div>
<!-- end of landing section -->
<!-- ######## Animation & text beginning ######## -->
<!-- animation divs -->
<div id="fnnLottie" class="animation animLeft upperLayer"></div>
<div id="tempLottie" class="animation animRight topLayer"></div>
<div id="complexLottie" class="animation animLeft threeLayer"></div>
<!-- text begins -->
<!-- fnn animation text section -->
<div id="text1" class="bg-1grey scene">
<div class="text right">
<p>To this point, we have only discussed networks with a single perceptron. These
perceptron algorithms are not particularly powerful, as they cannot learn complex
concepts. To improve them, we need to "wire" perceptrons together so that they can
form a more complex model.
</p>
</div>
</div>
<div id="text2" class="bg-1grey scene">
<div class="text right">
<p>"Wiring" multiple perceptrons together give us a feedforward neural network. Now,
instead of only having several inputs, we now have an input layer. The layers
between this first layer and the last layer are called <strong class="highlight"
data-toggle="tooltip" title="The middle layers of feedforward neural network that performs computations.">
hidden layers</strong> since they are invisible to the inputs and outputs of
the network.
</p>
</div>
</div>
<div id="text3" class="bg-1grey scene">
<div class="text right">
<p>The last layer is called the output layer. We say that a network has n layers when
there are n layers that perform computations. That is, there are n-1 hidden layers
and 1 output layer.</p>
</div>
</div>
<!-- temp animation text section -->
<div id="text4" class="scene bg-2grey upperLayer">
<div class="text left">
<p>As an example of how a neural network can solve an everyday problem, let’s say that
we want to predict tomorrow’s temperature range using a network that has already
been trained.
</p>
</div>
</div>
<div id="text5" class="scene bg-2grey upperLayer">
<div class="text left">
<p>The network that we are using is a simple two-layer feedforward neural network that
takes in two inputs:
the maximum and minimum temperature of today.
</p>
</div>
</div>
<div id="text6" class="scene bg-2grey upperLayer">
<div class="text left">
<p>These two inputs in the input layer are then sent to 4 perceptrons in the hidden
layer. Then, the outputs of the hidden layer are fed into the 2 outputs in the
output layer, which generate the network’s guess of tomorrow’ maximum and minimum
temperatures.
</p>
</div>
</div>
<div id="text7" class="scene bg-2grey upperLayer">
<div class="text left">
<p>In this network, all of the <strong data-toggle="tooltip" class="highlight" title="Used as a synonym for a perceptron that is part of a more complex network.">
nodes</strong>
in the hidden layer have a ReLU function, while the last layer is a linear layer
(meaning that it has no activation function). But why do we need activation
functions when we don’t need to control the range of output here? And what exactly
does ReLU do?
</p>
</div>
</div>
<div id="text8" class="scene bg-2grey upperLayer">
<div class="text left">
<p>
It turns out that, if we have consecutive linear layers, the network will behave
exactly the same as a network with a single linear layer. To make the extra layers
count, we need to introduce non-linearity.
One of the most popular choices to break linearity is <strong data-toggle="tooltip"
class="highlight" title="ReLU stands for Rectified Linear Unit. It maintains the value if the input is bigger than or equal to 0, and, if the input is negative,
it forces everything to be 0.">ReLU</strong>.
</p>
</div>
</div>
<!-- complex animation text section-->
<div id="text9" class="scene topLayer bg-3grey">
<div class="text right">
<p>
With these activation functions, we can wire up enough layers so that the network
can learn complex tasks, such as recognizing handwritten digits as showcased in
Chapter 0.
</p>
</div>
</div>
<div id="text10" class="scene topLayer bg-3grey">
<div class="text right">
<p>
Now that we have understood the basics of how feedforward neural networks work, we
can get our hands a little dirty and look at how we can train a model to classify
handwritten digits.
</p>
</div>
</div>
<!-- ending section -->
<div id="endingText" class="lastScene row align-items-center justify-content-around fiveLayer">
<!-- col 1 -->
<div class="d-none d-md-block col-1 arrowIcon" style="position: absolute; left: 5px;">
<a href="./chapter4.html" data-toggle="tooltip" title="Chapter 4"><i class="fas fa-caret-left fa-2x"></i></a>
</div>
<div class="col-12 col-md-10">
<div class="row justify-content-around">
<div class="col-10 col-md-5 fourLayer align-self-start">
<div class="text-left align-self-start">
<h3><strong>Summary</strong></h3>
<p>In this chapter, we have examined how the components of a feedforward
neural network work
together to solve hard problems. In the next chapter, we break down the
feedforward neural network used in Chapter 0 to interactively
recognize digits.
</p>
<h3><strong>Further Reading</strong></h3>
<p>
<a href="https://youtu.be/aircAruvnKk" target="_blank">
But what *is* a Neural Network? </a>
<br><a href="https://towardsdatascience.com/deep-learning-feedforward-neural-network-26a6705dbdc7"
target="_blank">
Deep Learning: Feedforward Neural Network</a>
<br><a href="https://cs.stanford.edu/people/eroberts/courses/soco/projects/neural-networks/Architecture/feedforward.html"
target="_blank">
Neural Networks - Architecture - Stanford CS</a>
<br><a href="https://youtu.be/2hMuYi2Wudw" target="_blank">
What are neural networks? - SciToons</a>
</p>
</div>
</div>
<div class="col-10 col-md-5 fourLayer align-self-start">
<div class="text-left">
<h3><strong>Glossary</strong></h3>
<p>
<strong>Hidden Layer</strong>: The middle layers of a feedforward
neural network that performs intermediate computations.<br><br>
<strong>Node</strong>: Used as a synonym for a perceptron that is part
of a more complex network.<br><br>
<strong>ReLU</strong>: Rectified Linear Unit. A type of activation
functions commonly used to break linearity.
</p>
</div>
</div>
<!-- mobile nav button groups -->
<div class="col-10 d-md-none fourLayer justify-content-start my-3">
<div class="btn-group d-flex" id="nextButtonGroup" role="group">
<a class="btn btn-warning w-50" href="./chapter4.html"
role="button" id="prevButton">Prev Chapter</a>
<span class="btn-warning btn-separator"></span>
<a class="btn btn-warning w-50" href="./chapter6.html"
role="button" id="nextButton">Next Chapter</a>
</div>
</div>
<!-- end of inner row -->
</div>
<!-- end of outer col-10 -->
</div>
<!-- col-4 -->
<div class="d-none d-md-block col-1 arrowIcon" style="position: absolute; right: 5px;">
<a href="./chapter6.html" data-toggle="tooltip" title="Chapter 6"><i class="fas fa-caret-right fa-2x"></i></a>
</div>
<!-- end of ending section -->
</div>
<!-- end of text area -->
<div class="overlay"></div>
<!-- svg goo filter DO NOT DELETE-->
<svg version="1.1" xmlns="https://www.w3.org/2000/svg" style="height: 0; width: 0; position: absolute; top: -9999px; left: -99990px">
<defs>
<filter color-interpolation-filters="sRGB" id="goo">
<feGaussianBlur in="SourceGraphic" stdDeviation="7" result="blur" />
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 21 -9"
result="cm" />
<feBlend />
</filter>
</defs>
</svg>
<!-- Boostrap JavaScript -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"
integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm"
crossorigin="anonymous"></script>
<!-- jQuery Custom Scroller CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.concat.min.js"></script>
<!-- GSAP -->
<script type="text/javascript" src="./js/TweenMax.min.js"></script>
<script type="text/javascript" src="./js/DrawSVGPlugin.min.js"></script>
<script type="text/javascript" src="./js/MorphSVGPlugin.min.js"></script>
<!-- Lottie -->
<script type="text/javascript" src="./js/lottie.js"></script>
<!-- ScrollMagic JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.6/ScrollMagic.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/plugins/animation.gsap.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5//plugins/debug.addIndicators.js"></script>
<script type="text/javascript" src="./js/main.js"></script>
<!-- change to own js files -->
<script type="text/javascript" src="./js/chapter5.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip({
placement: "top"
});
});
</script>
</body>
</html>