-
Notifications
You must be signed in to change notification settings - Fork 27
/
2013-03-01-Neural-Network.html
959 lines (739 loc) · 26.5 KB
/
2013-03-01-Neural-Network.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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>2013-03-01-Neural-Network</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta name="title" content="2013-03-01-Neural-Network"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="2013-03-04 23:20:39 PST"/>
<meta name="author" content="Jim Blomo"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<link rel="stylesheet" type="text/css" href="production/common.css" />
<link rel="stylesheet" type="text/css" href="production/screen.css" media="screen" />
<link rel="stylesheet" type="text/css" href="production/projection.css" media="projection" />
<link rel="stylesheet" type="text/css" href="production/color-blue.css" media="projection" />
<link rel="stylesheet" type="text/css" href="production/presenter.css" media="presenter" />
<link href='http://fonts.googleapis.com/css?family=Lobster+Two:700|Yanone+Kaffeesatz:700|Open+Sans' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="preamble">
</div>
<div id="content">
<h1 class="title">2013-03-01-Neural-Network</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Bias vs. Variance</a></li>
<li><a href="#sec-2">2 Trade-offs</a>
<ul>
<li><a href="#sec-2-1">2.1 Details</a></li>
</ul>
</li>
<li><a href="#sec-3">3 Regression</a>
<ul>
<li><a href="#sec-3-1">3.1 Polynomial</a></li>
<li><a href="#sec-3-2">3.2 One</a>
<ul>
<li><a href="#sec-3-2-1">3.2.1 So-So</a></li>
</ul>
</li>
<li><a href="#sec-3-3">3.3 Two</a>
<ul>
<li><a href="#sec-3-3-1">3.3.1 Better</a></li>
</ul>
</li>
<li><a href="#sec-3-4">3.4 Three</a>
<ul>
<li><a href="#sec-3-4-1">3.4.1 Worrying</a></li>
</ul>
</li>
<li><a href="#sec-3-5">3.5 Many</a>
<ul>
<li><a href="#sec-3-5-1">3.5.1 Now kind of ridiculous</a></li>
</ul></li>
</ul>
</li>
<li><a href="#sec-4">4 Over-fitting</a>
<ul>
<li><a href="#sec-4-1">4.1 Avoidance</a></li>
</ul>
</li>
<li><a href="#sec-5">5 Neural Networks</a>
<ul>
<li><a href="#sec-5-1">5.1 notes</a></li>
</ul>
</li>
<li><a href="#sec-6">6 Brains</a></li>
<li><a href="#sec-7">7 Training</a></li>
<li><a href="#sec-8">8 Nomenclature</a></li>
<li><a href="#sec-9">9 Handwriting</a>
<ul>
<li><a href="#sec-9-1">9.1 Inputs => Outputs</a></li>
</ul>
</li>
<li><a href="#sec-10">10 Forward Propagation</a>
<ul>
<li><a href="#sec-10-1">10.1 Repeat</a></li>
<li><a href="#sec-10-2">10.2 Sigmoid</a></li>
</ul>
</li>
<li><a href="#sec-11">11 Example</a>
<ul>
<li><a href="#sec-11-1">11.1 Simple</a></li>
<li><a href="#sec-11-2">11.2 Weights</a>
<ul>
<li><a href="#sec-11-2-1">11.2.1 Later</a></li>
</ul>
</li>
<li><a href="#sec-11-3">11.3 Sigmoid</a>
<ul>
<li><a href="#sec-11-3-1">11.3.1 Apply</a></li>
</ul>
</li>
<li><a href="#sec-11-4">11.4 Sigmoid</a>
<ul>
<li><a href="#sec-11-4-1">11.4.1 Apply</a></li>
</ul>
</li>
<li><a href="#sec-11-5">11.5 Sigmoid</a>
<ul>
<li><a href="#sec-11-5-1">11.5.1 Apply</a></li>
</ul>
</li>
<li><a href="#sec-11-6">11.6 Sigmoid</a>
<ul>
<li><a href="#sec-11-6-1">11.6.1 Apply</a></li>
</ul>
</li>
<li><a href="#sec-11-7">11.7 Weights</a>
<ul>
<li><a href="#sec-11-7-1">11.7.1 Repeat</a></li>
</ul>
</li>
<li><a href="#sec-11-8">11.8 Sigmoid</a>
<ul>
<li><a href="#sec-11-8-1">11.8.1 Apply</a></li>
</ul></li>
</ul>
</li>
<li><a href="#sec-12">12 Forward Propagation</a>
<ul>
<li><a href="#sec-12-1">12.1 Get an answer</a></li>
</ul>
</li>
<li><a href="#sec-13">13 Fitness Function</a>
<ul>
<li><a href="#sec-13-1">13.1 Neural Network</a></li>
</ul>
</li>
<li><a href="#sec-14">14 Back Propagation</a>
<ul>
<li><a href="#sec-14-1">14.1 Derivative</a></li>
</ul>
</li>
<li><a href="#sec-15">15 Example</a>
<ul>
<li><a href="#sec-15-1">15.1 Expected</a></li>
</ul>
</li>
<li><a href="#sec-16">16 Terminate Learning</a>
<ul>
<li><a href="#sec-16-1">16.1 Forward and Back</a></li>
</ul>
</li>
<li><a href="#sec-17">17 <b>Break</b></a></li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Bias vs. Variance <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-1">
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Trade-offs <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-2">
<ul>
<li>Similar to precision, we make trade-offs when training models
</li>
<li>Bias: How far off are the model predictions on average?
</li>
<li>Variance: If we retrained with different data, how different would our
guesses be?
</li>
</ul>
</div>
<div id="outline-container-2-1" class="outline-3">
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> Details <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-2-1">
<ul>
<li>Bias: difference in "Expected" value from models from the real value
</li>
<li>Variance: difference in "Expected" value from each other
</li>
<li>Variance: Another way to think about it: how specific is our model to our
data? If we were training a tree with k-fold validation, would we get
completely different rule sets for each set of data?
</li>
<li>"Expected": These are <b>model type</b> properties. Train the model multiple
times with different data, then evaluate all models performance
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3"><span class="section-number-2">3</span> Regression <span class="tag"><span class="slide">slide</span> <span class="two_col">two_col</span></span></h2>
<div class="outline-text-2" id="text-3">
<ul>
<li>Can we do better than linear regression on some data sets?
</li>
<li>Polynomial regression
</li>
<li>How many polynomials?
</li>
</ul>
<p> <img src="img/overfit1.png" alt="img/overfit1.png" />
</p>
</div>
<div id="outline-container-3-1" class="outline-3">
<h3 id="sec-3-1"><span class="section-number-3">3.1</span> Polynomial <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-3-1">
<ul>
<li>Sure! Use a polynomial instead: <code>x^2</code> <code>2x - x^2 + 4x^3</code>
</li>
<li>If you're not sure what the underlying data model is, have to test
</li>
<li>img: <a href="http://cheshmi.tumblr.com/">http://cheshmi.tumblr.com/</a>
</li>
</ul>
</div>
</div>
<div id="outline-container-3-2" class="outline-3">
<h3 id="sec-3-2"><span class="section-number-3">3.2</span> One <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-3-2">
<p> <img src="img/overfit1.png" alt="img/overfit1.png" />
</p>
</div>
<div id="outline-container-3-2-1" class="outline-4">
<h4 id="sec-3-2-1"><span class="section-number-4">3.2.1</span> So-So <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-3-2-1">
<ul>
<li>How is the bias? Not great, fair amount of error
</li>
<li>How is the variance? Pretty good, assuming random sample
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-3-3" class="outline-3">
<h3 id="sec-3-3"><span class="section-number-3">3.3</span> Two <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-3-3">
<p> <img src="img/overfit2.png" alt="img/overfit2.png" />
</p>
</div>
<div id="outline-container-3-3-1" class="outline-4">
<h4 id="sec-3-3-1"><span class="section-number-4">3.3.1</span> Better <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-3-3-1">
<ul>
<li>Bias? Better, less error
</li>
<li>Variance? more risky depending on which samples you get, since model
diverges quickly
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-3-4" class="outline-3">
<h3 id="sec-3-4"><span class="section-number-3">3.4</span> Three <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-3-4">
<p> <img src="img/overfit3.png" alt="img/overfit3.png" />
</p>
</div>
<div id="outline-container-3-4-1" class="outline-4">
<h4 id="sec-3-4-1"><span class="section-number-4">3.4.1</span> Worrying <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-3-4-1">
<ul>
<li>Now getting a little weird. We're not finding the general pattern, more
like exactly fitting a line over these points
</li>
<li>If we made model with different data, we're going to get a different line
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-3-5" class="outline-3">
<h3 id="sec-3-5"><span class="section-number-3">3.5</span> Many <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-3-5">
<p> <img src="img/overfit5.png" alt="img/overfit5.png" />
</p>
</div>
<div id="outline-container-3-5-1" class="outline-4">
<h4 id="sec-3-5-1"><span class="section-number-4">3.5.1</span> Now kind of ridiculous <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-3-5-1">
<ul>
<li>Intuitively we know this is not a description of the data
</li>
<li>If a point was found near the border, completely dependant on the data the
model trained on
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="outline-container-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> Over-fitting <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-4">
<ul>
<li>Over-fitting: reflecting the exact data given instead of the general pattern
</li>
<li>High variance is a sign of over-fitting: model guesses vary with the exact
data given
</li>
<li>Avoidance: ensembles average out variance, regularization adds a cost to
model complexity
</li>
</ul>
</div>
<div id="outline-container-4-1" class="outline-3">
<h3 id="sec-4-1"><span class="section-number-3">4.1</span> Avoidance <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-4-1">
<ul>
<li>Ensembles combine multiple models together. Those multiple models may have
a lot of variance, but as long as they have good Bias, we'll center in on
the correct result
</li>
<li>Remember our cost function? We wanted to minimize the error. If you add in
a way to measure model complexity, you can add that to the cost, so that
you are explicitly trading-off the complexity of your model with the
quality of the solution
</li>
<li>If we wanted to add a complexity cost to the previous model, what would the
cost be dependent on?
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-5" class="outline-2">
<h2 id="sec-5"><span class="section-number-2">5</span> Neural Networks <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-5">
<p> <img src="img/neuron_culture.jpg" alt="img/neuron_culture.jpg" />
</p>
</div>
<div id="outline-container-5-1" class="outline-3">
<h3 id="sec-5-1"><span class="section-number-3">5.1</span> notes <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-5-1">
<ul>
<li>img: <a href="http://adrianbowyer.blogspot.com/2010/12/hardwired.html">http://adrianbowyer.blogspot.com/2010/12/hardwired.html</a>
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-6" class="outline-2">
<h2 id="sec-6"><span class="section-number-2">6</span> Brains <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-6">
<ul>
<li>Neural networks try to model our brains
</li>
<li>Neurons/perceptrons sense input, transform it, send output
</li>
<li>Neurons/perceptrons are connected together
</li>
<li>Connections have different strengths
</li>
</ul>
</div>
</div>
<div id="outline-container-7" class="outline-2">
<h2 id="sec-7"><span class="section-number-2">7</span> Training <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-7">
<ul>
<li>Learn by adjusting the strengths of the connections
</li>
<li>Mathematically, strength is a weight multiplier of the output
</li>
<li>When we've found the right weights
</li>
</ul>
</div>
</div>
<div id="outline-container-8" class="outline-2">
<h2 id="sec-8"><span class="section-number-2">8</span> Nomenclature <span class="tag"><span class="slide">slide</span> <span class="two_col">two_col</span></span></h2>
<div class="outline-text-2" id="text-8">
<dl>
<dt>Input layer</dt><dd>neurons whose input is determined by features
</dd>
<dt>Hidden layer</dt><dd>neurons that calculate a combination of features
</dd>
<dt>Output layer</dt><dd>neurons that express the classification
</dd>
<dt>Weights</dt><dd>numeric parameter to adjust input/output
</dd>
</dl>
<p> <img src="img/nn.png" alt="img/nn.png" />
</p>
</div>
</div>
<div id="outline-container-9" class="outline-2">
<h2 id="sec-9"><span class="section-number-2">9</span> Handwriting <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-9">
<ul>
<li>Recognize handwritten digits
</li>
</ul>
<p> <img src="img/neuron11.gif" alt="img/neuron11.gif" />
</p>
</div>
<div id="outline-container-9-1" class="outline-3">
<h3 id="sec-9-1"><span class="section-number-3">9.1</span> Inputs => Outputs <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-9-1">
<ul>
<li>Break up drawing cell into pixels
</li>
<li>Input takes pixel=on|off
</li>
<li>Output is highest valued output node, 1 for each digit
</li>
<li>img: <a href="http://vv.carleton.ca/~neil/neural/neuron-d.html">http://vv.carleton.ca/~neil/neural/neuron-d.html</a>
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-10" class="outline-2">
<h2 id="sec-10"><span class="section-number-2">10</span> Forward Propagation <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-10">
<ol>
<li>Sum of inputs * weights
</li>
<li>Apply sigmoid
</li>
<li>Send output to next layer
</li>
<li>Repeat
</li>
</ol>
</div>
<div id="outline-container-10-1" class="outline-3">
<h3 id="sec-10-1"><span class="section-number-3">10.1</span> Repeat <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-10-1">
<ul>
<li>Multiple hidden layers used to model complex feature interaction
</li>
</ul>
<p> <img src="img/2-layer-nn.gif" alt="img/2-layer-nn.gif" />
</p>
</div>
</div>
<div id="outline-container-10-2" class="outline-3">
<h3 id="sec-10-2"><span class="section-number-3">10.2</span> Sigmoid <span class="tag"><span class="slide">slide</span> <span class="two_col">two_col</span></span></h3>
<div class="outline-text-3" id="text-10-2">
<ul>
<li>Normalize input to [0,1]
</li>
<li>Makes weak input weaker, strong input stronger
</li>
<li><code>1 / (1 + e^-input)</code>
</li>
</ul>
<p> <img src="img/sigmoid.png" alt="img/sigmoid.png" />]
</p>
</div>
</div>
</div>
<div id="outline-container-11" class="outline-2">
<h2 id="sec-11"><span class="section-number-2">11</span> Example <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-11">
<p> <img src="img/nn-fp1.png" alt="img/nn-fp1.png" />
</p>
</div>
<div id="outline-container-11-1" class="outline-3">
<h3 id="sec-11-1"><span class="section-number-3">11.1</span> Simple <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-11-1">
<ul>
<li>Simple NN with just one output
</li>
<li>Output can model true/false
</li>
<li>Inputs are numerical
</li>
</ul>
</div>
</div>
<div id="outline-container-11-2" class="outline-3">
<h3 id="sec-11-2"><span class="section-number-3">11.2</span> Weights <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-11-2">
<p> <img src="img/ann2.png" alt="img/ann2.png" />
</p>
</div>
<div id="outline-container-11-2-1" class="outline-4">
<h4 id="sec-11-2-1"><span class="section-number-4">11.2.1</span> Later <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-11-2-1">
<ul>
<li>We'll discuss how weights are determined later
</li>
<li>Fill in the Hidden layer with sum of inputs * weights
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-11-3" class="outline-3">
<h3 id="sec-11-3"><span class="section-number-3">11.3</span> Sigmoid <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-11-3">
<p> <img src="img/ann3.png" alt="img/ann3.png" />
</p>
</div>
<div id="outline-container-11-3-1" class="outline-4">
<h4 id="sec-11-3-1"><span class="section-number-4">11.3.1</span> Apply <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-11-3-1">
<ul>
<li>Apply the sigmoid to the incoming signals
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-11-4" class="outline-3">
<h3 id="sec-11-4"><span class="section-number-3">11.4</span> Sigmoid <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-11-4">
<p> <img src="img/ann4.png" alt="img/ann4.png" />
</p>
</div>
<div id="outline-container-11-4-1" class="outline-4">
<h4 id="sec-11-4-1"><span class="section-number-4">11.4.1</span> Apply <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-11-4-1">
<ul>
<li>Apply the sigmoid to the incoming signals
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-11-5" class="outline-3">
<h3 id="sec-11-5"><span class="section-number-3">11.5</span> Sigmoid <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-11-5">
<p> <img src="img/ann5.png" alt="img/ann5.png" />
</p>
</div>
<div id="outline-container-11-5-1" class="outline-4">
<h4 id="sec-11-5-1"><span class="section-number-4">11.5.1</span> Apply <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-11-5-1">
<ul>
<li>Apply the sigmoid to the incoming signals
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-11-6" class="outline-3">
<h3 id="sec-11-6"><span class="section-number-3">11.6</span> Sigmoid <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-11-6">
<p> <img src="img/ann6.png" alt="img/ann6.png" />
</p>
</div>
<div id="outline-container-11-6-1" class="outline-4">
<h4 id="sec-11-6-1"><span class="section-number-4">11.6.1</span> Apply <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-11-6-1">
<ul>
<li>Apply the sigmoid to the incoming signals
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-11-7" class="outline-3">
<h3 id="sec-11-7"><span class="section-number-3">11.7</span> Weights <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-11-7">
<p> <img src="img/ann7.png" alt="img/ann7.png" />
</p>
</div>
<div id="outline-container-11-7-1" class="outline-4">
<h4 id="sec-11-7-1"><span class="section-number-4">11.7.1</span> Repeat <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-11-7-1">
<ul>
<li>Take the outputs, apply weights, sum
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-11-8" class="outline-3">
<h3 id="sec-11-8"><span class="section-number-3">11.8</span> Sigmoid <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-11-8">
<p> <img src="img/ann8.png" alt="img/ann8.png" />
</p>
</div>
<div id="outline-container-11-8-1" class="outline-4">
<h4 id="sec-11-8-1"><span class="section-number-4">11.8.1</span> Apply <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-11-8-1">
<ul>
<li>Apply the sigmoid to the incoming signals
</li>
<li>Our result is greater than 0.5, so we can assume true
</li>
<li>If we had multiple outputs, we could choose the highest one
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="outline-container-12" class="outline-2">
<h2 id="sec-12"><span class="section-number-2">12</span> Forward Propagation <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-12">
<ol>
<li>Sum of inputs * weights
</li>
<li>Apply sigmoid
</li>
<li>Send output to next layer
</li>
<li>Repeat
</li>
</ol>
</div>
<div id="outline-container-12-1" class="outline-3">
<h3 id="sec-12-1"><span class="section-number-3">12.1</span> Get an answer <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-12-1">
<ul>
<li>Now we have <b>an</b> output, but how do we train to get the <b>right</b> output?
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-13" class="outline-2">
<h2 id="sec-13"><span class="section-number-2">13</span> Fitness Function <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-13">
<ul>
<li>Create a fitness function that measures the error
</li>
<li>Take derivative and a step in the right direction
</li>
<li>Try again
</li>
</ul>
</div>
<div id="outline-container-13-1" class="outline-3">
<h3 id="sec-13-1"><span class="section-number-3">13.1</span> Neural Network <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-13-1">
<ul>
<li>NN training is conceptually similar to gradient descent
</li>
<li>We want to get closer to the answer, so we adjust our weights based on the
amount of incorrectness in the system
</li>
<li>Adjust weights, try again
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-14" class="outline-2">
<h2 id="sec-14"><span class="section-number-2">14</span> Back Propagation <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-14">
<dl>
<dt>Run forward</dt><dd>O<sub>j</sub> is output of node <code>j</code>
</dd>
<dt>Calculate error of output layer</dt><dd>Err<sub>j</sub> = O<sub>j</sub>(1-O<sub>j</sub>)(T<sub>j</sub>-O<sub>j</sub>)
</dd>
<dt>Caclulate error of hidden layer</dt><dd>Err<sub>j</sub> = O<sub>j</sub>(1-O<sub>j</sub>)*sum(Err<sub>k</sub>*w<sub>jk</sub>)
</dd>
<dt>Find new weights</dt><dd>w<sub>ij</sub> = w<sub>ij</sub> + l*Err<sub>j</sub>*O<sub>i</sub>
</dd>
<dt>Repeat</dt><dd>To move closer to correct weights
</dd>
</dl>
</div>
<div id="outline-container-14-1" class="outline-3">
<h3 id="sec-14-1"><span class="section-number-3">14.1</span> Derivative <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-14-1">
<ul>
<li>Derivative of the sigmoid is <code>O_j(1-O_j)</code>, so we're taking the gradient
</li>
<li><code>l</code> is the learning rate, similar to <code>a</code> step size in gradient descent
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-15" class="outline-2">
<h2 id="sec-15"><span class="section-number-2">15</span> Example <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-15">
<p> <img src="img/ann8.png" alt="img/ann8.png" />
</p>
</div>
<div id="outline-container-15-1" class="outline-3">
<h3 id="sec-15-1"><span class="section-number-3">15.1</span> Expected <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-15-1">
<pre class="src src-python"><span style="color: #b22222;"># Expected Output is 0</span>
<span style="color: #a0522d;">t_6</span> = 0
<span style="color: #b22222;"># Actual Output</span>
<span style="color: #a0522d;">o_6</span> = 0.8387
<span style="color: #b22222;"># Output Error -0.11346127339699999</span>
<span style="color: #a0522d;">err_6</span> = o_6*(1-o_6)*(t_6-o_6)
<span style="color: #b22222;"># Setup hidden node 5</span>
<span style="color: #a0522d;">o_5</span> = 0.9933 ; w_56 = 1.5
<span style="color: #b22222;"># Error for node 5 = -0.0011326458827956695</span>
<span style="color: #a0522d;">err_5</span> = o_5*(1-o_5)*(err_6*w_56)
<span style="color: #b22222;"># Adjust weight to 0.37298917134759924</span>
<span style="color: #a0522d;">l</span> = 10 <span style="color: #b22222;"># learning rate</span>
<span style="color: #a0522d;">w_56</span> = w_56 + l*err_6*o_5
</pre>
</div>
</div>
</div>
<div id="outline-container-16" class="outline-2">
<h2 id="sec-16"><span class="section-number-2">16</span> Terminate Learning <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-16">
<ul>
<li>Changes in weights too small
</li>
<li>Accuracy in training models is high
</li>
<li>Maximum number or times for learning
</li>
</ul>
</div>
<div id="outline-container-16-1" class="outline-3">
<h3 id="sec-16-1"><span class="section-number-3">16.1</span> Forward and Back <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-16-1">
<ul>
<li>Guess, correct, guess, correct
</li>
<li>Stop when you've got a good model
</li>
<li>or you model is not improving
</li>
<li>or when you're out of time
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-17" class="outline-2">
<h2 id="sec-17"><span class="section-number-2">17</span> <b>Break</b> <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-17">
<script type="text/javascript" src="production/org-html-slideshow.js"></script>
</div>
</div>
</div>
<div id="postamble">
<p class="date">Date: 2013-03-04 23:20:39 PST</p>
<p class="author">Author: Jim Blomo</p>
<p class="creator">Org version 7.8.02 with Emacs version 23</p>
<a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
</div>
</body>
</html>