neural networks: representation non-linear hypotheses · pdf fileandrew ng neural networks...

42
Neural Networks: Representation Non-linear hypotheses Machine Learning

Upload: phamduong

Post on 27-Mar-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Neural Networks:

Representation

Non-linear

hypothesesMachine Learning

Page 2: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Non-linear Classification

x1

x2

size

# bedrooms

# floors

age

Page 3: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

You see this:

But the camera sees this:

What is this?

Page 4: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Computer Vision: Car detection

Testing:

What is this?

Not a carCars

Page 5: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Learning Algorithm

pixel 1

pixel 2

pixel 1

pixel 2

Raw image

Cars

“Non”-Cars

Page 6: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

pixel 1

pixel 2

Raw image

Cars

“Non”-Cars

Learning Algorithm

pixel 1

pixel 2

Page 7: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

pixel 1

pixel 2

Raw image

Cars

“Non”-Cars

50 x 50 pixel images→ 2500 pixels

(7500 if RGB)

pixel 1 intensity

pixel 2 intensity

pixel 2500 intensity

Quadratic features ( ): ≈3 million

features

Learning Algorithm

pixel 1

pixel 2

Page 8: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;
Page 9: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Neural Networks:

Representation

Neurons and

the brainMachine Learning

Page 10: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Neural Networks

Origins: Algorithms that try to mimic the brain.

Was very widely used in 80s and early 90s; popularity

diminished in late 90s.

Recent resurgence: State-of-the-art technique for many

applications

Page 11: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Auditory cortex learns to see

Auditory Cortex

The “one learning algorithm” hypothesis

[Roe et al., 1992]

Page 12: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Somatosensory cortex learns to see

Somatosensory Cortex

The “one learning algorithm” hypothesis

[Metin & Frost, 1989]

Page 13: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Seeing with your tongue Human echolocation (sonar)

Haptic belt: Direction sense Implanting a 3rd eye

Sensor representations in the brain

[BrainPort; Welsh & Blasch, 1997; Nagel et al., 2005; Constantine-Paton & Law, 2009]

Page 14: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;
Page 15: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Neural Networks:

Representation

Machine Learning

Model

representation I

Page 16: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Neuron in the brain

Page 17: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Neurons in the brain

[Credit: US National Institutes of Health, National Institute on Aging]

Page 18: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Neuron model: Logistic unit

Sigmoid (logistic) activation function.

Page 19: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Neural Network

Layer 3Layer 1 Layer 2

Page 20: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Neural Network“activation” of unit in layer

matrix of weights controlling

function mapping from layer to

layer

If network has units in layer , units in layer , then

will be of dimension .

Page 21: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;
Page 22: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Neural Networks:

Representation

Model

representation II

Machine Learning

Page 23: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Add .

Forward propagation: Vectorized implementation

Page 24: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Layer 3Layer 1 Layer 2

Neural Network learning its own features

Page 25: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Layer 3Layer 1 Layer 2

Other network architectures

Layer 4

Page 26: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;
Page 27: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Neural Networks:

Representation

Examples and

intuitions I

Machine Learning

Page 28: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Non-linear classification example: XOR/XNOR

, are binary (0 or 1).

x1

x2

x1

x2

Page 29: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Simple example: AND

0 0

0 1

1 0

1 1

1.0

Page 30: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Example: OR function

0 0

0 1

1 0

1 1

-10

20

20

Page 31: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;
Page 32: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Neural Networks:

Representation

Examples and

intuitions II

Machine Learning

Page 33: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Negation:

0

1

Page 34: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Putting it together:

0 0

0 1

1 0

1 1

-30

20

20

10

-20

-20

-10

20

20

Page 35: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Neural Network intuition

Layer 3Layer 1 Layer 2 Layer 4

Page 36: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Handwritten digit classification

[Courtesy of Yann LeCun]

Page 37: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Handwritten digit classification

[Courtesy of Yann LeCun]

Page 38: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Page 39: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Neural Networks:

Representation

Multi-class

classification

Machine Learning

Page 40: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Multiple output units: One-vs-all.

Pedestrian Car Motorcycle Truck

Want , , , etc.

when pedestrian when car when motorcycle

Page 41: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng

Multiple output units: One-vs-all.

Want , , , etc.

when pedestrian when car when motorcycle

Training set:

one of , , ,

pedestrian car motorcycle truck

Page 42: Neural Networks: Representation Non-linear hypotheses · PDF fileAndrew Ng Neural Networks Origins: Algorithms that try to mimic the brain. Was very widely used in 80s and early 90s;

Andrew Ng