diff --git a/doc/pub/Splines/html/._Splines-bs000.html b/doc/pub/Splines/html/._Splines-bs000.html index 0024f8776..02f35b586 100644 --- a/doc/pub/Splines/html/._Splines-bs000.html +++ b/doc/pub/Splines/html/._Splines-bs000.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -321,7 +319,7 @@ MathJax.Hub.Config({
  • 9
  • 10
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs001.html b/doc/pub/Splines/html/._Splines-bs001.html index 3d3be0f19..e9f04f73a 100644 --- a/doc/pub/Splines/html/._Splines-bs001.html +++ b/doc/pub/Splines/html/._Splines-bs001.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -307,7 +305,7 @@ some approximative/numerical method to compute the minimum.
  • 10
  • 11
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs002.html b/doc/pub/Splines/html/._Splines-bs002.html index d42a049b1..b385da5b9 100644 --- a/doc/pub/Splines/html/._Splines-bs002.html +++ b/doc/pub/Splines/html/._Splines-bs002.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -315,7 +313,7 @@ where \( \hat{\beta} \) are the weights we wish to extract from data, in our cas
  • 11
  • 12
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs003.html b/doc/pub/Splines/html/._Splines-bs003.html index e4e2980f9..2aad53dba 100644 --- a/doc/pub/Splines/html/._Splines-bs003.html +++ b/doc/pub/Splines/html/._Splines-bs003.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -320,7 +318,7 @@ This defines what is called the Hessian matrix.
  • 12
  • 13
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs004.html b/doc/pub/Splines/html/._Splines-bs004.html index f8dc82928..4f46c3caa 100644 --- a/doc/pub/Splines/html/._Splines-bs004.html +++ b/doc/pub/Splines/html/._Splines-bs004.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -321,7 +319,7 @@ If we can compute these matrices, in particular the Hessian, the above is often
  • 13
  • 14
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs005.html b/doc/pub/Splines/html/._Splines-bs005.html index f96856390..c096b3cd3 100644 --- a/doc/pub/Splines/html/._Splines-bs005.html +++ b/doc/pub/Splines/html/._Splines-bs005.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -313,7 +311,7 @@ normally discourage the use of this method.
  • 14
  • 15
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs006.html b/doc/pub/Splines/html/._Splines-bs006.html index c24790ab7..3b3837500 100644 --- a/doc/pub/Splines/html/._Splines-bs006.html +++ b/doc/pub/Splines/html/._Splines-bs006.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -333,7 +331,7 @@ $$
  • 15
  • 16
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs007.html b/doc/pub/Splines/html/._Splines-bs007.html index e37e08dd0..9b03abdf0 100644 --- a/doc/pub/Splines/html/._Splines-bs007.html +++ b/doc/pub/Splines/html/._Splines-bs007.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -316,7 +314,7 @@ vanishes, then Newton-Raphson may fail totally
  • 16
  • 17
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs008.html b/doc/pub/Splines/html/._Splines-bs008.html index 5ede562d2..797324504 100644 --- a/doc/pub/Splines/html/._Splines-bs008.html +++ b/doc/pub/Splines/html/._Splines-bs008.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -354,7 +352,7 @@ more than two non-linear equations. In our case, the Jacobian matrix is given by
  • 17
  • 18
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs009.html b/doc/pub/Splines/html/._Splines-bs009.html index 6b16d7f74..cab23fbc0 100644 --- a/doc/pub/Splines/html/._Splines-bs009.html +++ b/doc/pub/Splines/html/._Splines-bs009.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -324,7 +322,7 @@ we are always moving towards smaller function values, i.e a minimum.
  • 18
  • 19
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs010.html b/doc/pub/Splines/html/._Splines-bs010.html index aa78e0bad..9993a1b2f 100644 --- a/doc/pub/Splines/html/._Splines-bs010.html +++ b/doc/pub/Splines/html/._Splines-bs010.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -320,7 +318,7 @@ the learning rate within the context of Machine Learning.
  • 19
  • 20
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs011.html b/doc/pub/Splines/html/._Splines-bs011.html index c700a6802..283e9ebba 100644 --- a/doc/pub/Splines/html/._Splines-bs011.html +++ b/doc/pub/Splines/html/._Splines-bs011.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -327,7 +325,7 @@ Note that the gradient is a function of \( \mathbf{x} =
  • 20
  • 21
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs012.html b/doc/pub/Splines/html/._Splines-bs012.html index 378a7750a..c40f755d7 100644 --- a/doc/pub/Splines/html/._Splines-bs012.html +++ b/doc/pub/Splines/html/._Splines-bs012.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -320,7 +318,7 @@ randomness. One such method is that of Stochastic Gradient Descent
  • 21
  • 22
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs013.html b/doc/pub/Splines/html/._Splines-bs013.html index 1c348f8fb..f1bd1fed3 100644 --- a/doc/pub/Splines/html/._Splines-bs013.html +++ b/doc/pub/Splines/html/._Splines-bs013.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -321,7 +319,7 @@ regular polygons (triangles, rectangles, pentagons, etc...).
  • 22
  • 23
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs014.html b/doc/pub/Splines/html/._Splines-bs014.html index 2c5e29df6..83780cd45 100644 --- a/doc/pub/Splines/html/._Splines-bs014.html +++ b/doc/pub/Splines/html/._Splines-bs014.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -309,7 +307,7 @@ MathJax.Hub.Config({
  • 23
  • 24
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs015.html b/doc/pub/Splines/html/._Splines-bs015.html index e3d81cf68..894f8abed 100644 --- a/doc/pub/Splines/html/._Splines-bs015.html +++ b/doc/pub/Splines/html/._Splines-bs015.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -345,7 +343,7 @@ This condition is particularly useful since it gives us an procedure for determi
  • 24
  • 25
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs016.html b/doc/pub/Splines/html/._Splines-bs016.html index cd3418d03..5c34bb43d 100644 --- a/doc/pub/Splines/html/._Splines-bs016.html +++ b/doc/pub/Splines/html/._Splines-bs016.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -332,7 +330,7 @@ This result means that if we know that the cost/loss function is convex and we a
  • 25
  • 26
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs017.html b/doc/pub/Splines/html/._Splines-bs017.html index 287380b30..8bd74084f 100644 --- a/doc/pub/Splines/html/._Splines-bs017.html +++ b/doc/pub/Splines/html/._Splines-bs017.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -328,7 +326,7 @@ Using the definition of convexity, try to show that a function satisfying the pr
  • 26
  • 27
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs018.html b/doc/pub/Splines/html/._Splines-bs018.html index 1342083bc..38d84a14b 100644 --- a/doc/pub/Splines/html/._Splines-bs018.html +++ b/doc/pub/Splines/html/._Splines-bs018.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -334,7 +332,7 @@ $$
  • 27
  • 28
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs019.html b/doc/pub/Splines/html/._Splines-bs019.html index a54ce872b..c8e86ab85 100644 --- a/doc/pub/Splines/html/._Splines-bs019.html +++ b/doc/pub/Splines/html/._Splines-bs019.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -326,7 +324,7 @@ and we want to find \( \beta \) such that \( C(\beta) \) is minimized.
  • 28
  • 29
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs020.html b/doc/pub/Splines/html/._Splines-bs020.html index 69264018f..db6016821 100644 --- a/doc/pub/Splines/html/._Splines-bs020.html +++ b/doc/pub/Splines/html/._Splines-bs020.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -316,7 +314,7 @@ where \( X \) is the design matrix defined above.
  • 29
  • 30
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs021.html b/doc/pub/Splines/html/._Splines-bs021.html index 80d965577..2458c72ed 100644 --- a/doc/pub/Splines/html/._Splines-bs021.html +++ b/doc/pub/Splines/html/._Splines-bs021.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -315,7 +313,7 @@ This result implies that \( C(\beta) \) is a convex function since the matrix \(
  • 30
  • 31
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs022.html b/doc/pub/Splines/html/._Splines-bs022.html index 8fae99874..09463450f 100644 --- a/doc/pub/Splines/html/._Splines-bs022.html +++ b/doc/pub/Splines/html/._Splines-bs022.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -321,7 +319,7 @@ And finally we can compare our solution for \( \beta \) with the analytic result
  • 31
  • 32
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs023.html b/doc/pub/Splines/html/._Splines-bs023.html index 86fb3b40b..c78611e5c 100644 --- a/doc/pub/Splines/html/._Splines-bs023.html +++ b/doc/pub/Splines/html/._Splines-bs023.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -351,7 +349,7 @@ plt.show()
  • 32
  • 33
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs024.html b/doc/pub/Splines/html/._Splines-bs024.html index 791a202d0..a3d662ae8 100644 --- a/doc/pub/Splines/html/._Splines-bs024.html +++ b/doc/pub/Splines/html/._Splines-bs024.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -325,7 +323,7 @@ sgdreg.fit(x,y.
  • 33
  • 34
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs025.html b/doc/pub/Splines/html/._Splines-bs025.html index 9eeec6c3c..7aba06154 100644 --- a/doc/pub/Splines/html/._Splines-bs025.html +++ b/doc/pub/Splines/html/._Splines-bs025.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -326,7 +324,7 @@ $$
  • 34
  • 35
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs026.html b/doc/pub/Splines/html/._Splines-bs026.html index c063a3927..07e2561f5 100644 --- a/doc/pub/Splines/html/._Splines-bs026.html +++ b/doc/pub/Splines/html/._Splines-bs026.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -352,7 +350,7 @@ plt.show()
  • 35
  • 36
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs027.html b/doc/pub/Splines/html/._Splines-bs027.html index f9afa1a42..db0592bea 100644 --- a/doc/pub/Splines/html/._Splines-bs027.html +++ b/doc/pub/Splines/html/._Splines-bs027.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -314,7 +312,7 @@ MathJax.Hub.Config({
  • 36
  • 37
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs028.html b/doc/pub/Splines/html/._Splines-bs028.html index 28bad05f5..c6aa6e8f1 100644 --- a/doc/pub/Splines/html/._Splines-bs028.html +++ b/doc/pub/Splines/html/._Splines-bs028.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -319,7 +317,7 @@ $$
  • 37
  • 38
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs029.html b/doc/pub/Splines/html/._Splines-bs029.html index a9db9ad04..25a2e5bd7 100644 --- a/doc/pub/Splines/html/._Splines-bs029.html +++ b/doc/pub/Splines/html/._Splines-bs029.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -321,7 +319,7 @@ minibatches. We denote these minibatches by \( B_k \) where
  • 38
  • 39
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs030.html b/doc/pub/Splines/html/._Splines-bs030.html index 1dd8af54e..aafe88627 100644 --- a/doc/pub/Splines/html/._Splines-bs030.html +++ b/doc/pub/Splines/html/._Splines-bs030.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -325,7 +323,7 @@ $$
  • 39
  • 40
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs031.html b/doc/pub/Splines/html/._Splines-bs031.html index 9a8783073..867aa1617 100644 --- a/doc/pub/Splines/html/._Splines-bs031.html +++ b/doc/pub/Splines/html/._Splines-bs031.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -320,7 +318,7 @@ the number of minibatches, as exemplified in the code below.
  • 40
  • 41
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs032.html b/doc/pub/Splines/html/._Splines-bs032.html index 162c35e44..7f45a860c 100644 --- a/doc/pub/Splines/html/._Splines-bs032.html +++ b/doc/pub/Splines/html/._Splines-bs032.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -333,7 +331,7 @@ all \( n \) datapoints.
  • 41
  • 42
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs033.html b/doc/pub/Splines/html/._Splines-bs033.html index f5daec5d2..3bf0d512a 100644 --- a/doc/pub/Splines/html/._Splines-bs033.html +++ b/doc/pub/Splines/html/._Splines-bs033.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -318,7 +316,7 @@ gave the lowest value.
  • 42
  • 43
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs034.html b/doc/pub/Splines/html/._Splines-bs034.html index 83fa01c74..e32504baa 100644 --- a/doc/pub/Splines/html/._Splines-bs034.html +++ b/doc/pub/Splines/html/._Splines-bs034.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -349,7 +347,7 @@ j = 0
  • 43
  • 44
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs035.html b/doc/pub/Splines/html/._Splines-bs035.html index 89f412e48..57008fecd 100644 --- a/doc/pub/Splines/html/._Splines-bs035.html +++ b/doc/pub/Splines/html/._Splines-bs035.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -290,10 +288,11 @@ MathJax.Hub.Config({ import matplotlib.pyplot as plt from sklearn.linear_model import SGDRegressor -x = 2*np.random.rand(100,1) -y = 4+3*x+np.random.randn(100,1) +m = 100 +x = 2*np.random.rand(m,1) +y = 4+3*x+np.random.randn(m,1) -xb = np.c_[np.ones((100,1)), x] +xb = np.c_[np.ones((m,1)), x] theta_linreg = np.linalg.inv(xb.T.dot(xb)).dot(xb.T).dot(y) print("Own inversion") print(theta_linreg) @@ -304,10 +303,9 @@ sgdreg.fit(x,y. theta = np.random.randn(2,1) - eta = 0.1 Niterations = 1000 -m = 100 + for iter in range(Niterations): gradients = 2.0/m*xb.T @ ((xb @ theta)-y) @@ -323,7 +321,6 @@ ypredict2 = xbnew= 50 t0, t1 = 5, 50 -m = 100 def learning_schedule(t): return t0/(t+t1) @@ -349,6 +346,9 @@ plt.ylabel(r plt.title(r'Random numbers ') plt.show() +

    +Challenge: try to write a similar code for a Logistic Regression case. +

    @@ -375,7 +375,7 @@ plt.show()

  • 44
  • 45
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs036.html b/doc/pub/Splines/html/._Splines-bs036.html index ffd5b17df..1eee01c60 100644 --- a/doc/pub/Splines/html/._Splines-bs036.html +++ b/doc/pub/Splines/html/._Splines-bs036.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,7 +276,25 @@ MathJax.Hub.Config({ -

    Logistic Regression example

    +

    Momentum based GD

    + +

    +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 +$$ +\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{2} +\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} \).

    @@ -306,7 +322,7 @@ MathJax.Hub.Config({

  • 45
  • 46
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs037.html b/doc/pub/Splines/html/._Splines-bs037.html index cd194de4b..6bc14f3ca 100644 --- a/doc/pub/Splines/html/._Splines-bs037.html +++ b/doc/pub/Splines/html/._Splines-bs037.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,25 +276,24 @@ MathJax.Hub.Config({ -

    Momentum based GD

    +

    More on momentum based approaches

    -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 +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{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{2} -\end{align} +m {d^2 \mathbf{w} \over dt^2} + \mu {d \mathbf{w} \over dt }= -\nabla_w E(\mathbf{w}). $$ -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 +We can discretize this equation in the usual way to get $$ -\Delta \boldsymbol{\theta}_{t+1} = \gamma \Delta \boldsymbol{\theta}_t -\ \eta_{t}\nabla_\theta E(\boldsymbol{\theta}_t), +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}). $$ -where we have defined \( \Delta \boldsymbol{\theta}_{t}= \boldsymbol{\theta}_t-\boldsymbol{\theta}_{t-1} \). +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. +$$

    @@ -324,7 +321,7 @@ where we have defined \( \Delta \boldsymbol{\theta}_{t}= \boldsymbol{\theta}_t-\

  • 46
  • 47
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs038.html b/doc/pub/Splines/html/._Splines-bs038.html index 3c5029f77..6b884699c 100644 --- a/doc/pub/Splines/html/._Splines-bs038.html +++ b/doc/pub/Splines/html/._Splines-bs038.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,24 +276,32 @@ MathJax.Hub.Config({ -

    More on momentum based approaches

    +

    Momentum parameter

    +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: +$$ +\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) \).

    -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 +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 $$ -m {d^2 \mathbf{w} \over dt^2} + \mu {d \mathbf{w} \over dt }= -\nabla_w E(\mathbf{w}). +\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{3} +\end{align} $$ -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. -$$ +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 \).

    @@ -323,7 +329,7 @@ $$

  • 47
  • 48
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs039.html b/doc/pub/Splines/html/._Splines-bs039.html index ea11e287f..976c5d5e4 100644 --- a/doc/pub/Splines/html/._Splines-bs039.html +++ b/doc/pub/Splines/html/._Splines-bs039.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,32 +276,27 @@ MathJax.Hub.Config({ -

    Momentum parameter

    -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: -$$ -\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) \). +

    Second moment of the gradient

    -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. +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.

    -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{3} -\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 \). +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, RMS-Prop, and ADAM.

    @@ -331,7 +324,7 @@ One of the major advantages of NAG is that it allows for the use of a larger lea

  • 48
  • 49
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs040.html b/doc/pub/Splines/html/._Splines-bs040.html index 2e3195257..4ca347247 100644 --- a/doc/pub/Splines/html/._Splines-bs040.html +++ b/doc/pub/Splines/html/._Splines-bs040.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,27 +276,20 @@ MathJax.Hub.Config({ -

    Second moment of the gradient

    +

    RMS prop

    -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. +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{4}\\ +\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} +$$ -

    -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, RMS-Prop, and ADAM. +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.

    @@ -326,7 +317,7 @@ Recently, a number of methods have been introduced that accomplish this by track

  • 49
  • 50
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs041.html b/doc/pub/Splines/html/._Splines-bs041.html index b224cab1b..7bf93b4b6 100644 --- a/doc/pub/Splines/html/._Splines-bs041.html +++ b/doc/pub/Splines/html/._Splines-bs041.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,20 +276,30 @@ MathJax.Hub.Config({ -

    RMS prop

    +

    ADAM optimizer

    -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 +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. 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) $$ \begin{align} \mathbf{g}_t &= \nabla_\theta E(\boldsymbol{\theta}) -\tag{4}\\ -\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 +\tag{5}\\ +\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 \\ +\hat{\mathbf{m}}_t&={\mathbf{m}_t \over 1-\beta_1^t} \nonumber \\ +\hat{\mathbf{s}}_t &={\mathbf{s}_t \over1-\beta_2^t} \nonumber \\ +\boldsymbol{\theta}_{t+1}&=\boldsymbol{\theta}_t - \eta_t { \hat{\mathbf{m}}_t \over \sqrt{\hat{\mathbf{s}}_t} +\epsilon}, \nonumber \\ +\tag{6} \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. +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. + +

    +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 = \hat{\mathbf{s}}_t - (\hat{\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 { \hat{m}_t \over \sqrt{\sigma_t^2 + m_t^2 }+\epsilon}. +$$

    @@ -319,7 +327,7 @@ where \( \beta \) controls the averaging time of the second moment and is typica

  • 50
  • 51
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs042.html b/doc/pub/Splines/html/._Splines-bs042.html index c4edf91e1..850c0b4c9 100644 --- a/doc/pub/Splines/html/._Splines-bs042.html +++ b/doc/pub/Splines/html/._Splines-bs042.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,30 +276,16 @@ MathJax.Hub.Config({ -

    ADAM optimizer

    +

    Practical tips

    -

    -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. 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) -$$ -\begin{align} -\mathbf{g}_t &= \nabla_\theta E(\boldsymbol{\theta}) -\tag{5}\\ -\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 \\ -\hat{\mathbf{m}}_t&={\mathbf{m}_t \over 1-\beta_1^t} \nonumber \\ -\hat{\mathbf{s}}_t &={\mathbf{s}_t \over1-\beta_2^t} \nonumber \\ -\boldsymbol{\theta}_{t+1}&=\boldsymbol{\theta}_t - \eta_t { \hat{\mathbf{m}}_t \over \sqrt{\hat{\mathbf{s}}_t} +\epsilon}, \nonumber \\ -\tag{6} -\end{align} -$$ +

      +
    • 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 energy matrix 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.
    • +
    -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. - -

    -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 = \hat{\mathbf{s}}_t - (\hat{\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 { \hat{m}_t \over \sqrt{\sigma_t^2 + m_t^2 }+\epsilon}. -$$ +Geron's text, see chapter 11, has several interesting discussions.

    @@ -329,7 +313,7 @@ $$

  • 51
  • 52
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs043.html b/doc/pub/Splines/html/._Splines-bs043.html index 36d54a437..ab92ba088 100644 --- a/doc/pub/Splines/html/._Splines-bs043.html +++ b/doc/pub/Splines/html/._Splines-bs043.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,17 +276,88 @@ MathJax.Hub.Config({ -

    Practical tips

    +

    Automatic differentiation

    + +

    +Automatic differentiation (AD), +also called algorithmic +differentiation or computational differentiation,is a set of +techniques to numerically evaluate the derivative of a function +specified by a computer program. AD exploits the fact that every +computer program, no matter how complicated, executes a sequence of +elementary arithmetic operations (addition, subtraction, +multiplication, division, etc.) and elementary functions (exp, log, +sin, cos, etc.). By applying the chain rule repeatedly to these +operations, derivatives of arbitrary order can be computed +automatically, accurately to working precision, and using at most a +small constant factor more arithmetic operations than the original +program. + +

    +Automatic differentiation is neither:

      -
    • 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 energy matrix 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.
    • +
    • Symbolic differentiation, nor
    • +
    • Numerical differentiation (the method of finite differences).
    -Geron's text, see chapter 11, has several interesting discussions. +Symbolic differentiation can lead to inefficient code and faces the +difficulty of converting a computer program into a single expression, +while numerical differentiation can introduce round-off errors in the +discretization process and cancellation +

    +Python has tools for so-called automatic differentiation. +Consider the following example +$$ +f(x) = \sin\left(2\pi x + x^2\right) +$$ + +which has the following derivative +$$ +f'(x) = \cos\left(2\pi x + x^2\right)\left(2\pi + 2x\right) +$$ + +Using autograd we have + +

    + + +

    import autograd.numpy as np
    +
    +# To do elementwise differentiation:
    +from autograd import elementwise_grad as egrad 
    +
    +# To plot:
    +import matplotlib.pyplot as plt 
    +
    +
    +def f(x):
    +    return np.sin(2*np.pi*x + x**2)
    +
    +def f_grad_analytic(x):
    +    return np.cos(2*np.pi*x + x**2)*(2*np.pi + 2*x)
    +
    +# Do the comparison:
    +x = np.linspace(0,1,1000)
    +
    +f_grad = egrad(f)
    +
    +computed = f_grad(x)
    +analytic = f_grad_analytic(x)
    +
    +plt.title('Derivative computed from Autograd compared with the analytical derivative')
    +plt.plot(x,computed,label='autograd')
    +plt.plot(x,analytic,label='analytic')
    +
    +plt.xlabel('x')
    +plt.ylabel('y')
    +plt.legend()
    +
    +plt.show()
    +
    +print("The max absolute difference is: %g"%(np.max(np.abs(computed - analytic))))
    +

    @@ -315,7 +384,7 @@ Geron's text, see chapter 11, has several interesting discussions.

  • 52
  • 53
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs044.html b/doc/pub/Splines/html/._Splines-bs044.html index e05c85d2d..46ef305e8 100644 --- a/doc/pub/Splines/html/._Splines-bs044.html +++ b/doc/pub/Splines/html/._Splines-bs044.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -276,59 +274,37 @@ MathJax.Hub.Config({

     

     

     

    - + -

    Automatic differentiation

    -Python has tools for so-called automatic differentiation. -Consider the following example -$$ -f(x) = \sin\left(2\pi x + x^2\right) -$$ +

    Using autograd

    -which has the following derivative -$$ -f'(x) = \cos\left(2\pi x + x^2\right)\left(2\pi + 2x\right) -$$ - -Using autograd we have +

    +Here we +experiment with what kind of functions Autograd is capable +of finding the gradient of. The following Python functions are just +meant to illustrate what Autograd can do, but please feel free to +experiment with other, possibly more complicated, functions as well.

    import autograd.numpy as np
    +from autograd import grad
     
    -# To do elementwise differentiation:
    -from autograd import elementwise_grad as egrad 
    +def f1(x):
    +    return x**3 + 1
     
    -# To plot:
    -import matplotlib.pyplot as plt 
    +f1_grad = grad(f1)
     
    +# Remember to send in float as argument to the computed gradient from Autograd!
    +a = 1.0
     
    -def f(x):
    -    return np.sin(2*np.pi*x + x**2)
    +# See the evaluated gradient at a using autograd:
    +print("The gradient of f1 evaluated at a = %g using autograd is: %g"%(a,f1_grad(a)))
     
    -def f_grad_analytic(x):
    -    return np.cos(2*np.pi*x + x**2)*(2*np.pi + 2*x)
    -
    -# Do the comparison:
    -x = np.linspace(0,1,1000)
    -
    -f_grad = egrad(f)
    -
    -computed = f_grad(x)
    -analytic = f_grad_analytic(x)
    -
    -plt.title('Derivative computed from Autograd compared with the analytical derivative')
    -plt.plot(x,computed,label='autograd')
    -plt.plot(x,analytic,label='analytic')
    -
    -plt.xlabel('x')
    -plt.ylabel('y')
    -plt.legend()
    -
    -plt.show()
    -
    -print("The max absolute difference is: %g"%(np.max(np.abs(computed - analytic))))
    +# Compare with the analytical derivative, that is f1'(x) = 3*x**2 
    +grad_analytical = 3*a**2
    +print("The gradient of f1 evaluated at a = %g by finding the analytic expression is: %g"%(a,grad_analytical))
     

    @@ -356,7 +332,7 @@ plt.show()

  • 53
  • 54
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs045.html b/doc/pub/Splines/html/._Splines-bs045.html index 24288e48e..fb008911a 100644 --- a/doc/pub/Splines/html/._Splines-bs045.html +++ b/doc/pub/Splines/html/._Splines-bs045.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -276,38 +274,55 @@ MathJax.Hub.Config({

     

     

     

    - + -

    Using autograd

    +

    Autograd with more complicated functions

    -Here we -experiment with what kind of functions Autograd is capable -of finding the gradient of. The following Python functions are just -meant to illustrate what Autograd can do, but please feel free to -experiment with other, possibly more complicated, functions as well. +To differentiate with respect to two (or more) arguments of a Python +function, Autograd need to know at which variable the function if +being differentiated with respect to.

    import autograd.numpy as np
     from autograd import grad
    +def f2(x1,x2):
    +    return 3*x1**3 + x2*(x1 - 5) + 1
     
    -def f1(x):
    -    return x**3 + 1
    +# By sending the argument 0, Autograd will compute the derivative w.r.t the first variable, in this case x1
    +f2_grad_x1 = grad(f2,0)
     
    -f1_grad = grad(f1)
    +# ... and differentiate w.r.t x2 by sending 1 as an additional arugment to grad
    +f2_grad_x2 = grad(f2,1)
     
    -# Remember to send in float as argument to the computed gradient from Autograd!
    -a = 1.0
    +x1 = 1.0
    +x2 = 3.0 
     
    -# See the evaluated gradient at a using autograd:
    -print("The gradient of f1 evaluated at a = %g using autograd is: %g"%(a,f1_grad(a)))
    +print("Evaluating at x1 = %g, x2 = %g"%(x1,x2))
    +print("-"*30)
     
    -# Compare with the analytical derivative, that is f1'(x) = 3*x**2 
    -grad_analytical = 3*a**2
    -print("The gradient of f1 evaluated at a = %g by finding the analytic expression is: %g"%(a,grad_analytical))
    +# Compare with the analytical derivatives:
    +
    +# Derivative of f2 w.r.t x1 is: 9*x1**2 + x2:
    +f2_grad_x1_analytical = 9*x1**2 + x2
    +
    +# Derivative of f2 w.r.t x2 is: x1 - 5:
    +f2_grad_x2_analytical = x1 - 5
    +
    +# See the evaluated derivations:
    +print("The derivative of f2 w.r.t x1: %g"%( f2_grad_x1(x1,x2) ))
    +print("The analytical derivative of f2 w.r.t x1: %g"%( f2_grad_x1(x1,x2) ))
    +
    +print()
    +
    +print("The derivative of f2 w.r.t x2: %g"%( f2_grad_x2(x1,x2) ))
    +print("The analytical derivative of f2 w.r.t x2: %g"%( f2_grad_x2(x1,x2) ))
     
    +

    +Note that the grad function will not produce the true gradient of the function. The true gradient of a function with two or more variables will produce a vector, where each element is the function differentiated w.r.t a variable. +

    @@ -334,7 +349,7 @@ grad_analytical = 54

  • 55
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs046.html b/doc/pub/Splines/html/._Splines-bs046.html index 1feb7ee8e..29ddfee0b 100644 --- a/doc/pub/Splines/html/._Splines-bs046.html +++ b/doc/pub/Splines/html/._Splines-bs046.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,52 +276,36 @@ MathJax.Hub.Config({ -

    Autograd with more complicated functions

    - -

    -To differentiate with respect to two (or more) arguments of a Python -function, Autograd need to know at which variable the function if -being differentiated with respect to. +

    More complicated functions using the elements of their arguments directly

    import autograd.numpy as np
     from autograd import grad
    -def f2(x1,x2):
    -    return 3*x1**3 + x2*(x1 - 5) + 1
    +def f3(x): # Assumes x is an array of length 5 or higher
    +    return 2*x[0] + 3*x[1] + 5*x[2] + 7*x[3] + 11*x[4]**2
     
    -# By sending the argument 0, Autograd will compute the derivative w.r.t the first variable, in this case x1
    -f2_grad_x1 = grad(f2,0)
    +f3_grad = grad(f3)
     
    -# ... and differentiate w.r.t x2 by sending 1 as an additional arugment to grad
    -f2_grad_x2 = grad(f2,1)
    +x = np.linspace(0,4,5)
     
    -x1 = 1.0
    -x2 = 3.0 
    +# Print the computed gradient:
    +print("The computed gradient of f3 is: ", f3_grad(x))
     
    -print("Evaluating at x1 = %g, x2 = %g"%(x1,x2))
    -print("-"*30)
    +# The analytical gradient is: (2, 3, 5, 7, 22*x[4])
    +f3_grad_analytical = np.array([2, 3, 5, 7, 22*x[4]])
     
    -# Compare with the analytical derivatives:
    -
    -# Derivative of f2 w.r.t x1 is: 9*x1**2 + x2:
    -f2_grad_x1_analytical = 9*x1**2 + x2
    -
    -# Derivative of f2 w.r.t x2 is: x1 - 5:
    -f2_grad_x2_analytical = x1 - 5
    -
    -# See the evaluated derivations:
    -print("The derivative of f2 w.r.t x1: %g"%( f2_grad_x1(x1,x2) ))
    -print("The analytical derivative of f2 w.r.t x1: %g"%( f2_grad_x1(x1,x2) ))
    -
    -print()
    -
    -print("The derivative of f2 w.r.t x2: %g"%( f2_grad_x2(x1,x2) ))
    -print("The analytical derivative of f2 w.r.t x2: %g"%( f2_grad_x2(x1,x2) ))
    +# Print the analytical gradient:
    +print("The analytical gradient of f3 is: ", f3_grad_analytical)
     

    -Note that the grad function will not produce the true gradient of the function. The true gradient of a function with two or more variables will produce a vector, where each element is the function differentiated w.r.t a variable. +Note that in this case, when sending an array as input argument, the +output from Autograd is another array. This is the true gradient of +the function, as opposed to the function in the previous example. By +using arrays to represent the variables, the output from Autograd +might be easier to work with, as the output is closer to what one +could expect form a gradient-evaluting function.

    @@ -351,7 +333,7 @@ Note that the grad function will not produce the true gradient of the function.

  • 55
  • 56
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs047.html b/doc/pub/Splines/html/._Splines-bs047.html index 99b2c3a7e..d313bf057 100644 --- a/doc/pub/Splines/html/._Splines-bs047.html +++ b/doc/pub/Splines/html/._Splines-bs047.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -276,39 +274,31 @@ MathJax.Hub.Config({

     

     

     

    - + -

    More complicated functions using the elements of their arguments directly

    +

    Functions using mathematical functions from Numpy

    import autograd.numpy as np
     from autograd import grad
    -def f3(x): # Assumes x is an array of length 5 or higher
    -    return 2*x[0] + 3*x[1] + 5*x[2] + 7*x[3] + 11*x[4]**2
    +def f4(x):
    +    return np.sqrt(1+x**2) + np.exp(x) + np.sin(2*np.pi*x)
     
    -f3_grad = grad(f3)
    +f4_grad = grad(f4)
     
    -x = np.linspace(0,4,5)
    +x = 2.7
     
    -# Print the computed gradient:
    -print("The computed gradient of f3 is: ", f3_grad(x))
    +# Print the computed derivative:
    +print("The computed derivative of f4 at x = %g is: %g"%(x,f4_grad(x)))
     
    -# The analytical gradient is: (2, 3, 5, 7, 22*x[4])
    -f3_grad_analytical = np.array([2, 3, 5, 7, 22*x[4]])
    +# The analytical derivative is: x/sqrt(1 + x**2) + exp(x) + cos(2*pi*x)*2*pi
    +f4_grad_analytical = x/np.sqrt(1 + x**2) + np.exp(x) + np.cos(2*np.pi*x)*2*np.pi
     
     # Print the analytical gradient:
    -print("The analytical gradient of f3 is: ", f3_grad_analytical)
    +print("The analytical gradient of f4 at x = %g is: %g"%(x,f4_grad_analytical))
     
    -

    -Note that in this case, when sending an array as input argument, the -output from Autograd is another array. This is the true gradient of -the function, as opposed to the function in the previous example. By -using arrays to represent the variables, the output from Autograd -might be easier to work with, as the output is closer to what one -could expect form a gradient-evaluting function. -

    @@ -335,7 +325,7 @@ could expect form a gradient-evaluting function.

  • 56
  • 57
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs048.html b/doc/pub/Splines/html/._Splines-bs048.html index ed5c2315c..200acd6e6 100644 --- a/doc/pub/Splines/html/._Splines-bs048.html +++ b/doc/pub/Splines/html/._Splines-bs048.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -276,30 +274,27 @@ MathJax.Hub.Config({

     

     

     

    - + -

    Functions using mathematical functions from Numpy

    +

    More autograd

    import autograd.numpy as np
     from autograd import grad
    -def f4(x):
    -    return np.sqrt(1+x**2) + np.exp(x) + np.sin(2*np.pi*x)
    +def f5(x):
    +    if x >= 0:
    +        return x**2
    +    else:
    +        return -3*x + 1
     
    -f4_grad = grad(f4)
    +f5_grad = grad(f5)
     
     x = 2.7
     
     # Print the computed derivative:
    -print("The computed derivative of f4 at x = %g is: %g"%(x,f4_grad(x)))
    -
    -# The analytical derivative is: x/sqrt(1 + x**2) + exp(x) + cos(2*pi*x)*2*pi
    -f4_grad_analytical = x/np.sqrt(1 + x**2) + np.exp(x) + np.cos(2*np.pi*x)*2*np.pi
    -
    -# Print the analytical gradient:
    -print("The analytical gradient of f4 at x = %g is: %g"%(x,f4_grad_analytical))
    +print("The computed derivative of f5 at x = %g is: %g"%(x,f5_grad(x)))
     

    @@ -327,7 +322,7 @@ f4_grad_analytical = x57

  • 58
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs049.html b/doc/pub/Splines/html/._Splines-bs049.html index 7d1768934..f4e5b8580 100644 --- a/doc/pub/Splines/html/._Splines-bs049.html +++ b/doc/pub/Splines/html/._Splines-bs049.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,25 +276,48 @@ MathJax.Hub.Config({ -

    More autograd

    +

    And with loops

    import autograd.numpy as np
     from autograd import grad
    -def f5(x):
    -    if x >= 0:
    -        return x**2
    -    else:
    -        return -3*x + 1
    +def f6_for(x):
    +    val = 0
    +    for i in range(10):
    +        val = val + x**i
    +    return val
     
    -f5_grad = grad(f5)
    +def f6_while(x):
    +    val = 0
    +    i = 0
    +    while i < 10:
    +        val = val + x**i
    +        i = i + 1
    +    return val
     
    -x = 2.7
    +f6_for_grad = grad(f6_for)
    +f6_while_grad = grad(f6_while)
     
    -# Print the computed derivative:
    -print("The computed derivative of f5 at x = %g is: %g"%(x,f5_grad(x)))
    +x = 0.5
    +
    +# Print the computed derivaties of f6_for and f6_while
    +print("The computed derivative of f6_for at x = %g is: %g"%(x,f6_for_grad(x)))
    +print("The computed derivative of f6_while at x = %g is: %g"%(x,f6_while_grad(x)))
    +
    +

    + + +

    import autograd.numpy as np
    +from autograd import grad
    +# Both of the functions are implementation of the sum: sum(x**i) for i = 0, ..., 9
    +# The analytical derivative is: sum(i*x**(i-1)) 
    +f6_grad_analytical = 0
    +for i in range(10):
    +    f6_grad_analytical += i*x**(i-1)
    +
    +print("The analytical derivative of f6 at x = %g is: %g"%(x,f6_grad_analytical))
     

    @@ -324,7 +345,7 @@ x = 2.7

  • 58
  • 59
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs050.html b/doc/pub/Splines/html/._Splines-bs050.html index fb2370bdc..71ca65d04 100644 --- a/doc/pub/Splines/html/._Splines-bs050.html +++ b/doc/pub/Splines/html/._Splines-bs050.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,49 +276,41 @@ MathJax.Hub.Config({ -

    And with loops

    - +

    Using recursion

    import autograd.numpy as np
     from autograd import grad
    -def f6_for(x):
    -    val = 0
    -    for i in range(10):
    -        val = val + x**i
    -    return val
     
    -def f6_while(x):
    -    val = 0
    -    i = 0
    -    while i < 10:
    -        val = val + x**i
    -        i = i + 1
    -    return val
    +def f7(n): # Assume that n is an integer
    +    if n == 1 or n == 0:
    +        return 1
    +    else:
    +        return n*f7(n-1)
     
    -f6_for_grad = grad(f6_for)
    -f6_while_grad = grad(f6_while)
    +f7_grad = grad(f7)
     
    -x = 0.5
    +n = 2.0
     
    -# Print the computed derivaties of f6_for and f6_while
    -print("The computed derivative of f6_for at x = %g is: %g"%(x,f6_for_grad(x)))
    -print("The computed derivative of f6_while at x = %g is: %g"%(x,f6_while_grad(x)))
    +print("The computed derivative of f7 at n = %d is: %g"%(n,f7_grad(n)))
    +
    +# The function f7 is an implementation of the factorial of n.
    +# By using the product rule, one can find that the derivative is:
    +
    +f7_grad_analytical = 0
    +for i in range(int(n)-1):
    +    tmp = 1
    +    for k in range(int(n)-1):
    +        if k != i:
    +            tmp *= (n - k)
    +    f7_grad_analytical += tmp
    +
    +print("The analytical derivative of f7 at n = %d is: %g"%(n,f7_grad_analytical))
     

    +Note that if n is equal to zero or one, Autograd will give an error message. This message appears when the output is independent on input. - -

    import autograd.numpy as np
    -from autograd import grad
    -# Both of the functions are implementation of the sum: sum(x**i) for i = 0, ..., 9
    -# The analytical derivative is: sum(i*x**(i-1)) 
    -f6_grad_analytical = 0
    -for i in range(10):
    -    f6_grad_analytical += i*x**(i-1)
    -
    -print("The analytical derivative of f6 at x = %g is: %g"%(x,f6_grad_analytical))
    -

    @@ -347,7 +337,7 @@ f6_grad_analytical = 59

  • 60
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs051.html b/doc/pub/Splines/html/._Splines-bs051.html index cf4593da1..8b13edc7e 100644 --- a/doc/pub/Splines/html/._Splines-bs051.html +++ b/doc/pub/Splines/html/._Splines-bs051.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,40 +276,28 @@ MathJax.Hub.Config({ -

    Using recursion

    +

    Unsupported functions

    +Autograd supports many features. However, there are some functions that is not supported (yet) by Autograd. + +

    +Assigning a value to the variable being differentiated with respect to

    import autograd.numpy as np
     from autograd import grad
    +def f8(x): # Assume x is an array
    +    x[2] = 3
    +    return x*2
     
    -def f7(n): # Assume that n is an integer
    -    if n == 1 or n == 0:
    -        return 1
    -    else:
    -        return n*f7(n-1)
    +f8_grad = grad(f8)
     
    -f7_grad = grad(f7)
    +x = 8.4
     
    -n = 2.0
    -
    -print("The computed derivative of f7 at n = %d is: %g"%(n,f7_grad(n)))
    -
    -# The function f7 is an implementation of the factorial of n.
    -# By using the product rule, one can find that the derivative is:
    -
    -f7_grad_analytical = 0
    -for i in range(int(n)-1):
    -    tmp = 1
    -    for k in range(int(n)-1):
    -        if k != i:
    -            tmp *= (n - k)
    -    f7_grad_analytical += tmp
    -
    -print("The analytical derivative of f7 at n = %d is: %g"%(n,f7_grad_analytical))
    +print("The derivative of f8 is:",f8_grad(x))
     

    -Note that if n is equal to zero or one, Autograd will give an error message. This message appears when the output is independent on input. +Here, Autograd tells us that an 'ArrayBox' does not support item assignment. The item assignment is done when the program tries to assign x[2] to the value 3. However, Autograd has implemented the computation of the derivative such that this assignment is not possible.

    @@ -339,7 +325,7 @@ Note that if n is equal to zero or one, Autograd will give an error message. Thi

  • 60
  • 61
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs052.html b/doc/pub/Splines/html/._Splines-bs052.html index 67dd11ef4..7fbce1fc1 100644 --- a/doc/pub/Splines/html/._Splines-bs052.html +++ b/doc/pub/Splines/html/._Splines-bs052.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,29 +276,45 @@ MathJax.Hub.Config({ -

    Unsupported functions

    -Autograd supports many features. However, there are some functions that is not supported (yet) by Autograd. - -

    -Assigning a value to the variable being differentiated with respect to +

    The syntax a.dot(b) when finding the dot product

    import autograd.numpy as np
     from autograd import grad
    -def f8(x): # Assume x is an array
    -    x[2] = 3
    -    return x*2
    +def f9(a): # Assume a is an array with 2 elements
    +    b = np.array([1.0,2.0])
    +    return a.dot(b)
     
    -f8_grad = grad(f8)
    +f9_grad = grad(f9)
     
    -x = 8.4
    +x = np.array([1.0,0.0])
     
    -print("The derivative of f8 is:",f8_grad(x))
    +print("The derivative of f9 is:",f9_grad(x))
     

    -Here, Autograd tells us that an 'ArrayBox' does not support item assignment. The item assignment is done when the program tries to assign x[2] to the value 3. However, Autograd has implemented the computation of the derivative such that this assignment is not possible. +Here we are told that the 'dot' function does not belong to Autograd's +version of a Numpy array. To overcome this, an alternative syntax +which also computed the dot product can be used: +

    + + +

    import autograd.numpy as np
    +from autograd import grad
    +def f9_alternative(x): # Assume a is an array with 2 elements
    +    b = np.array([1.0,2.0])
    +    return np.dot(x,b) # The same as x_1*b_1 + x_2*b_2
    +
    +f9_alternative_grad = grad(f9_alternative)
    +
    +x = np.array([3.0,0.0])
    +
    +print("The gradient of f9 is:",f9_alternative_grad(x))
    +
    +# The analytical gradient of the dot product of vectors x and b with two elements (x_1,x_2) and (b_1, b_2) respectively
    +# w.r.t x is (b_1, b_2).
    +

    @@ -327,7 +341,7 @@ Here, Autograd tells us that an 'ArrayBox' does not support item assignment. The

  • 61
  • 62
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs053.html b/doc/pub/Splines/html/._Splines-bs053.html index bb511e320..2c2e2608f 100644 --- a/doc/pub/Splines/html/._Splines-bs053.html +++ b/doc/pub/Splines/html/._Splines-bs053.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,44 +276,15 @@ MathJax.Hub.Config({ -

    The syntax a.dot(b) when finding the dot product

    +

    Recommended to avoid

    +The documentation recommends to avoid inplace operations such as

    -

    import autograd.numpy as np
    -from autograd import grad
    -def f9(a): # Assume a is an array with 2 elements
    -    b = np.array([1.0,2.0])
    -    return a.dot(b)
    -
    -f9_grad = grad(f9)
    -
    -x = np.array([1.0,0.0])
    -
    -print("The derivative of f9 is:",f9_grad(x))
    -
    -

    -Here we are told that the 'dot' function does not belong to Autograd's -version of a Numpy array. To overcome this, an alternative syntax -which also computed the dot product can be used: - -

    - - -

    import autograd.numpy as np
    -from autograd import grad
    -def f9_alternative(x): # Assume a is an array with 2 elements
    -    b = np.array([1.0,2.0])
    -    return np.dot(x,b) # The same as x_1*b_1 + x_2*b_2
    -
    -f9_alternative_grad = grad(f9_alternative)
    -
    -x = np.array([3.0,0.0])
    -
    -print("The gradient of f9 is:",f9_alternative_grad(x))
    -
    -# The analytical gradient of the dot product of vectors x and b with two elements (x_1,x_2) and (b_1, b_2) respectively
    -# w.r.t x is (b_1, b_2).
    +
    a += b
    +a -= b
    +a*= b
    +a /=b
     

    @@ -343,7 +312,7 @@ x = np.a

  • 62
  • 63
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs054.html b/doc/pub/Splines/html/._Splines-bs054.html index 16e3a7169..743d74421 100644 --- a/doc/pub/Splines/html/._Splines-bs054.html +++ b/doc/pub/Splines/html/._Splines-bs054.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,16 +276,39 @@ MathJax.Hub.Config({ -

    Recommended to avoid

    -The documentation recommends to avoid inplace operations such as -

    +

    Standard steepest descent

    + +

    +Before we proceed, we would like to discuss the approach called the +standard Steepest descent, which again leads to us having to be able +to compute a matrix. It belongs to the class of Conjugate Gradient methods (CG). + +

    +The success of the CG method +for finding solutions of non-linear problems is based on the theory +of conjugate gradients for linear systems of equations. It belongs to +the class of iterative methods for solving problems from linear +algebra of the type +$$ +\begin{equation*} +\hat{A}\hat{x} = \hat{b}. +\end{equation*} +$$ + +

    +In the iterative process we end up with a problem like + +$$ +\begin{equation*} + \hat{r}= \hat{b}-\hat{A}\hat{x}, +\end{equation*} +$$ + +where \( \hat{r} \) is the so-called residual or error in the iterative process. + +

    +When we have found the exact solution, \( \hat{r}=0 \). - -

    a += b
    -a -= b
    -a*= b
    -a /=b
    -

    @@ -314,7 +335,7 @@ a /=b

  • 63
  • 64
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs055.html b/doc/pub/Splines/html/._Splines-bs055.html index c4e8c4773..363349390 100644 --- a/doc/pub/Splines/html/._Splines-bs055.html +++ b/doc/pub/Splines/html/._Splines-bs055.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,38 +276,19 @@ MathJax.Hub.Config({ -

    Standard steepest descent

    +

    Gradient method

    -Before we proceed, we would like to discuss the approach called the -standard Steepest descent, which again leads to us having to be able -to compute a matrix. It belongs to the class of Conjugate Gradient methods (CG). - -

    -The success of the CG method -for finding solutions of non-linear problems is based on the theory -of conjugate gradients for linear systems of equations. It belongs to -the class of iterative methods for solving problems from linear -algebra of the type -$$ -\begin{equation*} -\hat{A}\hat{x} = \hat{b}. -\end{equation*} -$$ - -

    -In the iterative process we end up with a problem like - +The residual is zero when we reach the minimum of the quadratic equation $$ \begin{equation*} - \hat{r}= \hat{b}-\hat{A}\hat{x}, + P(\hat{x})=\frac{1}{2}\hat{x}^T\hat{A}\hat{x} - \hat{x}^T\hat{b}, \end{equation*} $$ -where \( \hat{r} \) is the so-called residual or error in the iterative process. -

    -When we have found the exact solution, \( \hat{r}=0 \). +with the constraint that the matrix \( \hat{A} \) is positive definite and +symmetric. This defines also the Hessian and we want it to be positive definite.

    @@ -337,7 +316,7 @@ When we have found the exact solution, \( \hat{r}=0 \).

  • 64
  • 65
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs056.html b/doc/pub/Splines/html/._Splines-bs056.html index e34fb4660..2db023e2c 100644 --- a/doc/pub/Splines/html/._Splines-bs056.html +++ b/doc/pub/Splines/html/._Splines-bs056.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,19 +276,25 @@ MathJax.Hub.Config({ -

    Gradient method

    +

    Steepest descent method

    -The residual is zero when we reach the minimum of the quadratic equation +We denote the initial guess for \( \hat{x} \) as \( \hat{x}_0 \). +We can assume without loss of generality that $$ \begin{equation*} - P(\hat{x})=\frac{1}{2}\hat{x}^T\hat{A}\hat{x} - \hat{x}^T\hat{b}, +\hat{x}_0=0, \end{equation*} $$ -

    -with the constraint that the matrix \( \hat{A} \) is positive definite and -symmetric. This defines also the Hessian and we want it to be positive definite. +or consider the system +$$ +\begin{equation*} +\hat{A}\hat{z} = \hat{b}-\hat{A}\hat{x}_0, +\end{equation*} +$$ + +instead.

    @@ -318,7 +322,7 @@ symmetric. This defines also the Hessian and we want it to be positive definit

  • 65
  • 66
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs057.html b/doc/pub/Splines/html/._Splines-bs057.html index f0e4a902c..ceac6eede 100644 --- a/doc/pub/Splines/html/._Splines-bs057.html +++ b/doc/pub/Splines/html/._Splines-bs057.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -279,24 +277,32 @@ MathJax.Hub.Config({

    Steepest descent method

    +
    +
    +

    +One can show that the solution \( \hat{x} \) is also the unique minimizer of the quadratic form +$$ +\begin{equation*} + f(\hat{x}) = \frac{1}{2}\hat{x}^T\hat{A}\hat{x} - \hat{x}^T \hat{x} , \quad \hat{x}\in\mathbf{R}^n. +\end{equation*} +$$ + +This suggests taking the first basis vector \( \hat{r}_1 \) (see below for definition) +to be the gradient of \( f \) at \( \hat{x}=\hat{x}_0 \), +which equals +$$ +\begin{equation*} +\hat{A}\hat{x}_0-\hat{b}, +\end{equation*} +$$ + +and +\( \hat{x}_0=0 \) it is equal \( -\hat{b} \).

    -We denote the initial guess for \( \hat{x} \) as \( \hat{x}_0 \). -We can assume without loss of generality that -$$ -\begin{equation*} -\hat{x}_0=0, -\end{equation*} -$$ +

    +
    -or consider the system -$$ -\begin{equation*} -\hat{A}\hat{z} = \hat{b}-\hat{A}\hat{x}_0, -\end{equation*} -$$ - -instead.

    @@ -324,7 +330,7 @@ instead.

  • 66
  • 67
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs058.html b/doc/pub/Splines/html/._Splines-bs058.html index 4fe730b84..45600fecf 100644 --- a/doc/pub/Splines/html/._Splines-bs058.html +++ b/doc/pub/Splines/html/._Splines-bs058.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,30 +276,43 @@ MathJax.Hub.Config({ -

    Steepest descent method

    +

    Final expressions

    -One can show that the solution \( \hat{x} \) is also the unique minimizer of the quadratic form +We can compute the residual iteratively as $$ \begin{equation*} - f(\hat{x}) = \frac{1}{2}\hat{x}^T\hat{A}\hat{x} - \hat{x}^T \hat{x} , \quad \hat{x}\in\mathbf{R}^n. -\end{equation*} +\hat{r}_{k+1}=\hat{b}-\hat{A}\hat{x}_{k+1}, + \end{equation*} $$ -This suggests taking the first basis vector \( \hat{r}_1 \) (see below for definition) -to be the gradient of \( f \) at \( \hat{x}=\hat{x}_0 \), which equals $$ \begin{equation*} -\hat{A}\hat{x}_0-\hat{b}, -\end{equation*} +\hat{b}-\hat{A}(\hat{x}_k+\alpha_k\hat{r}_k), + \end{equation*} $$ -and -\( \hat{x}_0=0 \) it is equal \( -\hat{b} \). +or +$$ +\begin{equation*} +(\hat{b}-\hat{A}\hat{x}_k)-\alpha_k\hat{A}\hat{r}_k, + \end{equation*} +$$ -

    +which gives + +$$ +\alpha_k = \frac{\hat{r}_k^T\hat{r}_k}{\hat{r}_k^T\hat{A}\hat{r}_k} +$$ + +leading to the iterative scheme +$$ +\begin{equation*} +\hat{x}_{k+1}=\hat{x}_k-\alpha_k\hat{r}_{k}, + \end{equation*} +$$

    @@ -332,7 +343,7 @@ and
  • 67
  • 68
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs059.html b/doc/pub/Splines/html/._Splines-bs059.html index dfb522752..fe792987e 100644 --- a/doc/pub/Splines/html/._Splines-bs059.html +++ b/doc/pub/Splines/html/._Splines-bs059.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,46 +276,7 @@ MathJax.Hub.Config({ -

    Final expressions

    -
    -
    -

    -We can compute the residual iteratively as -$$ -\begin{equation*} -\hat{r}_{k+1}=\hat{b}-\hat{A}\hat{x}_{k+1}, - \end{equation*} -$$ - -which equals -$$ -\begin{equation*} -\hat{b}-\hat{A}(\hat{x}_k+\alpha_k\hat{r}_k), - \end{equation*} -$$ - -or -$$ -\begin{equation*} -(\hat{b}-\hat{A}\hat{x}_k)-\alpha_k\hat{A}\hat{r}_k, - \end{equation*} -$$ - -which gives - -$$ -\alpha_k = \frac{\hat{r}_k^T\hat{r}_k}{\hat{r}_k^T\hat{A}\hat{r}_k} -$$ - -leading to the iterative scheme -$$ -\begin{equation*} -\hat{x}_{k+1}=\hat{x}_k-\alpha_k\hat{r}_{k}, - \end{equation*} -$$ -

    -
    - +

    Code examples for steepest descent

    @@ -345,7 +304,7 @@ $$

  • 68
  • 69
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs060.html b/doc/pub/Splines/html/._Splines-bs060.html index bd1f2d55c..010654b6f 100644 --- a/doc/pub/Splines/html/._Splines-bs060.html +++ b/doc/pub/Splines/html/._Splines-bs060.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,7 +276,43 @@ MathJax.Hub.Config({ -

    Code examples for steepest descent

    +

    Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come

    +
    +
    +

    +

    + + +

    #include <cmath>
    +#include <iostream>
    +#include <fstream>
    +#include <iomanip>
    +#include "vectormatrixclass.h"
    +using namespace  std;
    +//   Main function begins here
    +int main(int  argc, char * argv[]){
    +  int dim = 2;
    +  Vector x(dim),xsd(dim), b(dim),x0(dim);
    +  Matrix A(dim,dim);
    +
    +  // Set our initial guess
    +  x0(0) = x0(1) = 0;
    +  // Set the matrix
    +  A(0,0) =  3;    A(1,0) =  2;   A(0,1) =  2;   A(1,1) =  6;
    +  b(0) = 2; b(1) = -8;
    +  cout << "The Matrix A that we are using: " << endl;
    +  A.Print();
    +  cout << endl;
    +  xsd = SteepestDescent(A,b,x0);
    +  cout << "The approximate solution using Steepest Descent is: " << endl;
    +  xsd.Print();
    +  cout << endl;
    +}
    +
    +

    +

    +
    +

    @@ -306,7 +340,7 @@ MathJax.Hub.Config({

  • 69
  • 70
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs061.html b/doc/pub/Splines/html/._Splines-bs061.html index eb08387ad..2a8412166 100644 --- a/doc/pub/Splines/html/._Splines-bs061.html +++ b/doc/pub/Splines/html/._Splines-bs061.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,37 +276,33 @@ MathJax.Hub.Config({ -

    Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come

    +

    The routine for the steepest descent method

    -

    #include <cmath>
    -#include <iostream>
    -#include <fstream>
    -#include <iomanip>
    -#include "vectormatrixclass.h"
    -using namespace  std;
    -//   Main function begins here
    -int main(int  argc, char * argv[]){
    -  int dim = 2;
    -  Vector x(dim),xsd(dim), b(dim),x0(dim);
    -  Matrix A(dim,dim);
    -
    -  // Set our initial guess
    -  x0(0) = x0(1) = 0;
    -  // Set the matrix
    -  A(0,0) =  3;    A(1,0) =  2;   A(0,1) =  2;   A(1,1) =  6;
    -  b(0) = 2; b(1) = -8;
    -  cout << "The Matrix A that we are using: " << endl;
    -  A.Print();
    -  cout << endl;
    -  xsd = SteepestDescent(A,b,x0);
    -  cout << "The approximate solution using Steepest Descent is: " << endl;
    -  xsd.Print();
    -  cout << endl;
    +
    Vector SteepestDescent(Matrix A, Vector b, Vector x0){
    +  int IterMax, i;
    +  int dim = x0.Dimension();
    +  const double tolerance = 1.0e-14;
    +  Vector x(dim),f(dim),z(dim);
    +  double c,alpha,d;
    +  IterMax = 30;
    +  x = x0;
    +  r = A*x-b;
    +  i = 0;
    +  while (i <= IterMax){
    +    z = A*r;
    +    c = dot(r,r);
    +    alpha = c/dot(r,z);
    +    x = x - alpha*r;
    +    r =  A*x-b;
    +    if(sqrt(dot(r,r)) < tolerance) break;
    +    i++;
    +  }
    +  return x;
     }
     

    @@ -342,7 +336,7 @@ MathJax.Hub.Config({

  • 70
  • 71
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs062.html b/doc/pub/Splines/html/._Splines-bs062.html index 33d10a4d0..608864f73 100644 --- a/doc/pub/Splines/html/._Splines-bs062.html +++ b/doc/pub/Splines/html/._Splines-bs062.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,40 +276,72 @@ MathJax.Hub.Config({ -

    The routine for the steepest descent method

    -
    -
    -

    +

    Steepest descent example

    +

    - -

    Vector SteepestDescent(Matrix A, Vector b, Vector x0){
    -  int IterMax, i;
    -  int dim = x0.Dimension();
    -  const double tolerance = 1.0e-14;
    -  Vector x(dim),f(dim),z(dim);
    -  double c,alpha,d;
    -  IterMax = 30;
    -  x = x0;
    -  r = A*x-b;
    -  i = 0;
    -  while (i <= IterMax){
    -    z = A*r;
    -    c = dot(r,r);
    -    alpha = c/dot(r,z);
    -    x = x - alpha*r;
    -    r =  A*x-b;
    -    if(sqrt(dot(r,r)) < tolerance) break;
    -    i++;
    -  }
    -  return x;
    -}
    +
    +
    import numpy as np
    +import numpy.linalg as la
    +
    +import scipy.optimize as sopt
    +
    +import matplotlib.pyplot as pt
    +from mpl_toolkits.mplot3d import axes3d
    +
    +def f(x):
    +    return 0.5*x[0]**2 + 2.5*x[1]**2
    +
    +def df(x):
    +    return np.array([x[0], 5*x[1]])
    +
    +fig = pt.figure()
    +ax = fig.gca(projection="3d")
    +
    +xmesh, ymesh = np.mgrid[-2:2:50j,-2:2:50j]
    +fmesh = f(np.array([xmesh, ymesh]))
    +ax.plot_surface(xmesh, ymesh, fmesh)
     

    -

    -
    +And then as countor plot +

    + +

    pt.axis("equal")
    +pt.contour(xmesh, ymesh, fmesh)
    +guesses = [np.array([2, 2./5])]
    +
    +

    +Find guesses +

    + +

    x = guesses[-1]
    +s = -df(x)
    +
    +

    +Run it! +

    + + +

    def f1d(alpha):
    +    return f(x + alpha*s)
    +
    +alpha_opt = sopt.golden(f1d)
    +next_guess = x + alpha_opt * s
    +guesses.append(next_guess)
    +print(next_guess)
    +
    +

    +What happened? +

    + + +

    pt.axis("equal")
    +pt.contour(xmesh, ymesh, fmesh, 50)
    +it_array = np.array(guesses)
    +pt.plot(it_array.T[0], it_array.T[1], "x-")
    +

    @@ -338,7 +368,7 @@ MathJax.Hub.Config({

  • 71
  • 72
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs063.html b/doc/pub/Splines/html/._Splines-bs063.html index 1dc36d224..31a94d67c 100644 --- a/doc/pub/Splines/html/._Splines-bs063.html +++ b/doc/pub/Splines/html/._Splines-bs063.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,72 +276,34 @@ MathJax.Hub.Config({ -

    Steepest descent example

    +

    Conjugate gradient method

    +
    +
    +

    +In the CG method we define so-called conjugate directions and two vectors +\( \hat{s} \) and \( \hat{t} \) +are said to be +conjugate if +$$ +\begin{equation*} +\hat{s}^T\hat{A}\hat{t}= 0. +\end{equation*} +$$ -

    +The philosophy of the CG method is to perform searches in various conjugate directions +of our vectors \( \hat{x}_i \) obeying the above criterion, namely +$$ +\begin{equation*} +\hat{x}_i^T\hat{A}\hat{x}_j= 0. +\end{equation*} +$$ - -

    import numpy as np
    -import numpy.linalg as la
    +Two vectors are conjugate if they are orthogonal with respect to 
    +this inner product. Being conjugate is a symmetric relation: if \( \hat{s} \) is conjugate to \( \hat{t} \), then \( \hat{t} \) is conjugate to \( \hat{s} \).
    +
    +
    -import scipy.optimize as sopt -import matplotlib.pyplot as pt -from mpl_toolkits.mplot3d import axes3d - -def f(x): - return 0.5*x[0]**2 + 2.5*x[1]**2 - -def df(x): - return np.array([x[0], 5*x[1]]) - -fig = pt.figure() -ax = fig.gca(projection="3d") - -xmesh, ymesh = np.mgrid[-2:2:50j,-2:2:50j] -fmesh = f(np.array([xmesh, ymesh])) -ax.plot_surface(xmesh, ymesh, fmesh) -
    -

    -And then as countor plot -

    - - -

    pt.axis("equal")
    -pt.contour(xmesh, ymesh, fmesh)
    -guesses = [np.array([2, 2./5])]
    -
    -

    -Find guesses -

    - - -

    x = guesses[-1]
    -s = -df(x)
    -
    -

    -Run it! -

    - - -

    def f1d(alpha):
    -    return f(x + alpha*s)
    -
    -alpha_opt = sopt.golden(f1d)
    -next_guess = x + alpha_opt * s
    -guesses.append(next_guess)
    -print(next_guess)
    -
    -

    -What happened? -

    - - -

    pt.axis("equal")
    -pt.contour(xmesh, ymesh, fmesh, 50)
    -it_array = np.array(guesses)
    -pt.plot(it_array.T[0], it_array.T[1], "x-")
    -

    @@ -369,8 +329,6 @@ pt.plot(it_array71

  • 72
  • 73
  • -
  • ...
  • -
  • 74
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs064.html b/doc/pub/Splines/html/._Splines-bs064.html index 9692081c9..ff6aedbf2 100644 --- a/doc/pub/Splines/html/._Splines-bs064.html +++ b/doc/pub/Splines/html/._Splines-bs064.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -282,26 +280,14 @@ MathJax.Hub.Config({

    -In the CG method we define so-called conjugate directions and two vectors -\( \hat{s} \) and \( \hat{t} \) -are said to be -conjugate if +An example is given by the eigenvectors of the matrix $$ \begin{equation*} -\hat{s}^T\hat{A}\hat{t}= 0. +\hat{v}_i^T\hat{A}\hat{v}_j= \lambda\hat{v}_i^T\hat{v}_j, \end{equation*} $$ -The philosophy of the CG method is to perform searches in various conjugate directions -of our vectors \( \hat{x}_i \) obeying the above criterion, namely -$$ -\begin{equation*} -\hat{x}_i^T\hat{A}\hat{x}_j= 0. -\end{equation*} -$$ - -Two vectors are conjugate if they are orthogonal with respect to -this inner product. Being conjugate is a symmetric relation: if \( \hat{s} \) is conjugate to \( \hat{t} \), then \( \hat{t} \) is conjugate to \( \hat{s} \). +which is zero unless \( i=j \).

    @@ -330,7 +316,6 @@ this inner product. Being conjugate is a symmetric relation: if \( \hat{s} \) is
  • 71
  • 72
  • 73
  • -
  • 74
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs065.html b/doc/pub/Splines/html/._Splines-bs065.html index 8f85ee7ba..d9f813135 100644 --- a/doc/pub/Splines/html/._Splines-bs065.html +++ b/doc/pub/Splines/html/._Splines-bs065.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -282,14 +280,23 @@ MathJax.Hub.Config({

    -An example is given by the eigenvectors of the matrix +Assume now that we have a symmetric positive-definite matrix \( \hat{A} \) of size +\( n\times n \). At each iteration \( i+1 \) we obtain the conjugate direction of a vector $$ \begin{equation*} -\hat{v}_i^T\hat{A}\hat{v}_j= \lambda\hat{v}_i^T\hat{v}_j, +\hat{x}_{i+1}=\hat{x}_{i}+\alpha_i\hat{p}_{i}. \end{equation*} $$ -which is zero unless \( i=j \). +We assume that \( \hat{p}_{i} \) is a sequence of \( n \) mutually conjugate directions. +Then the \( \hat{p}_{i} \) form a basis of \( R^n \) and we can expand the solution +$ \hat{A}\hat{x} = \hat{b}$ in this basis, namely + +$$ +\begin{equation*} + \hat{x} = \sum^{n}_{i=1} \alpha_i \hat{p}_i. +\end{equation*} +$$

    @@ -317,7 +324,6 @@ which is zero unless \( i=j \).
  • 71
  • 72
  • 73
  • -
  • 74
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs066.html b/doc/pub/Splines/html/._Splines-bs066.html index eea9e0eef..62ec4a57a 100644 --- a/doc/pub/Splines/html/._Splines-bs066.html +++ b/doc/pub/Splines/html/._Splines-bs066.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -282,21 +280,26 @@ MathJax.Hub.Config({

    -Assume now that we have a symmetric positive-definite matrix \( \hat{A} \) of size -\( n\times n \). At each iteration \( i+1 \) we obtain the conjugate direction of a vector +The coefficients are given by $$ \begin{equation*} -\hat{x}_{i+1}=\hat{x}_{i}+\alpha_i\hat{p}_{i}. + \mathbf{A}\mathbf{x} = \sum^{n}_{i=1} \alpha_i \mathbf{A} \mathbf{p}_i = \mathbf{b}. \end{equation*} $$ -We assume that \( \hat{p}_{i} \) is a sequence of \( n \) mutually conjugate directions. -Then the \( \hat{p}_{i} \) form a basis of \( R^n \) and we can expand the solution -$ \hat{A}\hat{x} = \hat{b}$ in this basis, namely +Multiplying with \( \hat{p}_k^T \) from the left gives $$ \begin{equation*} - \hat{x} = \sum^{n}_{i=1} \alpha_i \hat{p}_i. + \hat{p}_k^T \hat{A}\hat{x} = \sum^{n}_{i=1} \alpha_i\hat{p}_k^T \hat{A}\hat{p}_i= \hat{p}_k^T \hat{b}, +\end{equation*} +$$ + +and we can define the coefficients \( \alpha_k \) as + +$$ +\begin{equation*} + \alpha_k = \frac{\hat{p}_k^T \hat{b}}{\hat{p}_k^T \hat{A} \hat{p}_k} \end{equation*} $$

    @@ -325,7 +328,6 @@ $$
  • 71
  • 72
  • 73
  • -
  • 74
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs067.html b/doc/pub/Splines/html/._Splines-bs067.html index c36521188..2587cd3bf 100644 --- a/doc/pub/Splines/html/._Splines-bs067.html +++ b/doc/pub/Splines/html/._Splines-bs067.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,32 +276,36 @@ MathJax.Hub.Config({ -

    Conjugate gradient method

    +

    Conjugate gradient method and iterations

    -The coefficients are given by + +

    +If we choose the conjugate vectors \( \hat{p}_k \) carefully, +then we may not need all of them to obtain a good approximation to the solution +\( \hat{x} \). +We want to regard the conjugate gradient method as an iterative method. +This will us to solve systems where \( n \) is so large that the direct +method would take too much time. + +

    +We denote the initial guess for \( \hat{x} \) as \( \hat{x}_0 \). +We can assume without loss of generality that $$ \begin{equation*} - \mathbf{A}\mathbf{x} = \sum^{n}_{i=1} \alpha_i \mathbf{A} \mathbf{p}_i = \mathbf{b}. +\hat{x}_0=0, \end{equation*} $$ -Multiplying with \( \hat{p}_k^T \) from the left gives - +or consider the system $$ \begin{equation*} - \hat{p}_k^T \hat{A}\hat{x} = \sum^{n}_{i=1} \alpha_i\hat{p}_k^T \hat{A}\hat{p}_i= \hat{p}_k^T \hat{b}, +\hat{A}\hat{z} = \hat{b}-\hat{A}\hat{x}_0, \end{equation*} $$ -and we can define the coefficients \( \alpha_k \) as - -$$ -\begin{equation*} - \alpha_k = \frac{\hat{p}_k^T \hat{b}}{\hat{p}_k^T \hat{A} \hat{p}_k} -\end{equation*} -$$ +instead.

    @@ -329,7 +331,6 @@ $$
  • 71
  • 72
  • 73
  • -
  • 74
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs068.html b/doc/pub/Splines/html/._Splines-bs068.html index 2fe456e20..799c30daa 100644 --- a/doc/pub/Splines/html/._Splines-bs068.html +++ b/doc/pub/Splines/html/._Splines-bs068.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,36 +276,30 @@ MathJax.Hub.Config({ -

    Conjugate gradient method and iterations

    +

    Conjugate gradient method

    - -

    -If we choose the conjugate vectors \( \hat{p}_k \) carefully, -then we may not need all of them to obtain a good approximation to the solution -\( \hat{x} \). -We want to regard the conjugate gradient method as an iterative method. -This will us to solve systems where \( n \) is so large that the direct -method would take too much time. - -

    -We denote the initial guess for \( \hat{x} \) as \( \hat{x}_0 \). -We can assume without loss of generality that +One can show that the solution \( \hat{x} \) is also the unique minimizer of the quadratic form $$ \begin{equation*} -\hat{x}_0=0, + f(\hat{x}) = \frac{1}{2}\hat{x}^T\hat{A}\hat{x} - \hat{x}^T \hat{x} , \quad \hat{x}\in\mathbf{R}^n. \end{equation*} $$ -or consider the system +This suggests taking the first basis vector \( \hat{p}_1 \) +to be the gradient of \( f \) at \( \hat{x}=\hat{x}_0 \), +which equals $$ \begin{equation*} -\hat{A}\hat{z} = \hat{b}-\hat{A}\hat{x}_0, +\hat{A}\hat{x}_0-\hat{b}, \end{equation*} $$ -instead. +and +\( \hat{x}_0=0 \) it is equal \( -\hat{b} \). +The other vectors in the basis will be conjugate to the gradient, +hence the name conjugate gradient method.

    @@ -332,7 +324,6 @@ instead.
  • 71
  • 72
  • 73
  • -
  • 74
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs069.html b/doc/pub/Splines/html/._Splines-bs069.html index 4fa0bb0ab..429fdfe27 100644 --- a/doc/pub/Splines/html/._Splines-bs069.html +++ b/doc/pub/Splines/html/._Splines-bs069.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -282,26 +280,25 @@ MathJax.Hub.Config({

    -One can show that the solution \( \hat{x} \) is also the unique minimizer of the quadratic form +Let \( \hat{r}_k \) be the residual at the \( k \)-th step: $$ \begin{equation*} - f(\hat{x}) = \frac{1}{2}\hat{x}^T\hat{A}\hat{x} - \hat{x}^T \hat{x} , \quad \hat{x}\in\mathbf{R}^n. +\hat{r}_k=\hat{b}-\hat{A}\hat{x}_k. \end{equation*} $$ -This suggests taking the first basis vector \( \hat{p}_1 \) -to be the gradient of \( f \) at \( \hat{x}=\hat{x}_0 \), -which equals +Note that \( \hat{r}_k \) is the negative gradient of \( f \) at +\( \hat{x}=\hat{x}_k \), +so the gradient descent method would be to move in the direction \( \hat{r}_k \). +Here, we insist that the directions \( \hat{p}_k \) are conjugate to each other, +so we take the direction closest to the gradient \( \hat{r}_k \) +under the conjugacy constraint. +This gives the following expression $$ \begin{equation*} -\hat{A}\hat{x}_0-\hat{b}, +\hat{p}_{k+1}=\hat{r}_k-\frac{\hat{p}_k^T \hat{A}\hat{r}_k}{\hat{p}_k^T\hat{A}\hat{p}_k} \hat{p}_k. \end{equation*} $$ - -and -\( \hat{x}_0=0 \) it is equal \( -\hat{b} \). -The other vectors in the basis will be conjugate to the gradient, -hence the name conjugate gradient method.

    @@ -325,7 +322,6 @@ hence the name conjugate gradient method.
  • 71
  • 72
  • 73
  • -
  • 74
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs070.html b/doc/pub/Splines/html/._Splines-bs070.html index 5052289d4..6df5d9ff2 100644 --- a/doc/pub/Splines/html/._Splines-bs070.html +++ b/doc/pub/Splines/html/._Splines-bs070.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -282,24 +280,33 @@ MathJax.Hub.Config({

    -Let \( \hat{r}_k \) be the residual at the \( k \)-th step: +We can also compute the residual iteratively as $$ \begin{equation*} -\hat{r}_k=\hat{b}-\hat{A}\hat{x}_k. -\end{equation*} +\hat{r}_{k+1}=\hat{b}-\hat{A}\hat{x}_{k+1}, + \end{equation*} $$ -Note that \( \hat{r}_k \) is the negative gradient of \( f \) at -\( \hat{x}=\hat{x}_k \), -so the gradient descent method would be to move in the direction \( \hat{r}_k \). -Here, we insist that the directions \( \hat{p}_k \) are conjugate to each other, -so we take the direction closest to the gradient \( \hat{r}_k \) -under the conjugacy constraint. -This gives the following expression +which equals $$ \begin{equation*} -\hat{p}_{k+1}=\hat{r}_k-\frac{\hat{p}_k^T \hat{A}\hat{r}_k}{\hat{p}_k^T\hat{A}\hat{p}_k} \hat{p}_k. -\end{equation*} +\hat{b}-\hat{A}(\hat{x}_k+\alpha_k\hat{p}_k), + \end{equation*} +$$ + +or +$$ +\begin{equation*} +(\hat{b}-\hat{A}\hat{x}_k)-\alpha_k\hat{A}\hat{p}_k, + \end{equation*} +$$ + +which gives + +$$ +\begin{equation*} +\hat{r}_{k+1}=\hat{r}_k-\hat{A}\hat{p}_{k}, + \end{equation*} $$

    @@ -323,7 +330,6 @@ $$
  • 71
  • 72
  • 73
  • -
  • 74
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs071.html b/doc/pub/Splines/html/._Splines-bs071.html index a99a49b36..e4a7b0271 100644 --- a/doc/pub/Splines/html/._Splines-bs071.html +++ b/doc/pub/Splines/html/._Splines-bs071.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,38 +276,39 @@ MathJax.Hub.Config({ -

    Conjugate gradient method

    +

    Simple implementation of the Conjugate gradient algorithm

    -We can also compute the residual iteratively as -$$ -\begin{equation*} -\hat{r}_{k+1}=\hat{b}-\hat{A}\hat{x}_{k+1}, - \end{equation*} -$$ +

    -which equals -$$ -\begin{equation*} -\hat{b}-\hat{A}(\hat{x}_k+\alpha_k\hat{p}_k), - \end{equation*} -$$ + +

      Vector ConjugateGradient(Matrix A, Vector b, Vector x0){
    +  int dim = x0.Dimension();
    +  const double tolerance = 1.0e-14;
    +  Vector x(dim),r(dim),v(dim),z(dim);
    +  double c,t,d;
     
    -or
    -$$
    -\begin{equation*}
    -(\hat{b}-\hat{A}\hat{x}_k)-\alpha_k\hat{A}\hat{p}_k,
    - \end{equation*}
    -$$
    -
    -which gives
    -
    -$$
    -\begin{equation*}
    -\hat{r}_{k+1}=\hat{r}_k-\hat{A}\hat{p}_{k},
    - \end{equation*}
    -$$
    +  x = x0;
    +  r = b - A*x;
    +  v = r;
    +  c = dot(r,r);
    +  int i = 0; IterMax = dim;
    +  while(i <= IterMax){
    +    z = A*v;
    +    t = c/dot(v,z);
    +    x = x + t*v;
    +    r = r - t*z;
    +    d = dot(r,r);
    +    if(sqrt(d) < tolerance)
    +      break;
    +    v = r + (d/c)*v;
    +    c = d;  i++;
    +  }
    +  return x;
    +} 
    +
    +

    @@ -331,7 +330,6 @@ $$
  • 71
  • 72
  • 73
  • -
  • 74
  • »
  • diff --git a/doc/pub/Splines/html/._Splines-bs072.html b/doc/pub/Splines/html/._Splines-bs072.html index 9dc6ba78c..10be3cdbe 100644 --- a/doc/pub/Splines/html/._Splines-bs072.html +++ b/doc/pub/Splines/html/._Splines-bs072.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -278,44 +276,41 @@ MathJax.Hub.Config({ -

    Simple implementation of the Conjugate gradient algorithm

    +

    Broyden–Fletcher–Goldfarb–Shanno algorithm

    +The optimization problem is to minimize \( f(\mathbf {x} ) \) where \( \mathbf {x} \) is a vector in \( R^{n} \), and \( f \) is a differentiable scalar function. There are no constraints on the values that \( \mathbf {x} \) can take. +

    +The algorithm begins at an initial estimate for the optimal value \( \mathbf {x}_{0} \) and proceeds iteratively to get a better estimate at each stage. - -

      Vector ConjugateGradient(Matrix A, Vector b, Vector x0){
    -  int dim = x0.Dimension();
    -  const double tolerance = 1.0e-14;
    -  Vector x(dim),r(dim),v(dim),z(dim);
    -  double c,t,d;
    +

    +The search direction \( p_k \) at stage \( k \) is given by the solution of the analogue of the Newton equation +$$ +B_{k}\mathbf {p} _{k}=-\nabla f(\mathbf {x}_{k}), +$$ + +

    +where \( B_{k} \) is an approximation to the Hessian matrix, which is +updated iteratively at each stage, and \( \nabla f(\mathbf {x} _{k}) \) +is the gradient of the function +evaluated at \( x_k \). +A line search in the direction \( p_k \) is then used to +find the next point \( x_{k+1} \) by minimising +$$ +f(\mathbf {x}_{k}+\alpha \mathbf {p}_{k}), +$$ + +over the scalar \( \alpha > 0 \). - x = x0; - r = b - A*x; - v = r; - c = dot(r,r); - int i = 0; IterMax = dim; - while(i <= IterMax){ - z = A*v; - t = c/dot(v,z); - x = x + t*v; - r = r - t*z; - d = dot(r,r); - if(sqrt(d) < tolerance) - break; - v = r + (d/c)*v; - c = d; i++; - } - return x; -} -

    +

      @@ -331,8 +326,6 @@ MathJax.Hub.Config({
    • 71
    • 72
    • 73
    • -
    • 74
    • -
    • »
    diff --git a/doc/pub/Splines/html/Splines-bs.html b/doc/pub/Splines/html/Splines-bs.html index 0024f8776..02f35b586 100644 --- a/doc/pub/Splines/html/Splines-bs.html +++ b/doc/pub/Splines/html/Splines-bs.html @@ -92,67 +92,66 @@ Automatically generated HTML file from DocOnce source ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -225,44 +224,43 @@ MathJax.Hub.Config({
  • When do we stop?
  • Slightly different approach
  • Program for stochastic gradient
  • -
  • Logistic Regression example
  • -
  • Momentum based GD
  • -
  • More on momentum based approaches
  • -
  • Momentum parameter
  • -
  • Second moment of the gradient
  • -
  • RMS prop
  • -
  • ADAM optimizer
  • -
  • Practical tips
  • -
  • Automatic differentiation
  • -
  • Using autograd
  • -
  • Autograd with more complicated functions
  • -
  • More complicated functions using the elements of their arguments directly
  • -
  • Functions using mathematical functions from Numpy
  • -
  • More autograd
  • -
  • And with loops
  • -
  • Using recursion
  • -
  • Unsupported functions
  • -
  • The syntax a.dot(b) when finding the dot product
  • -
  • Recommended to avoid
  • -
  • Standard steepest descent
  • -
  • Gradient method
  • +
  • Momentum based GD
  • +
  • More on momentum based approaches
  • +
  • Momentum parameter
  • +
  • Second moment of the gradient
  • +
  • RMS prop
  • +
  • ADAM optimizer
  • +
  • Practical tips
  • +
  • Automatic differentiation
  • +
  • Using autograd
  • +
  • Autograd with more complicated functions
  • +
  • More complicated functions using the elements of their arguments directly
  • +
  • Functions using mathematical functions from Numpy
  • +
  • More autograd
  • +
  • And with loops
  • +
  • Using recursion
  • +
  • Unsupported functions
  • +
  • The syntax a.dot(b) when finding the dot product
  • +
  • Recommended to avoid
  • +
  • Standard steepest descent
  • +
  • Gradient method
  • +
  • Steepest descent method
  • Steepest descent method
  • -
  • Steepest descent method
  • -
  • Final expressions
  • -
  • Code examples for steepest descent
  • -
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • -
  • The routine for the steepest descent method
  • -
  • Steepest descent example
  • +
  • Final expressions
  • +
  • Code examples for steepest descent
  • +
  • Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come
  • +
  • The routine for the steepest descent method
  • +
  • Steepest descent example
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method and iterations
  • +
  • Conjugate gradient method
  • Conjugate gradient method
  • Conjugate gradient method
  • -
  • Conjugate gradient method
  • -
  • Simple implementation of the Conjugate gradient algorithm
  • -
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • +
  • Simple implementation of the Conjugate gradient algorithm
  • +
  • Broyden–Fletcher–Goldfarb–Shanno algorithm
  • @@ -321,7 +319,7 @@ MathJax.Hub.Config({
  • 9
  • 10
  • ...
  • -
  • 74
  • +
  • 73
  • »
  • diff --git a/doc/pub/Splines/html/Splines-reveal.html b/doc/pub/Splines/html/Splines-reveal.html index 176156e4d..66ff38f9e 100644 --- a/doc/pub/Splines/html/Splines-reveal.html +++ b/doc/pub/Splines/html/Splines-reveal.html @@ -1120,10 +1120,11 @@ j = 0 import matplotlib.pyplot as plt from sklearn.linear_model import SGDRegressor -x = 2*np.random.rand(100,1) -y = 4+3*x+np.random.randn(100,1) +m = 100 +x = 2*np.random.rand(m,1) +y = 4+3*x+np.random.randn(m,1) -xb = np.c_[np.ones((100,1)), x] +xb = np.c_[np.ones((m,1)), x] theta_linreg = np.linalg.inv(xb.T.dot(xb)).dot(xb.T).dot(y) print("Own inversion") print(theta_linreg) @@ -1134,10 +1135,9 @@ sgdreg.fit(x,y.ravel()) theta = np.random.randn(2,1) - eta = 0.1 Niterations = 1000 -m = 100 + for iter in range(Niterations): gradients = 2.0/m*xb.T @ ((xb @ theta)-y) @@ -1153,7 +1153,6 @@ ypredict2 = xbnew.dot(theta_linreg) n_epochs = 50 t0, t1 = 5, 50 -m = 100 def learning_schedule(t): return t0/(t+t1) @@ -1179,16 +1178,13 @@ plt.ylabel(r'$y$') plt.title(r'Random numbers ') plt.show()
    +

    +Challenge: try to write a similar code for a Logistic Regression case.

    -

    Logistic Regression example

    -
    - - -
    -

    Momentum based GD

    +

    Momentum based GD

    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 @@ -1215,7 +1211,7 @@ where we have defined \( \Delta \boldsymbol{\theta}_{t}= \boldsymbol{\theta}_t-\

    -

    More on momentum based approaches

    +

    More on momentum based approaches

    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 @@ -1243,7 +1239,7 @@ $$

    -

    Momentum parameter

    +

    Momentum parameter

    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:

     
    @@ -1277,7 +1273,7 @@ One of the major advantages of NAG is that it allows for the use of a larger lea

    -

    Second moment of the gradient

    +

    Second moment of the gradient

    In stochastic gradient descent, with and without momentum, we still @@ -1302,7 +1298,7 @@ Recently, a number of methods have been introduced that accomplish this by track

    -

    RMS prop

    +

    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 @@ -1322,7 +1318,7 @@ where \( \beta \) controls the averaging time of the second moment and is typica

    -

    ADAM optimizer

    +

    ADAM optimizer

    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. 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) @@ -1354,7 +1350,7 @@ $$

    -

    Practical tips

    +

    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.
    • @@ -1369,7 +1365,38 @@ Geron's text, see chapter 11, has several interesting discussions.
      -

      Automatic differentiation

      +

      Automatic differentiation

      + +

      +Automatic differentiation (AD), +also called algorithmic +differentiation or computational differentiation,is a set of +techniques to numerically evaluate the derivative of a function +specified by a computer program. AD exploits the fact that every +computer program, no matter how complicated, executes a sequence of +elementary arithmetic operations (addition, subtraction, +multiplication, division, etc.) and elementary functions (exp, log, +sin, cos, etc.). By applying the chain rule repeatedly to these +operations, derivatives of arbitrary order can be computed +automatically, accurately to working precision, and using at most a +small constant factor more arithmetic operations than the original +program. + +

      +Automatic differentiation is neither: + +

        +

      • Symbolic differentiation, nor
      • +

      • Numerical differentiation (the method of finite differences).
      • +
      +

      + +Symbolic differentiation can lead to inefficient code and faces the +difficulty of converting a computer program into a single expression, +while numerical differentiation can introduce round-off errors in the +discretization process and cancellation + +

      Python has tools for so-called automatic differentiation. Consider the following example

       
      @@ -1429,7 +1456,7 @@ plt.show()

      -

      Using autograd

      +

      Using autograd

      Here we @@ -1463,7 +1490,7 @@ grad_analytical = 3*a**Autograd with more complicated functions +

      Autograd with more complicated functions

      To differentiate with respect to two (or more) arguments of a Python @@ -1513,7 +1540,7 @@ Note that the grad function will not produce the true gradient of the function.

      -

      More complicated functions using the elements of their arguments directly

      +

      More complicated functions using the elements of their arguments directly

      @@ -1547,7 +1574,7 @@ could expect form a gradient-evaluting function.

      -

      Functions using mathematical functions from Numpy

      +

      Functions using mathematical functions from Numpy

      @@ -1574,7 +1601,7 @@ f4_grad_analytical = x/np.sqrt(1 + x** -

      More autograd

      +

      More autograd

      @@ -1598,7 +1625,7 @@ x = 2.7

      -

      And with loops

      +

      And with loops

      @@ -1645,7 +1672,7 @@ f6_grad_analytical = 0

      -

      Using recursion

      +

      Using recursion

      @@ -1683,7 +1710,7 @@ Note that if n is equal to zero or one, Autograd will give an error message. Thi

      -

      Unsupported functions

      +

      Unsupported functions

      Autograd supports many features. However, there are some functions that is not supported (yet) by Autograd.

      @@ -1709,7 +1736,7 @@ Here, Autograd tells us that an 'ArrayBox' does not support item assignment. The

      -

      The syntax a.dot(b) when finding the dot product

      +

      The syntax a.dot(b) when finding the dot product

      @@ -1752,7 +1779,7 @@ x = np.array([3.0,Recommended to avoid +

      Recommended to avoid

      The documentation recommends to avoid inplace operations such as

      @@ -1766,7 +1793,7 @@ a /=b

      -

      Standard steepest descent

      +

      Standard steepest descent

      Before we proceed, we would like to discuss the approach called the @@ -1806,7 +1833,7 @@ When we have found the exact solution, \( \hat{r}=0 \).

      -

      Gradient method

      +

      Gradient method

      The residual is zero when we reach the minimum of the quadratic equation @@ -1825,7 +1852,7 @@ symmetric. This defines also the Hessian and we want it to be positive definit

      -

      Steepest descent method

      +

      Steepest descent method

      We denote the initial guess for \( \hat{x} \) as \( \hat{x}_0 \). @@ -1852,7 +1879,7 @@ instead.

      -

      Steepest descent method

      +

      Steepest descent method

      @@ -1885,7 +1912,7 @@ and

      -

      Final expressions

      +

      Final expressions

      @@ -1937,12 +1964,12 @@ $$

      -

      Code examples for steepest descent

      +

      Code examples for steepest descent

      -

      Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come

      +

      Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come

      @@ -1980,7 +2007,7 @@ $$

      -

      The routine for the steepest descent method

      +

      The routine for the steepest descent method

      @@ -2014,7 +2041,7 @@ $$

      -

      Steepest descent example

      +

      Steepest descent example

      @@ -2084,7 +2111,7 @@ pt.plot(it_array.T[0], it_array.T[ -

      Conjugate gradient method

      +

      Conjugate gradient method

      @@ -2117,7 +2144,7 @@ this inner product. Being conjugate is a symmetric relation: if \( \hat{s} \) is

      -

      Conjugate gradient method

      +

      Conjugate gradient method

      @@ -2136,7 +2163,7 @@ which is zero unless \( i=j \).

      -

      Conjugate gradient method

      +

      Conjugate gradient method

      @@ -2166,7 +2193,7 @@ $$

      -

      Conjugate gradient method

      +

      Conjugate gradient method

      @@ -2203,7 +2230,7 @@ $$

      -

      Conjugate gradient method and iterations

      +

      Conjugate gradient method and iterations

      @@ -2240,7 +2267,7 @@ instead.

      -

      Conjugate gradient method

      +

      Conjugate gradient method

      @@ -2273,7 +2300,7 @@ hence the name conjugate gradient method.

      -

      Conjugate gradient method

      +

      Conjugate gradient method

      @@ -2305,7 +2332,7 @@ $$

      -

      Conjugate gradient method

      +

      Conjugate gradient method

      @@ -2350,7 +2377,7 @@ $$

      -

      Simple implementation of the Conjugate gradient algorithm

      +

      Simple implementation of the Conjugate gradient algorithm

      @@ -2387,7 +2414,7 @@ $$

      -

      Broyden–Fletcher–Goldfarb–Shanno algorithm

      +

      Broyden–Fletcher–Goldfarb–Shanno algorithm

      diff --git a/doc/pub/Splines/html/Splines-solarized.html b/doc/pub/Splines/html/Splines-solarized.html index dcccd7329..ebd7ee050 100644 --- a/doc/pub/Splines/html/Splines-solarized.html +++ b/doc/pub/Splines/html/Splines-solarized.html @@ -112,67 +112,66 @@ div { text-align: justify; text-justify: inter-word; } ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -1109,10 +1108,11 @@ j = 0 import matplotlib.pyplot as plt from sklearn.linear_model import SGDRegressor -x = 2*np.random.rand(100,1) -y = 4+3*x+np.random.randn(100,1) +m = 100 +x = 2*np.random.rand(m,1) +y = 4+3*x+np.random.randn(m,1) -xb = np.c_[np.ones((100,1)), x] +xb = np.c_[np.ones((m,1)), x] theta_linreg = np.linalg.inv(xb.T.dot(xb)).dot(xb.T).dot(y) print("Own inversion") print(theta_linreg) @@ -1123,10 +1123,9 @@ sgdreg.fit(x,y.ravel()) theta = np.random.randn(2,1) - eta = 0.1 Niterations = 1000 -m = 100 + for iter in range(Niterations): gradients = 2.0/m*xb.T @ ((xb @ theta)-y) @@ -1142,7 +1141,6 @@ ypredict2 = xbnew.dot(theta_linreg) n_epochs = 50 t0, t1 = 5, 50 -m = 100 def learning_schedule(t): return t0/(t+t1) @@ -1169,14 +1167,12 @@ plt.title(r'Random numbers ') plt.show()

      -









      - -

      Logistic Regression example

      +Challenge: try to write a similar code for a Logistic Regression case.











      -

      Momentum based GD

      +

      Momentum based GD

      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 @@ -1199,7 +1195,7 @@ where we have defined \( \Delta \boldsymbol{\theta}_{t}= \boldsymbol{\theta}_t-\











      -

      More on momentum based approaches

      +

      More on momentum based approaches

      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 @@ -1221,7 +1217,7 @@ $$











      -

      Momentum parameter

      +

      Momentum parameter

      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: $$ @@ -1251,7 +1247,7 @@ One of the major advantages of NAG is that it allows for the use of a larger lea











      -

      Second moment of the gradient

      +

      Second moment of the gradient

      In stochastic gradient descent, with and without momentum, we still @@ -1276,7 +1272,7 @@ Recently, a number of methods have been introduced that accomplish this by track











      -

      RMS prop

      +

      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 @@ -1294,7 +1290,7 @@ where \( \beta \) controls the averaging time of the second moment and is typica











      -

      ADAM optimizer

      +

      ADAM optimizer

      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. 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) @@ -1322,7 +1318,7 @@ $$











      -

      Practical tips

      +

      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.
      • @@ -1336,7 +1332,37 @@ Geron's text, see chapter 11, has several interesting discussions.











        -

        Automatic differentiation

        +

        Automatic differentiation

        + +

        +Automatic differentiation (AD), +also called algorithmic +differentiation or computational differentiation,is a set of +techniques to numerically evaluate the derivative of a function +specified by a computer program. AD exploits the fact that every +computer program, no matter how complicated, executes a sequence of +elementary arithmetic operations (addition, subtraction, +multiplication, division, etc.) and elementary functions (exp, log, +sin, cos, etc.). By applying the chain rule repeatedly to these +operations, derivatives of arbitrary order can be computed +automatically, accurately to working precision, and using at most a +small constant factor more arithmetic operations than the original +program. + +

        +Automatic differentiation is neither: + +

          +
        • Symbolic differentiation, nor
        • +
        • Numerical differentiation (the method of finite differences).
        • +
        + +Symbolic differentiation can lead to inefficient code and faces the +difficulty of converting a computer program into a single expression, +while numerical differentiation can introduce round-off errors in the +discretization process and cancellation + +

        Python has tools for so-called automatic differentiation. Consider the following example $$ @@ -1391,7 +1417,7 @@ plt.show()

        -

        Using autograd

        +

        Using autograd

        Here we @@ -1424,7 +1450,7 @@ grad_analytical = 3*a**Autograd with more complicated functions +

        Autograd with more complicated functions

        To differentiate with respect to two (or more) arguments of a Python @@ -1474,7 +1500,7 @@ Note that the grad function will not produce the true gradient of the function.











        -

        More complicated functions using the elements of their arguments directly

        +

        More complicated functions using the elements of their arguments directly

        @@ -1508,7 +1534,7 @@ could expect form a gradient-evaluting function.

        -

        Functions using mathematical functions from Numpy

        +

        Functions using mathematical functions from Numpy

        @@ -1534,7 +1560,7 @@ f4_grad_analytical = x/np.sqrt(1 + x**









        -

        More autograd

        +

        More autograd

        @@ -1557,7 +1583,7 @@ x = 2.7











        -

        And with loops

        +

        And with loops

        @@ -1603,7 +1629,7 @@ f6_grad_analytical = 0











        -

        Using recursion

        +

        Using recursion

        @@ -1641,7 +1667,7 @@ Note that if n is equal to zero or one, Autograd will give an error message. Thi











        -

        Unsupported functions

        +

        Unsupported functions

        Autograd supports many features. However, there are some functions that is not supported (yet) by Autograd.

        @@ -1667,7 +1693,7 @@ Here, Autograd tells us that an 'ArrayBox' does not support item assignment. The











        -

        The syntax a.dot(b) when finding the dot product

        +

        The syntax a.dot(b) when finding the dot product

        @@ -1709,7 +1735,7 @@ x = np.array([3.0,Recommended to avoid +

        Recommended to avoid

        The documentation recommends to avoid inplace operations such as

        @@ -1722,7 +1748,7 @@ a /=b











        -

        Standard steepest descent

        +

        Standard steepest descent

        Before we proceed, we would like to discuss the approach called the @@ -1758,7 +1784,7 @@ When we have found the exact solution, \( \hat{r}=0 \).











        -

        Gradient method

        +

        Gradient method

        The residual is zero when we reach the minimum of the quadratic equation @@ -1775,7 +1801,7 @@ symmetric. This defines also the Hessian and we want it to be positive definit











        -

        Steepest descent method

        +

        Steepest descent method

        We denote the initial guess for \( \hat{x} \) as \( \hat{x}_0 \). @@ -1798,7 +1824,7 @@ instead.











        -

        Steepest descent method

        +

        Steepest descent method

        @@ -1828,7 +1854,7 @@ and











        -

        Final expressions

        +

        Final expressions

        @@ -1871,12 +1897,12 @@ $$











        -

        Code examples for steepest descent

        +

        Code examples for steepest descent











        -

        Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come

        +

        Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come

        @@ -1916,7 +1942,7 @@ $$











        -

        The routine for the steepest descent method

        +

        The routine for the steepest descent method

        @@ -1952,7 +1978,7 @@ $$











        -

        Steepest descent example

        +

        Steepest descent example

        @@ -2021,7 +2047,7 @@ pt.plot(it_array.T[0], it_array.T[









        -

        Conjugate gradient method

        +

        Conjugate gradient method

        @@ -2051,7 +2077,7 @@ this inner product. Being conjugate is a symmetric relation: if \( \hat{s} \) is











        -

        Conjugate gradient method

        +

        Conjugate gradient method

        @@ -2069,7 +2095,7 @@ which is zero unless \( i=j \).











        -

        Conjugate gradient method

        +

        Conjugate gradient method

        @@ -2096,7 +2122,7 @@ $$











        -

        Conjugate gradient method

        +

        Conjugate gradient method

        @@ -2128,7 +2154,7 @@ $$











        -

        Conjugate gradient method and iterations

        +

        Conjugate gradient method and iterations

        @@ -2164,7 +2190,7 @@ instead.











        -

        Conjugate gradient method

        +

        Conjugate gradient method

        @@ -2194,7 +2220,7 @@ hence the name conjugate gradient method.











        -

        Conjugate gradient method

        +

        Conjugate gradient method

        @@ -2223,7 +2249,7 @@ $$











        -

        Conjugate gradient method

        +

        Conjugate gradient method

        @@ -2261,7 +2287,7 @@ $$











        -

        Simple implementation of the Conjugate gradient algorithm

        +

        Simple implementation of the Conjugate gradient algorithm

        @@ -2300,7 +2326,7 @@ $$











        -

        Broyden–Fletcher–Goldfarb–Shanno algorithm

        +

        Broyden–Fletcher–Goldfarb–Shanno algorithm

        diff --git a/doc/pub/Splines/html/Splines.html b/doc/pub/Splines/html/Splines.html index b39dd2177..3bcf473b9 100644 --- a/doc/pub/Splines/html/Splines.html +++ b/doc/pub/Splines/html/Splines.html @@ -117,67 +117,66 @@ div { text-align: justify; text-justify: inter-word; } ('When do we stop?', 2, None, '___sec32'), ('Slightly different approach', 2, None, '___sec33'), ('Program for stochastic gradient', 2, None, '___sec34'), - ('Logistic Regression example', 2, None, '___sec35'), - ('Momentum based GD', 2, None, '___sec36'), - ('More on momentum based approaches', 2, None, '___sec37'), - ('Momentum parameter', 2, None, '___sec38'), - ('Second moment of the gradient', 2, None, '___sec39'), - ('RMS prop', 2, None, '___sec40'), - ('ADAM optimizer', 2, None, '___sec41'), - ('Practical tips', 2, None, '___sec42'), - ('Automatic differentiation', 2, None, '___sec43'), - ('Using autograd', 2, None, '___sec44'), - ('Autograd with more complicated functions', 2, None, '___sec45'), + ('Momentum based GD', 2, None, '___sec35'), + ('More on momentum based approaches', 2, None, '___sec36'), + ('Momentum parameter', 2, None, '___sec37'), + ('Second moment of the gradient', 2, None, '___sec38'), + ('RMS prop', 2, None, '___sec39'), + ('ADAM optimizer', 2, None, '___sec40'), + ('Practical tips', 2, None, '___sec41'), + ('Automatic differentiation', 2, None, '___sec42'), + ('Using autograd', 2, None, '___sec43'), + ('Autograd with more complicated functions', 2, None, '___sec44'), ('More complicated functions using the elements of their ' 'arguments directly', 2, None, - '___sec46'), + '___sec45'), ('Functions using mathematical functions from Numpy', 2, None, - '___sec47'), - ('More autograd', 2, None, '___sec48'), - ('And with loops', 2, None, '___sec49'), - ('Using recursion', 2, None, '___sec50'), - ('Unsupported functions', 2, None, '___sec51'), + '___sec46'), + ('More autograd', 2, None, '___sec47'), + ('And with loops', 2, None, '___sec48'), + ('Using recursion', 2, None, '___sec49'), + ('Unsupported functions', 2, None, '___sec50'), ('The syntax a.dot(b) when finding the dot product', 2, None, - '___sec52'), - ('Recommended to avoid', 2, None, '___sec53'), - ('Standard steepest descent', 2, None, '___sec54'), - ('Gradient method', 2, None, '___sec55'), + '___sec51'), + ('Recommended to avoid', 2, None, '___sec52'), + ('Standard steepest descent', 2, None, '___sec53'), + ('Gradient method', 2, None, '___sec54'), + ('Steepest descent method', 2, None, '___sec55'), ('Steepest descent method', 2, None, '___sec56'), - ('Steepest descent method', 2, None, '___sec57'), - ('Final expressions', 2, None, '___sec58'), - ('Code examples for steepest descent', 2, None, '___sec59'), + ('Final expressions', 2, None, '___sec57'), + ('Code examples for steepest descent', 2, None, '___sec58'), ('Simple codes for steepest descent and conjugate gradient ' 'using a $2\\times 2$ matrix, in c++, Python code to come', 2, None, - '___sec60'), + '___sec59'), ('The routine for the steepest descent method', 2, None, - '___sec61'), - ('Steepest descent example', 2, None, '___sec62'), + '___sec60'), + ('Steepest descent example', 2, None, '___sec61'), + ('Conjugate gradient method', 2, None, '___sec62'), ('Conjugate gradient method', 2, None, '___sec63'), ('Conjugate gradient method', 2, None, '___sec64'), ('Conjugate gradient method', 2, None, '___sec65'), - ('Conjugate gradient method', 2, None, '___sec66'), - ('Conjugate gradient method and iterations', 2, None, '___sec67'), + ('Conjugate gradient method and iterations', 2, None, '___sec66'), + ('Conjugate gradient method', 2, None, '___sec67'), ('Conjugate gradient method', 2, None, '___sec68'), ('Conjugate gradient method', 2, None, '___sec69'), - ('Conjugate gradient method', 2, None, '___sec70'), ('Simple implementation of the Conjugate gradient algorithm', 2, None, - '___sec71'), + '___sec70'), ('Broyden–Fletcher–Goldfarb–Shanno algorithm', 2, None, - '___sec72')]} + '___sec71')]} end of tocinfo --> @@ -1114,10 +1113,11 @@ j = 0 import matplotlib.pyplot as plt from sklearn.linear_model import SGDRegressor -x = 2*np.random.rand(100,1) -y = 4+3*x+np.random.randn(100,1) +m = 100 +x = 2*np.random.rand(m,1) +y = 4+3*x+np.random.randn(m,1) -xb = np.c_[np.ones((100,1)), x] +xb = np.c_[np.ones((m,1)), x] theta_linreg = np.linalg.inv(xb.T.dot(xb)).dot(xb.T).dot(y) print("Own inversion") print(theta_linreg) @@ -1128,10 +1128,9 @@ sgdreg.fit(x,y. theta = np.random.randn(2,1) - eta = 0.1 Niterations = 1000 -m = 100 + for iter in range(Niterations): gradients = 2.0/m*xb.T @ ((xb @ theta)-y) @@ -1147,7 +1146,6 @@ ypredict2 = xbnew= 50 t0, t1 = 5, 50 -m = 100 def learning_schedule(t): return t0/(t+t1) @@ -1174,14 +1172,12 @@ plt.title(r' plt.show()

        -









        - -

        Logistic Regression example

        +Challenge: try to write a similar code for a Logistic Regression case.











        -

        Momentum based GD

        +

        Momentum based GD

        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 @@ -1204,7 +1200,7 @@ where we have defined \( \Delta \boldsymbol{\theta}_{t}= \boldsymbol{\theta}_t-\











        -

        More on momentum based approaches

        +

        More on momentum based approaches

        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 @@ -1226,7 +1222,7 @@ $$











        -

        Momentum parameter

        +

        Momentum parameter

        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: $$ @@ -1256,7 +1252,7 @@ One of the major advantages of NAG is that it allows for the use of a larger lea











        -

        Second moment of the gradient

        +

        Second moment of the gradient

        In stochastic gradient descent, with and without momentum, we still @@ -1281,7 +1277,7 @@ Recently, a number of methods have been introduced that accomplish this by track











        -

        RMS prop

        +

        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 @@ -1299,7 +1295,7 @@ where \( \beta \) controls the averaging time of the second moment and is typica











        -

        ADAM optimizer

        +

        ADAM optimizer

        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. 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) @@ -1327,7 +1323,7 @@ $$











        -

        Practical tips

        +

        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.
        • @@ -1341,7 +1337,37 @@ Geron's text, see chapter 11, has several interesting discussions.











          -

          Automatic differentiation

          +

          Automatic differentiation

          + +

          +Automatic differentiation (AD), +also called algorithmic +differentiation or computational differentiation,is a set of +techniques to numerically evaluate the derivative of a function +specified by a computer program. AD exploits the fact that every +computer program, no matter how complicated, executes a sequence of +elementary arithmetic operations (addition, subtraction, +multiplication, division, etc.) and elementary functions (exp, log, +sin, cos, etc.). By applying the chain rule repeatedly to these +operations, derivatives of arbitrary order can be computed +automatically, accurately to working precision, and using at most a +small constant factor more arithmetic operations than the original +program. + +

          +Automatic differentiation is neither: + +

            +
          • Symbolic differentiation, nor
          • +
          • Numerical differentiation (the method of finite differences).
          • +
          + +Symbolic differentiation can lead to inefficient code and faces the +difficulty of converting a computer program into a single expression, +while numerical differentiation can introduce round-off errors in the +discretization process and cancellation + +

          Python has tools for so-called automatic differentiation. Consider the following example $$ @@ -1396,7 +1422,7 @@ plt.show()

          -

          Using autograd

          +

          Using autograd

          Here we @@ -1429,7 +1455,7 @@ grad_analytical = Autograd with more complicated functions +

          Autograd with more complicated functions

          To differentiate with respect to two (or more) arguments of a Python @@ -1479,7 +1505,7 @@ Note that the grad function will not produce the true gradient of the function.











          -

          More complicated functions using the elements of their arguments directly

          +

          More complicated functions using the elements of their arguments directly

          @@ -1513,7 +1539,7 @@ could expect form a gradient-evaluting function.

          -

          Functions using mathematical functions from Numpy

          +

          Functions using mathematical functions from Numpy

          @@ -1539,7 +1565,7 @@ f4_grad_analytical = xMore autograd +

          More autograd

          @@ -1562,7 +1588,7 @@ x = 2.7











          -

          And with loops

          +

          And with loops

          @@ -1608,7 +1634,7 @@ f6_grad_analytical = Using recursion +

          Using recursion

          @@ -1646,7 +1672,7 @@ Note that if n is equal to zero or one, Autograd will give an error message. Thi











          -

          Unsupported functions

          +

          Unsupported functions

          Autograd supports many features. However, there are some functions that is not supported (yet) by Autograd.

          @@ -1672,7 +1698,7 @@ Here, Autograd tells us that an 'ArrayBox' does not support item assignment. The











          -

          The syntax a.dot(b) when finding the dot product

          +

          The syntax a.dot(b) when finding the dot product

          @@ -1714,7 +1740,7 @@ x = np.a











          -

          Recommended to avoid

          +

          Recommended to avoid

          The documentation recommends to avoid inplace operations such as

          @@ -1727,7 +1753,7 @@ a /=b











          -

          Standard steepest descent

          +

          Standard steepest descent

          Before we proceed, we would like to discuss the approach called the @@ -1763,7 +1789,7 @@ When we have found the exact solution, \( \hat{r}=0 \).











          -

          Gradient method

          +

          Gradient method

          The residual is zero when we reach the minimum of the quadratic equation @@ -1780,7 +1806,7 @@ symmetric. This defines also the Hessian and we want it to be positive definit











          -

          Steepest descent method

          +

          Steepest descent method

          We denote the initial guess for \( \hat{x} \) as \( \hat{x}_0 \). @@ -1803,7 +1829,7 @@ instead.











          -

          Steepest descent method

          +

          Steepest descent method

          @@ -1833,7 +1859,7 @@ and











          -

          Final expressions

          +

          Final expressions

          @@ -1876,12 +1902,12 @@ $$











          -

          Code examples for steepest descent

          +

          Code examples for steepest descent











          -

          Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come

          +

          Simple codes for steepest descent and conjugate gradient using a \( 2\times 2 \) matrix, in c++, Python code to come

          @@ -1921,7 +1947,7 @@ $$











          -

          The routine for the steepest descent method

          +

          The routine for the steepest descent method

          @@ -1957,7 +1983,7 @@ $$











          -

          Steepest descent example

          +

          Steepest descent example

          @@ -2026,7 +2052,7 @@ pt.plot(it_array









          -

          Conjugate gradient method

          +

          Conjugate gradient method

          @@ -2056,7 +2082,7 @@ this inner product. Being conjugate is a symmetric relation: if \( \hat{s} \) is











          -

          Conjugate gradient method

          +

          Conjugate gradient method

          @@ -2074,7 +2100,7 @@ which is zero unless \( i=j \).











          -

          Conjugate gradient method

          +

          Conjugate gradient method

          @@ -2101,7 +2127,7 @@ $$











          -

          Conjugate gradient method

          +

          Conjugate gradient method

          @@ -2133,7 +2159,7 @@ $$











          -

          Conjugate gradient method and iterations

          +

          Conjugate gradient method and iterations

          @@ -2169,7 +2195,7 @@ instead.











          -

          Conjugate gradient method

          +

          Conjugate gradient method

          @@ -2199,7 +2225,7 @@ hence the name conjugate gradient method.











          -

          Conjugate gradient method

          +

          Conjugate gradient method

          @@ -2228,7 +2254,7 @@ $$











          -

          Conjugate gradient method

          +

          Conjugate gradient method

          @@ -2266,7 +2292,7 @@ $$











          -

          Simple implementation of the Conjugate gradient algorithm

          +

          Simple implementation of the Conjugate gradient algorithm

          @@ -2305,7 +2331,7 @@ $$











          -

          Broyden–Fletcher–Goldfarb–Shanno algorithm

          +

          Broyden–Fletcher–Goldfarb–Shanno algorithm

          diff --git a/doc/pub/Splines/ipynb/Splines.ipynb b/doc/pub/Splines/ipynb/Splines.ipynb index f3c394695..11c56a002 100644 --- a/doc/pub/Splines/ipynb/Splines.ipynb +++ b/doc/pub/Splines/ipynb/Splines.ipynb @@ -1166,10 +1166,11 @@ "import matplotlib.pyplot as plt\n", "from sklearn.linear_model import SGDRegressor\n", "\n", - "x = 2*np.random.rand(100,1)\n", - "y = 4+3*x+np.random.randn(100,1)\n", + "m = 100\n", + "x = 2*np.random.rand(m,1)\n", + "y = 4+3*x+np.random.randn(m,1)\n", "\n", - "xb = np.c_[np.ones((100,1)), x]\n", + "xb = np.c_[np.ones((m,1)), x]\n", "theta_linreg = np.linalg.inv(xb.T.dot(xb)).dot(xb.T).dot(y)\n", "print(\"Own inversion\")\n", "print(theta_linreg)\n", @@ -1180,10 +1181,9 @@ "\n", "\n", "theta = np.random.randn(2,1)\n", - "\n", "eta = 0.1\n", "Niterations = 1000\n", - "m = 100\n", + "\n", "\n", "for iter in range(Niterations):\n", " gradients = 2.0/m*xb.T @ ((xb @ theta)-y)\n", @@ -1199,7 +1199,6 @@ "\n", "n_epochs = 50\n", "t0, t1 = 5, 50\n", - "m = 100\n", "def learning_schedule(t):\n", " return t0/(t+t1)\n", "\n", @@ -1230,8 +1229,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Logistic Regression example\n", - "\n", + "**Challenge**: try to write a similar code for a Logistic Regression case.\n", "\n", "\n", "## Momentum based GD\n", @@ -1577,6 +1575,34 @@ "\n", "\n", "## Automatic differentiation\n", + "\n", + "[Automatic differentiation (AD)](https://en.wikipedia.org/wiki/Automatic_differentiation), \n", + "also called algorithmic\n", + "differentiation or computational differentiation,is a set of\n", + "techniques to numerically evaluate the derivative of a function\n", + "specified by a computer program. AD exploits the fact that every\n", + "computer program, no matter how complicated, executes a sequence of\n", + "elementary arithmetic operations (addition, subtraction,\n", + "multiplication, division, etc.) and elementary functions (exp, log,\n", + "sin, cos, etc.). By applying the chain rule repeatedly to these\n", + "operations, derivatives of arbitrary order can be computed\n", + "automatically, accurately to working precision, and using at most a\n", + "small constant factor more arithmetic operations than the original\n", + "program.\n", + "\n", + "Automatic differentiation is neither:\n", + "\n", + "* Symbolic differentiation, nor\n", + "\n", + "* Numerical differentiation (the method of finite differences).\n", + "\n", + "Symbolic differentiation can lead to inefficient code and faces the\n", + "difficulty of converting a computer program into a single expression,\n", + "while numerical differentiation can introduce round-off errors in the\n", + "discretization process and cancellation\n", + "\n", + "\n", + "\n", "Python has tools for so-called **automatic differentiation**.\n", "Consider the following example" ] diff --git a/doc/pub/Splines/ipynb/ipynb-Splines-src.tar.gz b/doc/pub/Splines/ipynb/ipynb-Splines-src.tar.gz index 63c898211..134512084 100644 Binary files a/doc/pub/Splines/ipynb/ipynb-Splines-src.tar.gz and b/doc/pub/Splines/ipynb/ipynb-Splines-src.tar.gz differ diff --git a/doc/pub/Splines/pdf/Splines-minted.pdf b/doc/pub/Splines/pdf/Splines-minted.pdf index 0b8b56091..7c47294d4 100644 Binary files a/doc/pub/Splines/pdf/Splines-minted.pdf and b/doc/pub/Splines/pdf/Splines-minted.pdf differ diff --git a/doc/src/LogisticRegression/test.py b/doc/src/LogisticRegression/test.py new file mode 100644 index 000000000..c3d455b56 --- /dev/null +++ b/doc/src/LogisticRegression/test.py @@ -0,0 +1,9 @@ +from sklearn.datasets import load_iris +from sklearn import datasets, linear_model +from sklearn.linear_model import LogisticRegressionCV +X, y = datasets.make_moons(200, noise=0.20) +#X, y = load_iris(return_X_y=True) +clf = LogisticRegressionCV(cv=5, random_state=0,multi_class='multinomial').fit(X, y) +#clf.predict(X[:2, :]) +#clf.predict_proba(X[:2, :]).shape +print(clf.score(X, y) ) diff --git a/doc/src/Splines/Splines.do.txt b/doc/src/Splines/Splines.do.txt index cfabe9a4a..35bbeb89a 100644 --- a/doc/src/Splines/Splines.do.txt +++ b/doc/src/Splines/Splines.do.txt @@ -815,10 +815,11 @@ import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import SGDRegressor -x = 2*np.random.rand(100,1) -y = 4+3*x+np.random.randn(100,1) +m = 100 +x = 2*np.random.rand(m,1) +y = 4+3*x+np.random.randn(m,1) -xb = np.c_[np.ones((100,1)), x] +xb = np.c_[np.ones((m,1)), x] theta_linreg = np.linalg.inv(xb.T.dot(xb)).dot(xb.T).dot(y) print("Own inversion") print(theta_linreg) @@ -829,10 +830,9 @@ print(sgdreg.intercept_, sgdreg.coef_) theta = np.random.randn(2,1) - eta = 0.1 Niterations = 1000 -m = 100 + for iter in range(Niterations): gradients = 2.0/m*xb.T @ ((xb @ theta)-y) @@ -848,7 +848,6 @@ ypredict2 = xbnew.dot(theta_linreg) n_epochs = 50 t0, t1 = 5, 50 -m = 100 def learning_schedule(t): return t0/(t+t1) @@ -876,10 +875,7 @@ plt.show() !ec - -!split -===== Logistic Regression example ===== - +_Challenge_: try to write a similar code for a Logistic Regression case. !split @@ -1028,6 +1024,33 @@ Geron's text, see chapter 11, has several interesting discussions. !split ===== Automatic differentiation ===== + +"Automatic differentiation (AD)":"https://en.wikipedia.org/wiki/Automatic_differentiation", +also called algorithmic +differentiation or computational differentiation,is a set of +techniques to numerically evaluate the derivative of a function +specified by a computer program. AD exploits the fact that every +computer program, no matter how complicated, executes a sequence of +elementary arithmetic operations (addition, subtraction, +multiplication, division, etc.) and elementary functions (exp, log, +sin, cos, etc.). By applying the chain rule repeatedly to these +operations, derivatives of arbitrary order can be computed +automatically, accurately to working precision, and using at most a +small constant factor more arithmetic operations than the original +program. + +Automatic differentiation is neither: + +* Symbolic differentiation, nor +* Numerical differentiation (the method of finite differences). + +Symbolic differentiation can lead to inefficient code and faces the +difficulty of converting a computer program into a single expression, +while numerical differentiation can introduce round-off errors in the +discretization process and cancellation + + + Python has tools for so-called _automatic differentiation_. Consider the following example !bt diff --git a/doc/src/Splines/logsgd.py b/doc/src/Splines/logsgd.py index 7adc63c96..c7ddc0c89 100644 --- a/doc/src/Splines/logsgd.py +++ b/doc/src/Splines/logsgd.py @@ -1,59 +1,41 @@ -from math import exp, sqrt -from random import random, seed import numpy as np from sklearn import datasets, linear_model import matplotlib.pyplot as plt -from sklearn.linear_model import SGDRegressor -np.random.seed(0) -X, y = datasets.make_moons(200, noise=0.20) -#X = np.c_[np.ones((100,1)), x] -sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1) -sgdreg.fit(X,y.ravel()) -print("sgdreg from scikit") -print(sgdreg.intercept_, sgdreg.coef_) +def generate_data(): + np.random.seed(0) + X, y = datasets.make_moons(200, noise=0.20) + return X, y -""" -theta = np.random.randn(2,1) -eta = 0.1 -Niterations = 1000 -m = 100 -for iter in range(Niterations): - gradients = 2.0/m*X.T @ ((X @ theta)-y) - theta -= eta*gradients -print("theta from own gd") -print(theta) +def visualize(X, y, clf): + plot_decision_boundary(lambda x: clf.predict(x), X, y) -xnew = np.array([[0],[2]]) -Xnew = np.c_[np.ones((2,1)), xnew] -ypredict = Xnew.dot(theta) +def plot_decision_boundary(pred_func, X, y): + # Set min and max values and give it some padding + x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5 + y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5 + h = 0.01 + # Generate a grid of points with distance h between them + xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h)) + # Predict the function value for the whole gid + Z = pred_func(np.c_[xx.ravel(), yy.ravel()]) + Z = Z.reshape(xx.shape) + # Plot the contour and training examples + plt.contourf(xx, yy, Z, cmap=plt.cm.Spectral) + plt.scatter(X[:, 0], X[:, 1], c=y, cmap=plt.cm.Spectral) + plt.show() -n_epochs = 50 -t0, t1 = 5, 50 -m = 100 -def learning_schedule(t): - return t0/(t+t1) -theta = np.random.randn(2,1) +def classify(X, y): + clf = linear_model.LogisticRegressionCV() + clf.fit(X, y) + return clf -for epoch in range(n_epochs): - for i in range(m): - random_index = np.random.randint(m) - xi = X[random_index:random_index+1] - yi = y[random_index:random_index+1] - gradients = 2 * xi.T @ ((xi @ theta)-yi) - eta = learning_schedule(epoch*m+i) - theta = theta - eta*gradients -print("theta from own sdg") -print(theta) -plt.plot(xnew, ypredict, "r-") -plt.plot(x, y ,'ro') -plt.axis([0,2.0,0, 15.0]) -plt.xlabel(r'$x$') -plt.ylabel(r'$y$') -plt.title(r'Random numbers ') -plt.show() -""" + +X, y = generate_data() +clf = classify(X, y) +visualize(X, y, clf) +