deep learning - theory and practice...neural networks multi-layer perceptron [hopfield, 1982]...

24
Deep Learning - Theory and Practice 20-02-2020 Linear Regression, Least Squares Classification and Logistic Regression http://leap.ee.iisc.ac.in/sriram/teaching/DL20/ [email protected]

Upload: others

Post on 27-Apr-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Deep Learning - Theory and Practice

20-02-2020Linear Regression, Least Squares Classification and Logistic Regression

http://leap.ee.iisc.ac.in/sriram/teaching/DL20/

[email protected]

Page 2: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Least Squares for Classification

Bishop - PRML book (Chap 3)

❖ K-class classification problem

❖ With 1-of-K hot encoding, and least squares regression

Page 3: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear
Page 4: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear
Page 5: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Logistic Regression

Bishop - PRML book (Chap 3)

❖ 2- class logistic regression

❖ K-class logistic regression

❖ Maximum likelihood solution

❖ Maximum likelihood solution

Page 6: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear
Page 7: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear
Page 8: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear
Page 9: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear
Page 10: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear
Page 11: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Typical Error Surfaces

Typical Error Surface as a function of parameters

(weights and biases)

Page 12: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear
Page 13: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear
Page 14: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Learning with Gradient Descent

Error surface close to a local

Page 15: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Learning Using Gradient Descent

Page 16: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Parameter Learning

• Solving a non-convex optimization.

• Iterative solution. • Depends on the initialization. • Convergence to a local

optima. • Judicious choice of learning

rate

Page 17: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Least Squares versus Logistic Regression

Bishop - PRML book (Chap 4)

Page 18: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Least Squares versus Logistic Regression

Bishop - PRML book (Chap 4)

Page 19: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Neural Networks

Page 20: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Perceptron Algorithm

What if the data is not linearly separable

Perceptron Model [McCulloch, 1943, Rosenblatt, 1957]

Targets are binary classes [-1,1]

Page 21: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Multi-layer PerceptronMulti-layer Perceptron [Hopfield, 1982]

thresholding function

non-linear function (tanh,sigmoid)

Page 22: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Neural Networks

Multi-layer Perceptron [Hopfield, 1982]

thresholding function

non-linear function (tanh,sigmoid)

• Useful for classifying non-linear data boundaries - non-linear class separation can be realized given enough data.

Page 23: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Neural Networks

tanh sigmoid ReLu

Cost-Function

are the desired outputs

Mean Square Error Cross Entropy

Types of Non-linearities

Page 24: Deep Learning - Theory and Practice...Neural Networks Multi-layer Perceptron [Hopfield, 1982] thresholding function non-linear function (tanh,sigmoid)• Useful for classifying non-linear

Learning Posterior Probabilities with NNsChoice of target function

• Softmax function for classification

• Softmax produces positive values that sum to 1 • Allows the interpretation of outputs as posterior

probabilities