Top Banner
Machine Learning Algorithms Inmar Givoni
43
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Machine learning

Machine Learning

Algorithms

Inmar Givoni

Page 2: Machine learning
Page 3: Machine learning

BUT…

• There appear to be problems that are really difficult for computers

• Many correspond to tasks that are really easy for humans

Page 4: Machine learning
Page 5: Machine learning

The face of a child can say it all… especially the mouth part of the face.

Page 6: Machine learning

How do you write software tools to solve these problems?

Page 7: Machine learning

sorting a list

• Why? Makes other tasks easier

– (like finding Commander Riker)

• How?

3 13 7 1 52 14

Algorithms 101

Page 8: Machine learning

3 13 7 1 52 14

Sorting a list of numbers 1. Find for the smallest number in the entire array

(from the first to the last position) 2. If it’s not already in the 1st position, it is in some other position, k.

Page 9: Machine learning

3 13 7 1 52 14

Sorting a list of numbers 1. Find for the smallest number in the entire array

(from the first to the last position) 2. If it’s not already in the 1st position, it is in some other position, k 3. Swap the number in the 1st position, with that smallest number at position k.

Page 10: Machine learning

1 13 7 3 52 14

Sorting a list of numbers 1. Find for the smallest number in the entire array

(from the first to the last position) 2. If it’s not already in the 1st position, it is in some other position, k 3. Swap the number in the 1st position, with that smallest number at position k.

Page 11: Machine learning

1 13 7 3 52 14

Sorting a list of numbers 1. Find for the smallest number in the entire array

(from the first to the last position) 2. If it’s not already in the 1st position, it is in some other position, k. 3. Swap the number in the 1st position, with that smallest number at position k 4. Find the smallest number between the 2nd position, to the last position 5. If it’s not already in the 2nd position, it is in some other position k

Page 12: Machine learning

1 13 7 3 52 14

Sorting a list of numbers 1. Find for the smallest number in the entire array

(from the first to the last position) 2. If it’s not already in the 1st position, it is in some other position, k. 3. Swap the number in the 1st position, with that smallest number at position k 4. Find the smallest number between the 2nd position, to the last position 5. If it’s not already in the 2nd position, it is in some other position k

Page 13: Machine learning

1 13 7 3 52 14

Sorting a list of numbers 1. Find for the smallest number in the entire array

(from the first to the last position) 2. If it’s not already in the 1st position, it is in some other position, k. 3. Swap the number in the 1st position, with that smallest number at position k 4. Find the smallest number between the 2nd position, to the last position 5. If it’s not already in the 2nd position, it is in some other position k 6. Swap the number in the 2nd position with that smallest number at position k

Page 14: Machine learning

1 3 7 13 52 14

Sorting a list of numbers 1. Find for the smallest number in the entire array

(from the first to the last position) 2. If it’s not already in the 1st position, it is in some other position, k. 3. Swap the number in the 1st position, with that smallest number at position k 4. Find the smallest number between the 2nd position, to the last position 5. If it’s not already in the 2nd position, it is in some other position k 6. Swap the number in the 2nd position with that smallest number at position k

Page 15: Machine learning

1 3 7 13 52 14

Sorting a list of numbers 1. Find for the smallest number in the entire array

(from the first to the last position) 2. If it’s not already in the 1st position, it is in some other position, k. 3. Swap the number in the 1st position, with that smallest number at position k 4. Find the smallest number between the 2nd position, to the last position 5. If it’s not already in the 2nd position, it is in some other position k 6. Swap the number in the 2nd position with that smallest number at position k …

Page 16: Machine learning

1 3 7 13 14 52

Sorting a list of numbers 1. Find for the smallest number in the entire array

(from the first to the last position) 2. If it’s not already in the 1st position, it is in some other position, k. 3. Swap the number in the 1st position, with that smallest number at position k 4. Find the smallest number between the 2nd position, to the last position 5. If it’s not already in the 2nd position, it is in some other position k 6. Swap the number in the 2nd position with that smallest number at position k … ?. When you are at the last position, you are done – everything is now in place!

Page 17: Machine learning

But for those hard problems…, ‘common sense’ doesn’t quite work!

• Recipe for finding a face in an image?

Page 18: Machine learning

But for those hard problems…, ‘common sense’ doesn’t quite work!

• Recipe for finding a face in an image?

Page 19: Machine learning

But for those hard problems…, ‘common sense’ doesn’t quite work!

• Recipe for finding a face in an image?

Page 20: Machine learning

But for those hard problems…, ‘common sense’ doesn’t quite work!

