Post on 12-Apr-2017
transcript
Building a Neural Network from scratch
in ROwen Jones ∙ Bath Machine Learning Meetup 1∙ st March 2017
Building a Social Network from scratch
in BMLMOwen Jones ∙ Bath Machine Learning Meetup 1∙ st March 2017
What’s a neural network?
This is a dog
This is a dog
This is a cat
This is a dog
This is a cat
This is a cat
This is a dog
OK.
Data
Kaggle competition page• https://kaggle.com/c/digit-recognizer
Data• https://kaggle.com/c/digit-recognizer/data
What are these numbers?
0 60 140 200 255
0 60 140 200 255
0 60 140 200 255
0 60 140 200 255
0 60 140 200 255
What are these numbers?
0 60 140 200 255
0 60 140 200 255
0 60 140 200 255
0 60 140 200 255
0 60 140 200 255
What are these numbers?
0 60 140 200 255 0 60 140 200 255 0 60 140 200 255 0 60 140 200 255 0 60 140 200 255
Why relabel 0?
0 1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10
Zero-indexed
One-indexed
1st 2nd 3rd
0 0 1 0 0 0 0 0 0 03
How wrong were we?Prediction (A3)
Actual 0 0 0 0 0 0 0 0 1 0
0.08 0.31 0.85 0.37 0.43 0.51 0.12 0.54 0.71 0.42
-log(A3) * Actual 0 0 0 0 0 0 0 0 0.34 0
How wrong were we?Prediction (A3)
Actual 0 0 0 0 0 0 0 0 1 0
0.08 0.31 0.85 0.37 0.43 0.51 0.12 0.54 0.71 0.42
1 1 1 1 1 1 1 1 0 11 - Actual
-log(A3) * Actual 0 0 0 0 0 0 0 0 0.34 0
0.08 0.37 1.90 0.46 0.56 0.71 0.13 0.78 0 0.54-log(1 - A3) * (1 - Actual)
0.92 0.69 0.15 0.63 0.57 0.49 0.88 0.46 0.29 0.581 - A3
How wrong were we?Prediction (A3)
Actual 0 0 0 0 0 0 0 0 1 0
0.08 0.31 0.85 0.37 0.43 0.51 0.12 0.54 0.71 0.42
1 1 1 1 1 1 1 1 0 11 - Actual
-log(A3) * Actual 0 0 0 0 0 0 0 0 0.34 0
0.08 0.37 1.90 0.46 0.56 0.71 0.13 0.78 0 0.54-log(1 - A3) * (1 - Actual)
0.92 0.69 0.15 0.63 0.57 0.49 0.88 0.46 0.29 0.581 - A3
Cost (J) = 0.34 + 0.08 + 0.37 + 1.90 + 0.46 + 0.56 + 0.71 + 0.13 + 0.78 + 0.54 = 5.87
Learning from experience
This is a dog
This is a dog
This is a cat
This is a dog
This is a cat
This is a cat
This is a dog
OK.
Contact me
Website: https://owenjonesuob.github.io
Email: olj23@bath.ac.uk
Twitter: @owenjonesuob
GitHub: https://github.com/owenjonesuob
LinkedIn: https://uk.linkedin.com/in/owenjonesuob
• https://uk.linkedin.com/in/owenjonesuob