CSE 5524: �Foundation of learning - 2
Homework assignment - 1
Grade distribution and final project information
Background information
Today
5
Recap: learning
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Recap: learning
Temperature
People at beach
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Recap: Key ingredients
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Recap: Empirical risk minimization (ERM)
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Today
12
Case study – 2: classification
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Case study – 2: classification
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Case study – 2: classification
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Case study – 2: classification
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Today
17
Gradient-based learning algorithm
Gradient-based learning algorithm
Derivative (-)
GOAL: minimum error
Basic gradient descent
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Basic gradient descent
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Effects of learning rate
Too small
Too large
About right
Learning rate schedule
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Momentum
Too small
Too large
About right
Momentum
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Momentum
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Gradient descent always useful?
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
PyTorch could handle it!
Surrogate loss function
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Stochastic gradient descent (SGD)
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Stochastic gradient descent (SGD)
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Modern optimizers
Example: image classification
33
[Gif credits: Gradient descent 3Blue1Brown series S3 E2]
A sequence of “learnable” computation!
Example: image classification (training)
Today
35
Recap: learning
36
Training vs. testing
37
x
y
In training, we only see training data!
Choosing a more complicated hypothesis class does not necessarily lead to lower test errors!
Under-fitting vs. over-fitting
Under-fitting vs. over-fitting
K too small: simple
K too large: complicated
training error = 0
39
[Slides: from USC CSCI567]
Under-fitting vs. over-fitting
40
[Slides: from USC CSCI567]
Under-fitting vs. over-fitting
Training data
Train
Val
Treating “Val” as the “pseudo” test data!
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Questions?
Regularization
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Finding a good regularizer is not always easy
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Occam’s razor principle
46
All things being equal,
the simplest explanation is usually the best!
Three tools in the search for Truth
Data (likelihood) & Prior
Three tools in the search for Truth
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Effect of data
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
More data, less over-fitting
[Figure: Bishop, PRML]
Green: true data distribution
Blue: training data
Red: learned model
Effect of priors
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Effect of hypothesis space
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Remark