• Recipe for finding a face in an image?

Page 21: Machine learning

But for those hard problems…, ‘common sense’ doesn’t quite work!

• Recipe for finding a face in an image?

Page 22: Machine learning

But for those hard problems…, ‘common sense’ doesn’t quite work!

• Recipe for finding a face in an image?

Page 23: Machine learning

But for those hard problems…, ‘common sense’ doesn’t quite work!

• Recipe for finding a face in an image?

Page 24: Machine learning

But for those hard problems…, ‘common sense’ doesn’t quite work!

• Recipe for finding a face in an image?

Page 25: Machine learning

But for those hard problems…, ‘common sense’ doesn’t quite work!

• Recipe for finding a face in an image?

Page 26: Machine learning

But for those hard problems…, ‘common sense’ doesn’t quite work!

• Recipe for finding a face in an image?

• Too many variations to list down…

• We probably don’t actually understand the rules ourselves!

Page 27: Machine learning

Machine Learning approach

1. Gather data: images with their labels (face, no face)

2. Process them somehow into a machine friendly representation

3. Let the machine figure out the decision rule for itself!

Page 28: Machine learning

A,B,C – Knobs (Parameters)

x,y,z - Numbers from the image

Sounds a bit like magic…? let’s look under the hood

• What does it mean to ‘figure out the rule’?

Face No Face

𝐴𝑥2+𝐵𝑦 + sin 𝐶𝑧 > 0 → 𝑓𝑎𝑐𝑒 𝐴𝑥2 + 𝐵𝑦 + sin 𝐶𝑧 ≤ 0 → 𝑛𝑜 𝑓𝑎𝑐𝑒

Page 29: Machine learning

Where do the equations come from?

Non-Faces

Faces 𝑎𝑥 + 𝑏𝑦 + 𝑐 > 0

𝑎𝑥 + 𝑏𝑦 + 𝑐 = 0

𝑎𝑥 + 𝑏𝑦 + 𝑐 < 0

Page 30: Machine learning

How do we set the parameters?

Faces

Non-Faces

Page 31: Machine learning

Recap: figureing out the rule • Human decides on a template

• Human decides on what criteria to use for finding the parameters

• Human figures out the technique required to optimize this function

• Human (or human’s graduate students) write code that performs that optimization

• ‘Training’ - Computer does the grunt work - calculating parameter values

Page 32: Machine learning

The dirty details of data representation

• What does it mean ‘machine friendly representation’?

• Data comes in many shapes & forms

• Algorithms crunch numbers

• We need to translate things into numbers

– Things: images, documents, speech, preferences…

– Numbers: <x1,x2,x3,…,xN> (vectors)

Page 33: Machine learning

From data to vectors

• The good news - it’s possible

• Example 1: Images

184, 137, 119

[0,34,25, 34,52,66, 66,86,24, 4,62,75, …., 184,137,119, …]

Page 34: Machine learning

From data to vectors

• The good news - it’s possible

• Example 2: Text

A cat and a dog went for a walk, and they

stopped by a tree. The cat climbed up the

tree. The dog continued to sit under the

tree. The cat said to the dog…

Page 35: Machine learning

From data to vectors

• The good news - it’s possible

• Example 2: Text

0

20

40

60

80

100

120

word counts

a/the cat dog and

go/went/going me/my/I tree Commander

Page 36: Machine learning

From data to vectors

• The bad new -

– Bad representation → bad performance

– vectors are almost always in very high dimensional space → the curse of dimensionality

Page 37: Machine learning

Supervised Learning

• Classification – small set of labels (for every input, attach one of K labels)

• Regression – labels are continuous (curve fitting)

Page 38: Machine learning

Unsupervised learning

• Find groups in data (clustering)

Page 39: Machine learning

Unsupervised learning

• Find groups in data (clustering)

• Collaborative filtering

Page 40: Machine learning

Machine Learning Everywhere…

• We’ve come a long way!

– Computer vision

– Speech processing and NLP

– Recommendation systems

– Computational Biology

– Even right here in PowerPoint!!!

Page 41: Machine learning

Machine Learning Everywhere…

• But there’s a long way to go

• And we are pretty far off from

– “It’s an excerpt from star-trek, Riker’s annoyed, and it’s a pretty entertaining scene”

Page 42: Machine learning

In conclusion…

• Exciting field!

• Combines mathematics, computer science, optimization theory, statistics, …

• But really – it’s mostly about

– Processing the data into a useful representation

– Coming up with a good model

– Optimizing

Page 43: Machine learning

Thanks! Questions?