diff --git a/doc/pub/week37/html/._week37-bs000.html b/doc/pub/week37/html/._week37-bs000.html
index 541ecc814..cfe72140a 100644
--- a/doc/pub/week37/html/._week37-bs000.html
+++ b/doc/pub/week37/html/._week37-bs000.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -300,7 +319,7 @@ MathJax.Hub.Config({
9
10
...
- 46
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs001.html b/doc/pub/week37/html/._week37-bs001.html
index 3edf27444..8ce33a94c 100644
--- a/doc/pub/week37/html/._week37-bs001.html
+++ b/doc/pub/week37/html/._week37-bs001.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -291,7 +310,7 @@ MathJax.Hub.Config({
10
11
...
- 46
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs002.html b/doc/pub/week37/html/._week37-bs002.html
index f673291cf..56c23018e 100644
--- a/doc/pub/week37/html/._week37-bs002.html
+++ b/doc/pub/week37/html/._week37-bs002.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -263,7 +282,7 @@ MathJax.Hub.Config({
-- Recommended: Goodfellow et al, Deep Learning, introduction to gradient descent, see sections 4.3-4.5 at https://www.deeplearningbook.org/contents/numerical.html and chapter 8.3-8.5 at URL::https://www.deeplearningbook.org/contents/optimization.html"
+- Recommended: Goodfellow et al, Deep Learning, introduction to gradient descent, see sections 4.3-4.5 at https://www.deeplearningbook.org/contents/numerical.html and chapter 8.3-8.5 at https://www.deeplearningbook.org/contents/optimization.html
- Rashcka et al, pages 37-44 and pages 278-283 with focus on linear regression.
- Video on gradient descent at https://www.youtube.com/watch?v=sDv4f4s2SB8
- Video on Stochastic gradient descent at https://www.youtube.com/watch?v=vMh0zPT0tLI
@@ -289,7 +308,7 @@ MathJax.Hub.Config({
- 11
- 12
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs003.html b/doc/pub/week37/html/._week37-bs003.html
index ccb14f2ac..fca95acdf 100644
--- a/doc/pub/week37/html/._week37-bs003.html
+++ b/doc/pub/week37/html/._week37-bs003.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -278,7 +297,7 @@ MathJax.Hub.Config({
- 12
- 13
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs004.html b/doc/pub/week37/html/._week37-bs004.html
index 5136d1a63..db8020187 100644
--- a/doc/pub/week37/html/._week37-bs004.html
+++ b/doc/pub/week37/html/._week37-bs004.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -329,7 +348,7 @@ $$
- 13
- 14
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs005.html b/doc/pub/week37/html/._week37-bs005.html
index a2b3478ab..beec70c4e 100644
--- a/doc/pub/week37/html/._week37-bs005.html
+++ b/doc/pub/week37/html/._week37-bs005.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -298,7 +317,7 @@ $$
- 14
- 15
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs006.html b/doc/pub/week37/html/._week37-bs006.html
index f42693ebf..e8de7baf5 100644
--- a/doc/pub/week37/html/._week37-bs006.html
+++ b/doc/pub/week37/html/._week37-bs006.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -290,7 +309,7 @@ $$
- 15
- 16
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs007.html b/doc/pub/week37/html/._week37-bs007.html
index 71994bda6..b6b3a1230 100644
--- a/doc/pub/week37/html/._week37-bs007.html
+++ b/doc/pub/week37/html/._week37-bs007.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -291,7 +310,7 @@ $$
- 16
- 17
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs008.html b/doc/pub/week37/html/._week37-bs008.html
index 4cc405564..67e684b22 100644
--- a/doc/pub/week37/html/._week37-bs008.html
+++ b/doc/pub/week37/html/._week37-bs008.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -297,7 +316,7 @@ when \( ||\nabla_\theta C(\theta_k) || \leq \epsilon = 10^{-8} \). Note that
- 17
- 18
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs009.html b/doc/pub/week37/html/._week37-bs009.html
index df9f8f43e..65ab5bed9 100644
--- a/doc/pub/week37/html/._week37-bs009.html
+++ b/doc/pub/week37/html/._week37-bs009.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -353,7 +372,7 @@ plt.show()
- 18
- 19
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs010.html b/doc/pub/week37/html/._week37-bs010.html
index 075aea3b0..26ec2439a 100644
--- a/doc/pub/week37/html/._week37-bs010.html
+++ b/doc/pub/week37/html/._week37-bs010.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -303,7 +322,7 @@ $$
- 19
- 20
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs011.html b/doc/pub/week37/html/._week37-bs011.html
index 87f9fdafa..fb806a5f7 100644
--- a/doc/pub/week37/html/._week37-bs011.html
+++ b/doc/pub/week37/html/._week37-bs011.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -299,7 +318,7 @@ minimum of this function.
- 20
- 21
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs012.html b/doc/pub/week37/html/._week37-bs012.html
index 90213a2d2..7a5311501 100644
--- a/doc/pub/week37/html/._week37-bs012.html
+++ b/doc/pub/week37/html/._week37-bs012.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -357,7 +376,7 @@ plt.show()
- 21
- 22
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs013.html b/doc/pub/week37/html/._week37-bs013.html
index 0a3af037d..e4ea98d20 100644
--- a/doc/pub/week37/html/._week37-bs013.html
+++ b/doc/pub/week37/html/._week37-bs013.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -293,7 +312,7 @@ MathJax.Hub.Config({
- 22
- 23
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs014.html b/doc/pub/week37/html/._week37-bs014.html
index 2d1cd02f8..19d9ba2cd 100644
--- a/doc/pub/week37/html/._week37-bs014.html
+++ b/doc/pub/week37/html/._week37-bs014.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -365,7 +384,7 @@ pyplot.show()
- 23
- 24
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs015.html b/doc/pub/week37/html/._week37-bs015.html
index 39be69329..9df5139ad 100644
--- a/doc/pub/week37/html/._week37-bs015.html
+++ b/doc/pub/week37/html/._week37-bs015.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -371,7 +390,7 @@ pyplot.show()
- 24
- 25
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs016.html b/doc/pub/week37/html/._week37-bs016.html
index 1b3515b56..13617ec8b 100644
--- a/doc/pub/week37/html/._week37-bs016.html
+++ b/doc/pub/week37/html/._week37-bs016.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -258,10 +277,16 @@ MathJax.Hub.Config({
-Overview video on Stochastic Gradient Descent
+Overview video on Stochastic Gradient Descent (SGD)
What is Stochastic Gradient Descent
+There are several reasons for using stochastic gradient descent. Some of these are:
+
+- Efficiency: Updates weights more frequently using a single or a small batch of samples, which speeds up convergence.
+- Hopefully avoid Local Minima
+- Memory Usage: Requires less memory compared to computing gradients for the entire dataset.
+
diff --git a/doc/pub/week37/html/._week37-bs017.html b/doc/pub/week37/html/._week37-bs017.html
index e1882aad3..8dde5e1e5 100644
--- a/doc/pub/week37/html/._week37-bs017.html
+++ b/doc/pub/week37/html/._week37-bs017.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -297,7 +316,7 @@ perform a parameter update.
- 26
- 27
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs018.html b/doc/pub/week37/html/._week37-bs018.html
index a4b654a0b..86155fa0d 100644
--- a/doc/pub/week37/html/._week37-bs018.html
+++ b/doc/pub/week37/html/._week37-bs018.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -258,32 +277,13 @@ MathJax.Hub.Config({
-Stochastic Gradient Descent (SGD)
-
-In stochastic gradient descent, the extreme case is the case where we
-have only one batch, that is we include the whole data set.
-
-
-This process is called Stochastic Gradient
-Descent (SGD) (or also sometimes on-line gradient descent). This is
-relatively less common to see because in practice due to vectorized
-code optimizations it can be computationally much more efficient to
-evaluate the gradient for 100 examples, than the gradient for one
-example 100 times. Even though SGD technically refers to using a
-single example at a time to evaluate the gradient, you will hear
-people use the term SGD even when referring to mini-batch gradient
-descent (i.e. mentions of MGD for “Minibatch Gradient Descent”, or BGD
-for “Batch gradient descent” are rare to see), where it is usually
-assumed that mini-batches are used. The size of the mini-batch is a
-hyperparameter but it is not very common to cross-validate or bootstrap it. It is
-usually based on memory constraints (if any), or set to some value,
-e.g. 32, 64 or 128. We use powers of 2 in practice because many
-vectorized operation implementations work faster when their inputs are
-sized in powers of 2.
-
-
-In our notes with SGD we mean stochastic gradient descent with mini-batches.
+Pros and cons
+
+- Speed: SGD is faster than gradient descent because it uses only one training example per iteration, whereas gradient descent requires the entire dataset. This speed advantage becomes more significant as the size of the dataset increases.
+- Convergence: Gradient descent has a more predictable convergence behaviour because it uses the average gradient of the entire dataset. In contrast, SGD’s convergence behaviour can be more erratic due to its random sampling of individual training examples.
+- Memory: Gradient descent requires more memory than SGD because it must store the entire dataset for each iteration. SGD only needs to store the current training example, making it more memory-efficient.
+
diff --git a/doc/pub/week37/html/._week37-bs019.html b/doc/pub/week37/html/._week37-bs019.html
index ceb6547d6..bd928e866 100644
--- a/doc/pub/week37/html/._week37-bs019.html
+++ b/doc/pub/week37/html/._week37-bs019.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -258,22 +277,12 @@ MathJax.Hub.Config({
-Stochastic Gradient Descent
-
-Stochastic gradient descent (SGD) and variants thereof address some of
-the shortcomings of the Gradient descent method discussed above.
-
-
-The underlying idea of SGD comes from the observation that the cost
-function, which we want to minimize, can almost always be written as a
-sum over \( n \) data points \( \{\mathbf{x}_i\}_{i=1}^n \),
-
-$$
-C(\mathbf{\beta}) = \sum_{i=1}^n c_i(\mathbf{x}_i,
-\mathbf{\beta}).
-$$
-
+Convergence rates
+
+- Stochastic Gradient Descent has a faster convergence rate due to the use of single training examples in each iteration.
+- Gradient Descent as a slower convergence rate, as it uses the entire dataset for each iteration.
+
diff --git a/doc/pub/week37/html/._week37-bs020.html b/doc/pub/week37/html/._week37-bs020.html
index 75db11f4d..ed9d1f077 100644
--- a/doc/pub/week37/html/._week37-bs020.html
+++ b/doc/pub/week37/html/._week37-bs020.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -258,21 +277,27 @@ MathJax.Hub.Config({
-Computation of gradients
+Accuracy
-This in turn means that the gradient can be
-computed as a sum over \( i \)-gradients
+
In general, stochastic Gradient Descent is Less accurate than gradient
+descent, as it calculates the gradient on single examples, which may
+not accurately represent the overall dataset. Gradient Descent is
+more accurate because it uses the average gradient calculated over the
+entire dataset.
-$$
-\nabla_\beta C(\mathbf{\beta}) = \sum_i^n \nabla_\beta c_i(\mathbf{x}_i,
-\mathbf{\beta}).
-$$
-Stochasticity/randomness is introduced by only taking the
-gradient on a subset of the data called minibatches. If there are \( n \)
-data points and the size of each minibatch is \( M \), there will be \( n/M \)
-minibatches. We denote these minibatches by \( B_k \) where
-\( k=1,\cdots,n/M \).
+
There are other disadvantages to using SGD. The main drawback is that
+its convergence behaviour can be more erratic due to the random
+sampling of individual training examples. This can lead to less
+accurate results, as the algorithm may not converge to the true
+minimum of the cost function. Additionally, the learning rate, which
+determines the step size of each update to the model’s parameters,
+must be carefully chosen to ensure convergence.
+
+
+It is however the method of choice in deep learning algorithms where
+SGD is often used in combination with other optimization techniques,
+such as momentum or adaptive learning rates
@@ -300,7 +325,7 @@ minibatches. We denote these minibatches by \( B_k \) where
- 29
- 30
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs021.html b/doc/pub/week37/html/._week37-bs021.html
index 4a4d3fe14..3533677e4 100644
--- a/doc/pub/week37/html/._week37-bs021.html
+++ b/doc/pub/week37/html/._week37-bs021.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -258,28 +277,31 @@ MathJax.Hub.Config({
-SGD example
-As an example, suppose we have \( 10 \) data points \( (\mathbf{x}_1,\cdots, \mathbf{x}_{10}) \)
-and we choose to have \( M=5 \) minibathces,
-then each minibatch contains two data points. In particular we have
-\( B_1 = (\mathbf{x}_1,\mathbf{x}_2), \cdots, B_5 =
-(\mathbf{x}_9,\mathbf{x}_{10}) \). Note that if you choose \( M=1 \) you
-have only a single batch with all data points and on the other extreme,
-you may choose \( M=n \) resulting in a minibatch for each datapoint, i.e
-\( B_k = \mathbf{x}_k \).
+
Stochastic Gradient Descent (SGD)
+
+In stochastic gradient descent, the extreme case is the case where we
+have only one batch, that is we include the whole data set.
-The idea is now to approximate the gradient by replacing the sum over
-all data points with a sum over the data points in one the minibatches
-picked at random in each gradient descent step
+
This process is called Stochastic Gradient
+Descent (SGD) (or also sometimes on-line gradient descent). This is
+relatively less common to see because in practice due to vectorized
+code optimizations it can be computationally much more efficient to
+evaluate the gradient for 100 examples, than the gradient for one
+example 100 times. Even though SGD technically refers to using a
+single example at a time to evaluate the gradient, you will hear
+people use the term SGD even when referring to mini-batch gradient
+descent (i.e. mentions of MGD for “Minibatch Gradient Descent”, or BGD
+for “Batch gradient descent” are rare to see), where it is usually
+assumed that mini-batches are used. The size of the mini-batch is a
+hyperparameter but it is not very common to cross-validate or bootstrap it. It is
+usually based on memory constraints (if any), or set to some value,
+e.g. 32, 64 or 128. We use powers of 2 in practice because many
+vectorized operation implementations work faster when their inputs are
+sized in powers of 2.
-$$
-\nabla_{\beta}
-C(\mathbf{\beta}) = \sum_{i=1}^n \nabla_\beta c_i(\mathbf{x}_i,
-\mathbf{\beta}) \rightarrow \sum_{i \in B_k}^n \nabla_\beta
-c_i(\mathbf{x}_i, \mathbf{\beta}).
-$$
+In our notes with SGD we mean stochastic gradient descent with mini-batches.
@@ -306,7 +328,7 @@ $$
- 30
- 31
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs022.html b/doc/pub/week37/html/._week37-bs022.html
index 2921b04c2..e0f11d8cd 100644
--- a/doc/pub/week37/html/._week37-bs022.html
+++ b/doc/pub/week37/html/._week37-bs022.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -258,21 +277,22 @@ MathJax.Hub.Config({
-The gradient step
+Stochastic Gradient Descent
-Thus a gradient descent step now looks like
-$$
-\beta_{j+1} = \beta_j - \gamma_j \sum_{i \in B_k}^n \nabla_\beta c_i(\mathbf{x}_i,
-\mathbf{\beta})
-$$
-
-where \( k \) is picked at random with equal
-probability from \( [1,n/M] \). An iteration over the number of
-minibathces (n/M) is commonly referred to as an epoch. Thus it is
-typical to choose a number of epochs and for each epoch iterate over
-the number of minibatches, as exemplified in the code below.
+
Stochastic gradient descent (SGD) and variants thereof address some of
+the shortcomings of the Gradient descent method discussed above.
+The underlying idea of SGD comes from the observation that the cost
+function, which we want to minimize, can almost always be written as a
+sum over \( n \) data points \( \{\mathbf{x}_i\}_{i=1}^n \),
+
+$$
+C(\mathbf{\beta}) = \sum_{i=1}^n c_i(\mathbf{x}_i,
+\mathbf{\beta}).
+$$
+
+
diff --git a/doc/pub/week37/html/._week37-bs023.html b/doc/pub/week37/html/._week37-bs023.html
index c65574214..9bbefc25d 100644
--- a/doc/pub/week37/html/._week37-bs023.html
+++ b/doc/pub/week37/html/._week37-bs023.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -258,51 +277,21 @@ MathJax.Hub.Config({
-Simple example code
+Computation of gradients
+This in turn means that the gradient can be
+computed as a sum over \( i \)-gradients
+
+$$
+\nabla_\beta C(\mathbf{\beta}) = \sum_i^n \nabla_\beta c_i(\mathbf{x}_i,
+\mathbf{\beta}).
+$$
-
-
-
-Taking the gradient only on a subset of the data has two important
-benefits. First, it introduces randomness which decreases the chance
-that our opmization scheme gets stuck in a local minima. Second, if
-the size of the minibatches are small relative to the number of
-datapoints (\( M < n \)), the computation of the gradient is much
-cheaper since we sum over the datapoints in the \( k-th \) minibatch and not
-all \( n \) datapoints.
+
Stochasticity/randomness is introduced by only taking the
+gradient on a subset of the data called minibatches. If there are \( n \)
+data points and the size of each minibatch is \( M \), there will be \( n/M \)
+minibatches. We denote these minibatches by \( B_k \) where
+\( k=1,\cdots,n/M \).
@@ -330,7 +319,7 @@ all \( n \) datapoints.
- 32
- 33
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs024.html b/doc/pub/week37/html/._week37-bs024.html
index 90d0eed4e..8a2f022de 100644
--- a/doc/pub/week37/html/._week37-bs024.html
+++ b/doc/pub/week37/html/._week37-bs024.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -258,20 +277,29 @@ MathJax.Hub.Config({
-When do we stop?
-
-A natural question is when do we stop the search for a new minimum?
-One possibility is to compute the full gradient after a given number
-of epochs and check if the norm of the gradient is smaller than some
-threshold and stop if true. However, the condition that the gradient
-is zero is valid also for local minima, so this would only tell us
-that we are close to a local/global minimum. However, we could also
-evaluate the cost function at this point, store the result and
-continue the search. If the test kicks in at a later stage we can
-compare the values of the cost function and keep the \( \beta \) that
-gave the lowest value.
+
SGD example
+As an example, suppose we have \( 10 \) data points \( (\mathbf{x}_1,\cdots, \mathbf{x}_{10}) \)
+and we choose to have \( M=5 \) minibathces,
+then each minibatch contains two data points. In particular we have
+\( B_1 = (\mathbf{x}_1,\mathbf{x}_2), \cdots, B_5 =
+(\mathbf{x}_9,\mathbf{x}_{10}) \). Note that if you choose \( M=1 \) you
+have only a single batch with all data points and on the other extreme,
+you may choose \( M=n \) resulting in a minibatch for each datapoint, i.e
+\( B_k = \mathbf{x}_k \).
+The idea is now to approximate the gradient by replacing the sum over
+all data points with a sum over the data points in one the minibatches
+picked at random in each gradient descent step
+
+$$
+\nabla_{\beta}
+C(\mathbf{\beta}) = \sum_{i=1}^n \nabla_\beta c_i(\mathbf{x}_i,
+\mathbf{\beta}) \rightarrow \sum_{i \in B_k}^n \nabla_\beta
+c_i(\mathbf{x}_i, \mathbf{\beta}).
+$$
+
+
diff --git a/doc/pub/week37/html/._week37-bs025.html b/doc/pub/week37/html/._week37-bs025.html
index f248bb5e5..3d2c765b5 100644
--- a/doc/pub/week37/html/._week37-bs025.html
+++ b/doc/pub/week37/html/._week37-bs025.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -258,17 +277,19 @@ MathJax.Hub.Config({
-Slightly different approach
+The gradient step
-Another approach is to let the step length \( \gamma_j \) depend on the
-number of epochs in such a way that it becomes very small after a
-reasonable time such that we do not move at all. Such approaches are
-also called scaling. There are many such ways to scale the learning
-rate
-and discussions here. See
-also
-https://towardsdatascience.com/learning-rate-schedules-and-adaptive-learning-rate-methods-for-deep-learning-2c8f433990d1
-for a discussion of different scaling functions for the learning rate.
+
Thus a gradient descent step now looks like
+$$
+\beta_{j+1} = \beta_j - \gamma_j \sum_{i \in B_k}^n \nabla_\beta c_i(\mathbf{x}_i,
+\mathbf{\beta})
+$$
+
+where \( k \) is picked at random with equal
+probability from \( [1,n/M] \). An iteration over the number of
+minibathces (n/M) is commonly referred to as an epoch. Thus it is
+typical to choose a number of epochs and for each epoch iterate over
+the number of minibatches, as exemplified in the code below.
@@ -296,7 +317,7 @@ for a discussion of different scaling functions for the learning rate.
- 34
- 35
- ...
- - 46
+ - 48
- »
diff --git a/doc/pub/week37/html/._week37-bs026.html b/doc/pub/week37/html/._week37-bs026.html
index af0e823ac..b7f2f789a 100644
--- a/doc/pub/week37/html/._week37-bs026.html
+++ b/doc/pub/week37/html/._week37-bs026.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
- Program example for gradient descent with Ridge Regression
- Using gradient descent methods, limitations
- Improving gradient descent with momentum
- - Same code but now with momentum gradient descent
- - Overview video on Stochastic Gradient Descent
+ - Same code but now with momentum gradient descent
+ - Overview video on Stochastic Gradient Descent (SGD)
- Batches and mini-batches
- - Stochastic Gradient Descent (SGD)
- - Stochastic Gradient Descent
- - Computation of gradients
- - SGD example
- - The gradient step
- - Simple example code
- - When do we stop?
- - Slightly different approach
- - Time decay rate
- - Code with a Number of Minibatches which varies
- - Replace or not
- - Momentum based GD
- - More on momentum based approaches
- - Momentum parameter
- - Second moment of the gradient
- - RMS prop
- - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- - Algorithms and codes for Adagrad, RMSprop and Adam
- - Practical tips
- - Sneaking in automatic differentiation using Autograd
- - Same code but now with momentum gradient descent
- - But none of these can compete with Newton's method
- - Including Stochastic Gradient Descent with Autograd
- - Same code but now with momentum gradient descent
- - Similar (second order function now) problem but now with AdaGrad
- - RMSprop for adaptive learning rate with Stochastic Gradient Descent
- - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- - Material for the lab sessions
+ - Pros and cons
+ - Convergence rates
+ - Accuracy
+ - Stochastic Gradient Descent (SGD)
+ - Stochastic Gradient Descent
+ - Computation of gradients
+ - SGD example
+ - The gradient step
+ - Simple example code
+ - When do we stop?
+ - Slightly different approach
+ - Time decay rate
+ - Code with a Number of Minibatches which varies
+ - Replace or not
+ - Momentum based GD
+ - More on momentum based approaches
+ - Momentum parameter
+ - Second moment of the gradient
+ - RMS prop
+ - "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ - Algorithms and codes for Adagrad, RMSprop and Adam
+ - AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ - Practical tips
+ - Sneaking in auotmatic differentiation using Autograd
+ - Same code but now with momentum gradient descent
+ - Including Stochastic Gradient Descent with Autograd
+ - Same code but now with momentum gradient descent
+ - Similar (second order function now) problem but now with AdaGrad
+ - RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ - And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ - Material for the lab sessions
@@ -258,16 +277,7 @@ MathJax.Hub.Config({
-Time decay rate
-
-As an example, let \( e = 0,1,2,3,\cdots \) denote the current epoch and let \( t_0, t_1 > 0 \) be two fixed numbers. Furthermore, let \( t = e \cdot m + i \) where \( m \) is the number of minibatches and \( i=0,\cdots,m-1 \). Then the function $$\gamma_j(t; t_0, t_1) = \frac{t_0}{t+t_1} $$ goes to zero as the number of epochs gets large. I.e. we start with a step length \( \gamma_j (0; t_0, t_1) = t_0/t_1 \) which decays in time \( t \).
-
-In this way we can fix the number of epochs, compute \( \beta \) and
-evaluate the cost function at the end. Repeating the computation will
-give a different result since the scheme is random by design. Then we
-pick the final \( \beta \) that gives the lowest value of the cost
-function.
-
+Simple example code
@@ -278,28 +288,18 @@ function.
import numpy as np
-def step_length(t,t0,t1):
- return t0/(t+t1)
-
n = 100 #100 datapoints
M = 5 #size of each minibatch
m = int(n/M) #number of minibatches
-n_epochs = 500 #number of epochs
-t0 = 1.0
-t1 = 10
+n_epochs = 10 #number of epochs
-gamma_j = t0/t1
j = 0
for epoch in range(1,n_epochs+1):
for i in range(m):
k = np.random.randint(m) #Pick the k-th minibatch at random
#Compute the gradient using the data in minibatch Bk
- #Compute new suggestion for beta
- t = epoch*m+i
- gamma_j = step_length(t,t0,t1)
+ #Compute new suggestion for
j += 1
-
-print("gamma_j after %d epochs: %g" % (n_epochs,gamma_j))
@@ -315,6 +315,14 @@ j = 0
+Taking the gradient only on a subset of the data has two important
+benefits. First, it introduces randomness which decreases the chance
+that our opmization scheme gets stuck in a local minima. Second, if
+the size of the minibatches are small relative to the number of
+datapoints (\( M < n \)), the computation of the gradient is much
+cheaper since we sum over the datapoints in the \( k-th \) minibatch and not
+all \( n \) datapoints.
+
@@ -341,7 +349,7 @@ j = 0
35
36
...
- 46
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs027.html b/doc/pub/week37/html/._week37-bs027.html
index e59a6392a..9a1f03ee5 100644
--- a/doc/pub/week37/html/._week37-bs027.html
+++ b/doc/pub/week37/html/._week37-bs027.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,97 +277,19 @@ MathJax.Hub.Config({
-Code with a Number of Minibatches which varies
-
-In the code here we vary the number of mini-batches.
-
-
-
+When do we stop?
+A natural question is when do we stop the search for a new minimum?
+One possibility is to compute the full gradient after a given number
+of epochs and check if the norm of the gradient is smaller than some
+threshold and stop if true. However, the condition that the gradient
+is zero is valid also for local minima, so this would only tell us
+that we are close to a local/global minimum. However, we could also
+evaluate the cost function at this point, store the result and
+continue the search. If the test kicks in at a later stage we can
+compare the values of the cost function and keep the \( \beta \) that
+gave the lowest value.
+
@@ -375,7 +316,7 @@ plt.show()
36
37
...
- 46
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs028.html b/doc/pub/week37/html/._week37-bs028.html
index abcec5972..e9e33bc93 100644
--- a/doc/pub/week37/html/._week37-bs028.html
+++ b/doc/pub/week37/html/._week37-bs028.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,12 +277,17 @@ MathJax.Hub.Config({
-Replace or not
+Slightly different approach
-In the above code, we have use replacement in setting up the
-mini-batches. The discussion
-here may be
-useful.
+
Another approach is to let the step length \( \gamma_j \) depend on the
+number of epochs in such a way that it becomes very small after a
+reasonable time such that we do not move at all. Such approaches are
+also called scaling. There are many such ways to scale the learning
+rate
+and discussions here. See
+also
+https://towardsdatascience.com/learning-rate-schedules-and-adaptive-learning-rate-methods-for-deep-learning-2c8f433990d1
+for a discussion of different scaling functions for the learning rate.
@@ -291,7 +315,7 @@ useful.
37
38
...
- 46
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs029.html b/doc/pub/week37/html/._week37-bs029.html
index e085e692b..202ea0fcc 100644
--- a/doc/pub/week37/html/._week37-bs029.html
+++ b/doc/pub/week37/html/._week37-bs029.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,39 +277,63 @@ MathJax.Hub.Config({
-Momentum based GD
+Time decay rate
-The stochastic gradient descent (SGD) is almost always used with a
-momentum or inertia term that serves as a memory of the direction we
-are moving in parameter space. This is typically implemented as
-follows
+
As an example, let \( e = 0,1,2,3,\cdots \) denote the current epoch and let \( t_0, t_1 > 0 \) be two fixed numbers. Furthermore, let \( t = e \cdot m + i \) where \( m \) is the number of minibatches and \( i=0,\cdots,m-1 \). Then the function $$\gamma_j(t; t_0, t_1) = \frac{t_0}{t+t_1} $$ goes to zero as the number of epochs gets large. I.e. we start with a step length \( \gamma_j (0; t_0, t_1) = t_0/t_1 \) which decays in time \( t \).
+
+In this way we can fix the number of epochs, compute \( \beta \) and
+evaluate the cost function at the end. Repeating the computation will
+give a different result since the scheme is random by design. Then we
+pick the final \( \beta \) that gives the lowest value of the cost
+function.
-$$
-\begin{align}
-\mathbf{v}_{t}&=\gamma \mathbf{v}_{t-1}+\eta_{t}\nabla_\theta E(\boldsymbol{\theta}_t) \nonumber \\
-\boldsymbol{\theta}_{t+1}&= \boldsymbol{\theta}_t -\mathbf{v}_{t},
-\tag{1}
-\end{align}
-$$
-where we have introduced a momentum parameter \( \gamma \), with
-\( 0\le\gamma\le 1 \), and for brevity we dropped the explicit notation to
-indicate the gradient is to be taken over a different mini-batch at
-each step. We call this algorithm gradient descent with momentum
-(GDM). From these equations, it is clear that \( \mathbf{v}_t \) is a
-running average of recently encountered gradients and
-\( (1-\gamma)^{-1} \) sets the characteristic time scale for the memory
-used in the averaging procedure. Consistent with this, when
-\( \gamma=0 \), this just reduces down to ordinary SGD as discussed
-earlier. An equivalent way of writing the updates is
-
+
+
-where we have defined \( \Delta \boldsymbol{\theta}_{t}= \boldsymbol{\theta}_t-\boldsymbol{\theta}_{t-1} \).
@@ -317,7 +360,7 @@ $$
38
39
...
- 46
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs030.html b/doc/pub/week37/html/._week37-bs030.html
index e149be2ff..4d810a1d2 100644
--- a/doc/pub/week37/html/._week37-bs030.html
+++ b/doc/pub/week37/html/._week37-bs030.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,30 +277,96 @@ MathJax.Hub.Config({
-More on momentum based approaches
+Code with a Number of Minibatches which varies
-Let us try to get more intuition from these equations. It is helpful
-to consider a simple physical analogy with a particle of mass \( m \)
-moving in a viscous medium with drag coefficient \( \mu \) and potential
-\( E(\mathbf{w}) \). If we denote the particle's position by \( \mathbf{w} \),
-then its motion is described by
-
+In the code here we vary the number of mini-batches.
-$$
-m {d^2 \mathbf{w} \over dt^2} + \mu {d \mathbf{w} \over dt }= -\nabla_w E(\mathbf{w}).
-$$
+
+
@@ -309,7 +394,7 @@ $$
39
40
...
- 46
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs031.html b/doc/pub/week37/html/._week37-bs031.html
index 1463b079c..58b507ddc 100644
--- a/doc/pub/week37/html/._week37-bs031.html
+++ b/doc/pub/week37/html/._week37-bs031.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,58 +277,14 @@ MathJax.Hub.Config({
-Momentum parameter
+Replace or not
-Notice that this equation is identical to previous one if we identify
-the position of the particle, \( \mathbf{w} \), with the parameters
-\( \boldsymbol{\theta} \). This allows us to identify the momentum
-parameter and learning rate with the mass of the particle and the
-viscous drag as:
+
In the above code, we have use replacement in setting up the
+mini-batches. The discussion
+here may be
+useful.
-$$
-\gamma= {m \over m +\mu \Delta t }, \qquad \eta = {(\Delta t)^2 \over m +\mu \Delta t}.
-$$
-
-Thus, as the name suggests, the momentum parameter is proportional to
-the mass of the particle and effectively provides inertia.
-Furthermore, in the large viscosity/small learning rate limit, our
-memory time scales as \( (1-\gamma)^{-1} \approx m/(\mu \Delta t) \).
-
-
-Why is momentum useful? SGD momentum helps the gradient descent
-algorithm gain speed in directions with persistent but small gradients
-even in the presence of stochasticity, while suppressing oscillations
-in high-curvature directions. This becomes especially important in
-situations where the landscape is shallow and flat in some directions
-and narrow and steep in others. It has been argued that first-order
-methods (with appropriate initial conditions) can perform comparable
-to more expensive second order methods, especially in the context of
-complex deep learning models.
-
-
-These beneficial properties of momentum can sometimes become even more
-pronounced by using a slight modification of the classical momentum
-algorithm called Nesterov Accelerated Gradient (NAG).
-
-
-In the NAG algorithm, rather than calculating the gradient at the
-current parameters, \( \nabla_\theta E(\boldsymbol{\theta}_t) \), one
-calculates the gradient at the expected value of the parameters given
-our current momentum, \( \nabla_\theta E(\boldsymbol{\theta}_t +\gamma
-\mathbf{v}_{t-1}) \). This yields the NAG update rule
-
-
-$$
-\begin{align}
-\mathbf{v}_{t}&=\gamma \mathbf{v}_{t-1}+\eta_{t}\nabla_\theta E(\boldsymbol{\theta}_t +\gamma \mathbf{v}_{t-1}) \nonumber \\
-\boldsymbol{\theta}_{t+1}&= \boldsymbol{\theta}_t -\mathbf{v}_{t}.
-\tag{2}
-\end{align}
-$$
-
-One of the major advantages of NAG is that it allows for the use of a larger learning rate than GDM for the same choice of \( \gamma \).
-
diff --git a/doc/pub/week37/html/._week37-bs032.html b/doc/pub/week37/html/._week37-bs032.html
index 21fd568cf..c368a7e16 100644
--- a/doc/pub/week37/html/._week37-bs032.html
+++ b/doc/pub/week37/html/._week37-bs032.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,31 +277,40 @@ MathJax.Hub.Config({
-Second moment of the gradient
+Momentum based GD
-In stochastic gradient descent, with and without momentum, we still
-have to specify a schedule for tuning the learning rates \( \eta_t \)
-as a function of time. As discussed in the context of Newton's
-method, this presents a number of dilemmas. The learning rate is
-limited by the steepest direction which can change depending on the
-current position in the landscape. To circumvent this problem, ideally
-our algorithm would keep track of curvature and take large steps in
-shallow, flat directions and small steps in steep, narrow directions.
-Second-order methods accomplish this by calculating or approximating
-the Hessian and normalizing the learning rate by the
-curvature. However, this is very computationally expensive for
-extremely large models. Ideally, we would like to be able to
-adaptively change the step size to match the landscape without paying
-the steep computational price of calculating or approximating
-Hessians.
+
The stochastic gradient descent (SGD) is almost always used with a
+momentum or inertia term that serves as a memory of the direction we
+are moving in parameter space. This is typically implemented as
+follows
-Recently, a number of methods have been introduced that accomplish
-this by tracking not only the gradient, but also the second moment of
-the gradient. These methods include AdaGrad, AdaDelta, Root Mean Squared Propagation (RMS-Prop), and
-ADAM.
+$$
+\begin{align}
+\mathbf{v}_{t}&=\gamma \mathbf{v}_{t-1}+\eta_{t}\nabla_\theta E(\boldsymbol{\theta}_t) \nonumber \\
+\boldsymbol{\theta}_{t+1}&= \boldsymbol{\theta}_t -\mathbf{v}_{t},
+\tag{1}
+\end{align}
+$$
+
+
where we have introduced a momentum parameter \( \gamma \), with
+\( 0\le\gamma\le 1 \), and for brevity we dropped the explicit notation to
+indicate the gradient is to be taken over a different mini-batch at
+each step. We call this algorithm gradient descent with momentum
+(GDM). From these equations, it is clear that \( \mathbf{v}_t \) is a
+running average of recently encountered gradients and
+\( (1-\gamma)^{-1} \) sets the characteristic time scale for the memory
+used in the averaging procedure. Consistent with this, when
+\( \gamma=0 \), this just reduces down to ordinary SGD as discussed
+earlier. An equivalent way of writing the updates is
+$$
+\Delta \boldsymbol{\theta}_{t+1} = \gamma \Delta \boldsymbol{\theta}_t -\ \eta_{t}\nabla_\theta E(\boldsymbol{\theta}_t),
+$$
+
+where we have defined \( \Delta \boldsymbol{\theta}_{t}= \boldsymbol{\theta}_t-\boldsymbol{\theta}_{t-1} \).
+
diff --git a/doc/pub/week37/html/._week37-bs033.html b/doc/pub/week37/html/._week37-bs033.html
index a375fe4c2..e18d330fb 100644
--- a/doc/pub/week37/html/._week37-bs033.html
+++ b/doc/pub/week37/html/._week37-bs033.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,33 +277,31 @@ MathJax.Hub.Config({
-RMS prop
+More on momentum based approaches
-In RMS prop, in addition to keeping a running average of the first
-moment of the gradient, we also keep track of the second moment
-denoted by \( \mathbf{s}_t=\mathbb{E}[\mathbf{g}_t^2] \). The update rule
-for RMS prop is given by
+
Let us try to get more intuition from these equations. It is helpful
+to consider a simple physical analogy with a particle of mass \( m \)
+moving in a viscous medium with drag coefficient \( \mu \) and potential
+\( E(\mathbf{w}) \). If we denote the particle's position by \( \mathbf{w} \),
+then its motion is described by
$$
-\begin{align}
-\mathbf{g}_t &= \nabla_\theta E(\boldsymbol{\theta})
-\tag{3}\\
-\mathbf{s}_t &=\beta \mathbf{s}_{t-1} +(1-\beta)\mathbf{g}_t^2 \nonumber \\
-\boldsymbol{\theta}_{t+1}&=&\boldsymbol{\theta}_t - \eta_t { \mathbf{g}_t \over \sqrt{\mathbf{s}_t +\epsilon}}, \nonumber
-\end{align}
+m {d^2 \mathbf{w} \over dt^2} + \mu {d \mathbf{w} \over dt }= -\nabla_w E(\mathbf{w}).
+$$
+
+We can discretize this equation in the usual way to get
+
+$$
+m { \mathbf{w}_{t+\Delta t}-2 \mathbf{w}_{t} +\mathbf{w}_{t-\Delta t} \over (\Delta t)^2}+\mu {\mathbf{w}_{t+\Delta t}- \mathbf{w}_{t} \over \Delta t} = -\nabla_w E(\mathbf{w}).
+$$
+
+Rearranging this equation, we can rewrite this as
+
+$$
+\Delta \mathbf{w}_{t +\Delta t}= - { (\Delta t)^2 \over m +\mu \Delta t} \nabla_w E(\mathbf{w})+ {m \over m +\mu \Delta t} \Delta \mathbf{w}_t.
$$
-where \( \beta \) controls the averaging time of the second moment and is
-typically taken to be about \( \beta=0.9 \), \( \eta_t \) is a learning rate
-typically chosen to be \( 10^{-3} \), and \( \epsilon\sim 10^{-8} \) is a
-small regularization constant to prevent divergences. Multiplication
-and division by vectors is understood as an element-wise operation. It
-is clear from this formula that the learning rate is reduced in
-directions where the norm of the gradient is consistently large. This
-greatly speeds up the convergence by allowing us to use a larger
-learning rate for flat directions.
-
@@ -311,7 +328,7 @@ learning rate for flat directions.
42
43
...
- 46
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs034.html b/doc/pub/week37/html/._week37-bs034.html
index 1d4ebc309..c443a8f65 100644
--- a/doc/pub/week37/html/._week37-bs034.html
+++ b/doc/pub/week37/html/._week37-bs034.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,60 +277,60 @@ MathJax.Hub.Config({
-
+Momentum parameter
-A related algorithm is the ADAM optimizer. In
-ADAM, we keep a running average of
-both the first and second moment of the gradient and use this
-information to adaptively change the learning rate for different
-parameters. The method isefficient when working with large
-problems involving lots data and/or parameters. It is a combination of the
-gradient descent with momentum algorithm and the RMSprop algorithm
-discussed above.
+
Notice that this equation is identical to previous one if we identify
+the position of the particle, \( \mathbf{w} \), with the parameters
+\( \boldsymbol{\theta} \). This allows us to identify the momentum
+parameter and learning rate with the mass of the particle and the
+viscous drag as:
-In addition to keeping a running average of the first and
-second moments of the gradient
-(i.e. \( \mathbf{m}_t=\mathbb{E}[\mathbf{g}_t] \) and
-\( \mathbf{s}_t=\mathbb{E}[\mathbf{g}^2_t] \), respectively), ADAM
-performs an additional bias correction to account for the fact that we
-are estimating the first two moments of the gradient using a running
-average (denoted by the hats in the update rule below). The update
-rule for ADAM is given by (where multiplication and division are once
-again understood to be element-wise operations below)
+$$
+\gamma= {m \over m +\mu \Delta t }, \qquad \eta = {(\Delta t)^2 \over m +\mu \Delta t}.
+$$
+
+
Thus, as the name suggests, the momentum parameter is proportional to
+the mass of the particle and effectively provides inertia.
+Furthermore, in the large viscosity/small learning rate limit, our
+memory time scales as \( (1-\gamma)^{-1} \approx m/(\mu \Delta t) \).
+
+
+Why is momentum useful? SGD momentum helps the gradient descent
+algorithm gain speed in directions with persistent but small gradients
+even in the presence of stochasticity, while suppressing oscillations
+in high-curvature directions. This becomes especially important in
+situations where the landscape is shallow and flat in some directions
+and narrow and steep in others. It has been argued that first-order
+methods (with appropriate initial conditions) can perform comparable
+to more expensive second order methods, especially in the context of
+complex deep learning models.
+
+
+These beneficial properties of momentum can sometimes become even more
+pronounced by using a slight modification of the classical momentum
+algorithm called Nesterov Accelerated Gradient (NAG).
+
+
+In the NAG algorithm, rather than calculating the gradient at the
+current parameters, \( \nabla_\theta E(\boldsymbol{\theta}_t) \), one
+calculates the gradient at the expected value of the parameters given
+our current momentum, \( \nabla_\theta E(\boldsymbol{\theta}_t +\gamma
+\mathbf{v}_{t-1}) \). This yields the NAG update rule
$$
\begin{align}
-\mathbf{g}_t &= \nabla_\theta E(\boldsymbol{\theta})
-\tag{4}\\
-\mathbf{m}_t &= \beta_1 \mathbf{m}_{t-1} + (1-\beta_1) \mathbf{g}_t \nonumber \\
-\mathbf{s}_t &=\beta_2 \mathbf{s}_{t-1} +(1-\beta_2)\mathbf{g}_t^2 \nonumber \\
-\boldsymbol{\mathbf{m}}_t&={\mathbf{m}_t \over 1-\beta_1^t} \nonumber \\
-\boldsymbol{\mathbf{s}}_t &={\mathbf{s}_t \over1-\beta_2^t} \nonumber \\
-\boldsymbol{\theta}_{t+1}&=\boldsymbol{\theta}_t - \eta_t { \boldsymbol{\mathbf{m}}_t \over \sqrt{\boldsymbol{\mathbf{s}}_t} +\epsilon}, \nonumber \\
-\tag{5}
+\mathbf{v}_{t}&=\gamma \mathbf{v}_{t-1}+\eta_{t}\nabla_\theta E(\boldsymbol{\theta}_t +\gamma \mathbf{v}_{t-1}) \nonumber \\
+\boldsymbol{\theta}_{t+1}&= \boldsymbol{\theta}_t -\mathbf{v}_{t}.
+\tag{2}
\end{align}
$$
-where \( \beta_1 \) and \( \beta_2 \) set the memory lifetime of the first and
-second moment and are typically taken to be \( 0.9 \) and \( 0.99 \)
-respectively, and \( \eta \) and \( \epsilon \) are identical to RMSprop.
+
One of the major advantages of NAG is that it allows for the use of a
+larger learning rate than GDM for the same choice of \( \gamma \).
-Like in RMSprop, the effective step size of a parameter depends on the
-magnitude of its gradient squared. To understand this better, let us
-rewrite this expression in terms of the variance
-\( \boldsymbol{\sigma}_t^2 = \boldsymbol{\mathbf{s}}_t -
-(\boldsymbol{\mathbf{m}}_t)^2 \). Consider a single parameter \( \theta_t \). The
-update rule for this parameter is given by
-
-
-$$
-\Delta \theta_{t+1}= -\eta_t { \boldsymbol{m}_t \over \sqrt{\sigma_t^2 + m_t^2 }+\epsilon}.
-$$
-
-
diff --git a/doc/pub/week37/html/._week37-bs035.html b/doc/pub/week37/html/._week37-bs035.html
index 8d2b305ee..d835233f4 100644
--- a/doc/pub/week37/html/._week37-bs035.html
+++ b/doc/pub/week37/html/._week37-bs035.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,11 +277,30 @@ MathJax.Hub.Config({
-Algorithms and codes for Adagrad, RMSprop and Adam
+Second moment of the gradient
-The algorithms we have implemented are well described in the text by Goodfellow, Bengio and Courville, chapter 8.
+In stochastic gradient descent, with and without momentum, we still
+have to specify a schedule for tuning the learning rates \( \eta_t \)
+as a function of time. As discussed in the context of Newton's
+method, this presents a number of dilemmas. The learning rate is
+limited by the steepest direction which can change depending on the
+current position in the landscape. To circumvent this problem, ideally
+our algorithm would keep track of curvature and take large steps in
+shallow, flat directions and small steps in steep, narrow directions.
+Second-order methods accomplish this by calculating or approximating
+the Hessian and normalizing the learning rate by the
+curvature. However, this is very computationally expensive for
+extremely large models. Ideally, we would like to be able to
+adaptively change the step size to match the landscape without paying
+the steep computational price of calculating or approximating
+Hessians.
+
-The codes which implement these algorithms are discussed below here.
+During the last decade a number of methods have been introduced that accomplish
+this by tracking not only the gradient, but also the second moment of
+the gradient. These methods include AdaGrad, AdaDelta, Root Mean Squared Propagation (RMS-Prop), and
+ADAM.
+
@@ -289,7 +327,7 @@ MathJax.Hub.Config({
44
45
...
- 46
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs036.html b/doc/pub/week37/html/._week37-bs036.html
index e3d652f14..8f8250e24 100644
--- a/doc/pub/week37/html/._week37-bs036.html
+++ b/doc/pub/week37/html/._week37-bs036.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,14 +277,34 @@ MathJax.Hub.Config({
-Practical tips
+RMS prop
+
+In RMS prop, in addition to keeping a running average of the first
+moment of the gradient, we also keep track of the second moment
+denoted by \( \mathbf{s}_t=\mathbb{E}[\mathbf{g}_t^2] \). The update rule
+for RMS prop is given by
+
+
+$$
+\begin{align}
+\mathbf{g}_t &= \nabla_\theta E(\boldsymbol{\theta})
+\tag{3}\\
+\mathbf{s}_t &=\beta \mathbf{s}_{t-1} +(1-\beta)\mathbf{g}_t^2 \nonumber \\
+\boldsymbol{\theta}_{t+1}&=&\boldsymbol{\theta}_t - \eta_t { \mathbf{g}_t \over \sqrt{\mathbf{s}_t +\epsilon}}, \nonumber
+\end{align}
+$$
+
+where \( \beta \) controls the averaging time of the second moment and is
+typically taken to be about \( \beta=0.9 \), \( \eta_t \) is a learning rate
+typically chosen to be \( 10^{-3} \), and \( \epsilon\sim 10^{-8} \) is a
+small regularization constant to prevent divergences. Multiplication
+and division by vectors is understood as an element-wise operation. It
+is clear from this formula that the learning rate is reduced in
+directions where the norm of the gradient is consistently large. This
+greatly speeds up the convergence by allowing us to use a larger
+learning rate for flat directions.
+
-
-- Randomize the data when making mini-batches. It is always important to randomly shuffle the data when forming mini-batches. Otherwise, the gradient descent method can fit spurious correlations resulting from the order in which data is presented.
-- Transform your inputs. Learning becomes difficult when our landscape has a mixture of steep and flat directions. One simple trick for minimizing these situations is to standardize the data by subtracting the mean and normalizing the variance of input variables. Whenever possible, also decorrelate the inputs. To understand why this is helpful, consider the case of linear regression. It is easy to show that for the squared error cost function, the Hessian of the cost function is just the correlation matrix between the inputs. Thus, by standardizing the inputs, we are ensuring that the landscape looks homogeneous in all directions in parameter space. Since most deep networks can be viewed as linear transformations followed by a non-linearity at each layer, we expect this intuition to hold beyond the linear case.
-- Monitor the out-of-sample performance. Always monitor the performance of your model on a validation set (a small portion of the training data that is held out of the training process to serve as a proxy for the test set. If the validation error starts increasing, then the model is beginning to overfit. Terminate the learning process. This early stopping significantly improves performance in many settings.
-- Adaptive optimization methods don't always have good generalization. Recent studies have shown that adaptive methods such as ADAM, RMSPorp, and AdaGrad tend to have poor generalization compared to SGD or SGD with momentum, particularly in the high-dimensional limit (i.e. the number of parameters exceeds the number of data points). Although it is not clear at this stage why these methods perform so well in training deep neural networks, simpler procedures like properly-tuned SGD may work as well or better in these applications.
-
diff --git a/doc/pub/week37/html/._week37-bs037.html b/doc/pub/week37/html/._week37-bs037.html
index 32d254b75..95a6cb8b2 100644
--- a/doc/pub/week37/html/._week37-bs037.html
+++ b/doc/pub/week37/html/._week37-bs037.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,82 +277,58 @@ MathJax.Hub.Config({
-Sneaking in automatic differentiation using Autograd
+
-We anticipate our discussions to come in connection with neural networks and automatic differentiation
-by showing how we can use autograd for the cases above. Later we will replace autograd with JAX.
+
A related algorithm is the ADAM optimizer. In
+ADAM, we keep a running average of
+both the first and second moment of the gradient and use this
+information to adaptively change the learning rate for different
+parameters. The method isefficient when working with large
+problems involving lots data and/or parameters. It is a combination of the
+gradient descent with momentum algorithm and the RMSprop algorithm
+discussed above.
+In addition to keeping a running average of the first and
+second moments of the gradient
+(i.e. \( \mathbf{m}_t=\mathbb{E}[\mathbf{g}_t] \) and
+\( \mathbf{s}_t=\mathbb{E}[\mathbf{g}^2_t] \), respectively), ADAM
+performs an additional bias correction to account for the fact that we
+are estimating the first two moments of the gradient using a running
+average (denoted by the hats in the update rule below). The update
+rule for ADAM is given by (where multiplication and division are once
+again understood to be element-wise operations below)
+
-
-
+$$
+\Delta \theta_{t+1}= -\eta_t { \boldsymbol{m}_t \over \sqrt{\sigma_t^2 + m_t^2 }+\epsilon}.
+$$
@@ -359,6 +354,9 @@ plt.show()
44
45
46
+ 47
+ ...
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs038.html b/doc/pub/week37/html/._week37-bs038.html
index 0d2d20f03..706f006ab 100644
--- a/doc/pub/week37/html/._week37-bs038.html
+++ b/doc/pub/week37/html/._week37-bs038.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,82 +277,32 @@ MathJax.Hub.Config({
-Same code but now with momentum gradient descent
+Algorithms and codes for Adagrad, RMSprop and Adam
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -357,6 +326,8 @@ delta_momentum = 44
45
46
+ 47
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs039.html b/doc/pub/week37/html/._week37-bs039.html
index 7aadc4545..dcc694333 100644
--- a/doc/pub/week37/html/._week37-bs039.html
+++ b/doc/pub/week37/html/._week37-bs039.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,69 +277,14 @@ MathJax.Hub.Config({
-But none of these can compete with Newton's method
-
-
-
-
-
+Practical tips
+
+- Randomize the data when making mini-batches. It is always important to randomly shuffle the data when forming mini-batches. Otherwise, the gradient descent method can fit spurious correlations resulting from the order in which data is presented.
+- Transform your inputs. Learning becomes difficult when our landscape has a mixture of steep and flat directions. One simple trick for minimizing these situations is to standardize the data by subtracting the mean and normalizing the variance of input variables. Whenever possible, also decorrelate the inputs. To understand why this is helpful, consider the case of linear regression. It is easy to show that for the squared error cost function, the Hessian of the cost function is just the correlation matrix between the inputs. Thus, by standardizing the inputs, we are ensuring that the landscape looks homogeneous in all directions in parameter space. Since most deep networks can be viewed as linear transformations followed by a non-linearity at each layer, we expect this intuition to hold beyond the linear case.
+- Monitor the out-of-sample performance. Always monitor the performance of your model on a validation set (a small portion of the training data that is held out of the training process to serve as a proxy for the test set. If the validation error starts increasing, then the model is beginning to overfit. Terminate the learning process. This early stopping significantly improves performance in many settings.
+- Adaptive optimization methods don't always have good generalization. Recent studies have shown that adaptive methods such as ADAM, RMSPorp, and AdaGrad tend to have poor generalization compared to SGD or SGD with momentum, particularly in the high-dimensional limit (i.e. the number of parameters exceeds the number of data points). Although it is not clear at this stage why these methods perform so well in training deep neural networks, simpler procedures like properly-tuned SGD may work as well or better in these applications.
+
diff --git a/doc/pub/week37/html/._week37-bs040.html b/doc/pub/week37/html/._week37-bs040.html
index e6c23f356..4d8cb7c5d 100644
--- a/doc/pub/week37/html/._week37-bs040.html
+++ b/doc/pub/week37/html/._week37-bs040.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -258,8 +277,12 @@ MathJax.Hub.Config({
-Including Stochastic Gradient Descent with Autograd
-In this code we include the stochastic gradient descent approach discussed above. Note here that we specify which argument we are taking the derivative with respect to when using autograd.
+Sneaking in auotmatic differentiation using Autograd
+
+We conclude the part on optmization by showing how we can make codes
+for linear regression and logistic regression using autograd. The
+first example shows results with ordinary leats squares.
+
@@ -268,17 +291,15 @@ MathJax.Hub.Config({
@@ -377,6 +376,8 @@ theta
= np
.44
45
46
+ 47
+ 48
»
diff --git a/doc/pub/week37/html/._week37-bs041.html b/doc/pub/week37/html/._week37-bs041.html
index ee18c3199..ca7cb828b 100644
--- a/doc/pub/week37/html/._week37-bs041.html
+++ b/doc/pub/week37/html/._week37-bs041.html
@@ -82,11 +82,14 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ('Overview video on Stochastic Gradient Descent',
+ ('Overview video on Stochastic Gradient Descent (SGD)',
2,
None,
- 'overview-video-on-stochastic-gradient-descent'),
+ 'overview-video-on-stochastic-gradient-descent-sgd'),
('Batches and mini-batches', 2, None, 'batches-and-mini-batches'),
+ ('Pros and cons', 2, None, 'pros-and-cons'),
+ ('Convergence rates', 2, None, 'convergence-rates'),
+ ('Accuracy', 2, None, 'accuracy'),
('Stochastic Gradient Descent (SGD)',
2,
None,
@@ -129,19 +132,30 @@ doconce format html week37.do.txt --html_style=bootstrap --pygments_html_style=d
2,
None,
'algorithms-and-codes-for-adagrad-rmsprop-and-adam'),
- ('Practical tips', 2, None, 'practical-tips'),
- ('Sneaking in automatic differentiation using Autograd',
+ ('AdaGrad algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
2,
None,
- 'sneaking-in-automatic-differentiation-using-autograd'),
+ 'adagrad-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('RMSProp algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'rmsprop-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('ADAM algorithm, taken from "Goodfellow et '
+ 'al":"https://www.deeplearningbook.org/contents/optimization.html"',
+ 2,
+ None,
+ 'adam-algorithm-taken-from-goodfellow-et-al-https-www-deeplearningbook-org-contents-optimization-html'),
+ ('Practical tips', 2, None, 'practical-tips'),
+ ('Sneaking in auotmatic differentiation using Autograd',
+ 2,
+ None,
+ 'sneaking-in-auotmatic-differentiation-using-autograd'),
('Same code but now with momentum gradient descent',
2,
None,
'same-code-but-now-with-momentum-gradient-descent'),
- ("But none of these can compete with Newton's method",
- 2,
- None,
- 'but-none-of-these-can-compete-with-newton-s-method'),
('Including Stochastic Gradient Descent with Autograd',
2,
None,
@@ -216,37 +230,42 @@ MathJax.Hub.Config({
Program example for gradient descent with Ridge Regression
Using gradient descent methods, limitations
Improving gradient descent with momentum
- Same code but now with momentum gradient descent
- Overview video on Stochastic Gradient Descent
+ Same code but now with momentum gradient descent
+ Overview video on Stochastic Gradient Descent (SGD)
Batches and mini-batches
- Stochastic Gradient Descent (SGD)
- Stochastic Gradient Descent
- Computation of gradients
- SGD example
- The gradient step
- Simple example code
- When do we stop?
- Slightly different approach
- Time decay rate
- Code with a Number of Minibatches which varies
- Replace or not
- Momentum based GD
- More on momentum based approaches
- Momentum parameter
- Second moment of the gradient
- RMS prop
- "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
- Algorithms and codes for Adagrad, RMSprop and Adam
- Practical tips
- Sneaking in automatic differentiation using Autograd
- Same code but now with momentum gradient descent
- But none of these can compete with Newton's method
- Including Stochastic Gradient Descent with Autograd
- Same code but now with momentum gradient descent
- Similar (second order function now) problem but now with AdaGrad
- RMSprop for adaptive learning rate with Stochastic Gradient Descent
- And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
- Material for the lab sessions
+ Pros and cons
+ Convergence rates
+ Accuracy
+ Stochastic Gradient Descent (SGD)
+ Stochastic Gradient Descent
+ Computation of gradients
+ SGD example
+ The gradient step
+ Simple example code
+ When do we stop?
+ Slightly different approach
+ Time decay rate
+ Code with a Number of Minibatches which varies
+ Replace or not
+ Momentum based GD
+ More on momentum based approaches
+ Momentum parameter
+ Second moment of the gradient
+ RMS prop
+ "ADAM optimizer":"https://arxiv.org/abs/1412.6980"
+ Algorithms and codes for Adagrad, RMSprop and Adam
+ AdaGrad algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ RMSProp algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ ADAM algorithm, taken from "Goodfellow et al":"https://www.deeplearningbook.org/contents/optimization.html"
+ Practical tips
+ Sneaking in auotmatic differentiation using Autograd
+ Same code but now with momentum gradient descent
+ Including Stochastic Gradient Descent with Autograd
+ Same code but now with momentum gradient descent
+ Similar (second order function now) problem but now with AdaGrad
+ RMSprop for adaptive learning rate with Stochastic Gradient Descent
+ And finally "ADAM":"https://arxiv.org/pdf/1412.6980.pdf"
+ Material for the lab sessions
@@ -266,21 +285,19 @@ MathJax.Hub.Config({