Deep Learning (DEEP-0001)�
Prof. André E. Lazzaretti
https://sites.google.com/site/andrelazzaretti/graduate-courses/deep-learning-cpgei/2025
6 – Fitting Models
Loss function
or for short:
Returns a scalar that is smaller when model maps inputs to outputs better
Training
Returns a scalar that is smaller when model maps inputs to outputs better
Example: 1D Linear regression loss function
Loss function:
“Least squares loss function”
Example: 1D Linear regression training
Example: 1D Linear regression training
Example: 1D Linear regression training
Example: 1D Linear regression training
Example: 1D Linear regression training
This technique is known as gradient descent
Fitting models
Gradient descent algorithm
Fitting models
Gradient descent
Step 1: Compute derivatives (slopes of function) with
Respect to the parameters
Gradient descent
Step 1: Compute derivatives (slopes of function) with
Respect to the parameters
Gradient descent
Step 1: Compute derivatives (slopes of function) with
Respect to the parameters
Gradient descent
Step 1: Compute derivatives (slopes of function) with
Respect to the parameters
Gradient descent
Step 1: Compute derivatives (slopes of function) with
Respect to the parameters
Step 2: Update parameters according to rule
Gradient descent
Step 1: Compute derivatives (slopes of function) with
Respect to the parameters
Step 2: Update parameters according to rule
Gradient descent
Gradient descent
Step 1: Compute derivatives (slopes of function) with
Respect to the parameters
Step 2: Update parameters according to rule
Gradient descent
Step 1: Compute derivatives (slopes of function) with
Respect to the parameters
Step 2: Update parameters according to rule
Gradient descent
Gradient descent
Gradient descent
Convex problems
Non convex
Non-Convex
Convex
Convex problems
Non convex
Non-Convex
Convex
Test for convexity is that 2nd derivative is positive everywhere
Convexity in higher dimensions
Test for convexity is that determinant of Hessian (2nd derivative matrix) is positive everywhere.
Fitting models
Gabor model
Gabor model
Fitting models
IDEA: add noise
Properties of SGD
Fitting models
Momentum
Exponential Moving Average:
Momentum
Fitting models
Adaptive moment estimation (Adam)
Normalized gradients
Normalized gradients
Normalized gradients
Adaptive moment estimation (Adam)
Adaptive moment estimation (Adam)
Hyperparameters