Machine Learning & Neural Networks
CS16: Introduction to Data Structures & Algorithms Spring 2020
Machine Learning & Neural Networks CS16: Introduction to Data - - PowerPoint PPT Presentation
Machine Learning & Neural Networks CS16: Introduction to Data Structures & Algorithms Spring 2020 Outline Overview Artificial Neurons Single-Layer Perceptrons Multi-Layer Perceptrons Overfitting and Generalization
Machine Learning & Neural Networks
CS16: Introduction to Data Structures & Algorithms Spring 2020
Outline
2What do think of when you hear “Machine Learning”?
3Bobby
“Alexa, play De Despa pacito ito.”
Artificial Intelligence vs. Machine Learning
What does it mean for machines to learn?
definition of “think”:
Let’s Think About This Differently
6performance rformance at a particular ta task sk improves with ex experience perience
Intelligence” (1950)
Game
consider the question, “Can machines do what we (as thinking entities) do?”
Machine Learning Algorithm Structure
Repres esentat entation ion: define a space of possible programs
s fun unction tion: decide how to score a program’s performance
Optim timiz izer er: how to search the space for the program with the highest score
Repres esentat entation ion: space of possible trees that can be built using attributes of the dataset as internal nodes and outcomes as leaf nodes
s fun unction tion: percent of testing examples misclassified
Opti timiz mizer er: choose attribute that maximizes information gain
7Neurons
activated and fires
Neuron Anatomy (…very simplified)
De Dend ndrite rites Axo xon Cell ll Body dy
Axo xon Termina inals
Artificial Neuron
10Artificial Neuron
11multiplication
inner product
bias
Outputs 1 if input is larger than some threshold else it outputs 0
Artificial Neuron
12Outputs 1 if input is larger than some threshold else it outputs 0
multiplication
inner product
bias
Artificial Neuron
The Perceptron (Rosenblatt,1957)
14Perceptron Network
15x1 x2 x3 x4 N N N
y1 y2 y3
Perceptron Network
16x1 x2 x3 x4 N N
y1 y2 y3
x1
x0=w0 w1 w2 w3 w4
Training a Perceptron
Perceptron Network
18N
y1
t
Comp
update weights
x1 x2 x3 x4 N N
y2 y3
x1
x0=Perceptron Training
Perceptron Network
20x1 x2 x3 x4 N N
y1 y2 y3
x1
x0=w0 w1 w2 w3 w4
Artificial Neuron Update Rule
21increase then wi needs to be decreased!
Artificial Neuron Update Rule
22errors in data
Perceptron Training Pseudocode
23Perceptron(data, neurons, k): for round from 1 to k: for each training example in data: for each neuron in neurons: y = output of feeding example to neuron for each weight of neuron: update weight
Perceptron Training
24Activity #1
x1 x2
x1 x2 t 1 1 1 1 1 1 1
w0=-0.5 w1=-0.5 w2=-0.5
0.5
Perceptron Training
bias target
Perceptron Training
bias target
Perceptron Training
(0,0,0),(0,1,1),&(1,0,1)
very small amounts (con
vergence ence)
Perceptron Animation
Single-Layer Perceptron
30x1 x2 x3 x4 N N N
y1 y2 y3
Limits of Single-Layer Perceptrons
take a geometric view
hyperplane if high-dimensional)
separated by a line (or hyperplane)
nearly arly sep eparable arable
31Linearly-Separable Classifications
32Single-Layer Perceptrons
Geometry
perceptrons
networks…
Multi-Layer Perceptron
34x1 x2 x3 x4 N N N
y1 y2 y3
N N N
Inputs Hidden Layer Output Layer
Training Multi-Layer Perceptrons
there is no target for hidden neurons
backpropagation
precisely how it could be used to train MLPs
35Training Multi-Layer Perceptrons
36Training by Backpropagation
37x1 x2 x3 x4 N N N
y1 y2 y3
N N N
t
Comp
update weights
Comp
update weights
Training Multi-Layer Perceptrons
power
needed to tune
Overfitting
Overfitting
Overfitting & Generalization
41Overfitting & Generalization
Early Stopping
43Applications
recurrent neural network (RNN)
Applications (continued)
Applications (continued)
Applications
networks! (Neural Complete)
Questions?