diff --git a/doc/pub/week41/html/._week41-bs000.html b/doc/pub/week41/html/._week41-bs000.html index cfbf9cd28..f851c6e2f 100644 --- a/doc/pub/week41/html/._week41-bs000.html +++ b/doc/pub/week41/html/._week41-bs000.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -381,7 +559,7 @@ MathJax.Hub.Config({
  • 9
  • 10
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs001.html b/doc/pub/week41/html/._week41-bs001.html index 7837d85bc..c4a587071 100644 --- a/doc/pub/week41/html/._week41-bs001.html +++ b/doc/pub/week41/html/._week41-bs001.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -359,7 +537,7 @@ MathJax.Hub.Config({
  • 10
  • 11
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs002.html b/doc/pub/week41/html/._week41-bs002.html index e40d78038..adc2bb4c2 100644 --- a/doc/pub/week41/html/._week41-bs002.html +++ b/doc/pub/week41/html/._week41-bs002.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -384,7 +562,7 @@ MathJax.Hub.Config({
  • 11
  • 12
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs003.html b/doc/pub/week41/html/._week41-bs003.html index ff74103d6..70b4d2a84 100644 --- a/doc/pub/week41/html/._week41-bs003.html +++ b/doc/pub/week41/html/._week41-bs003.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -366,7 +544,7 @@ MathJax.Hub.Config({
  • 12
  • 13
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs004.html b/doc/pub/week41/html/._week41-bs004.html index 0f614cbb6..877f43357 100644 --- a/doc/pub/week41/html/._week41-bs004.html +++ b/doc/pub/week41/html/._week41-bs004.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -362,7 +540,7 @@ MathJax.Hub.Config({
  • 13
  • 14
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs005.html b/doc/pub/week41/html/._week41-bs005.html index 3fe00c896..86bc79bf0 100644 --- a/doc/pub/week41/html/._week41-bs005.html +++ b/doc/pub/week41/html/._week41-bs005.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -372,7 +550,7 @@ a weight variable.
  • 14
  • 15
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs006.html b/doc/pub/week41/html/._week41-bs006.html index 2468d9c9c..d7a28345a 100644 --- a/doc/pub/week41/html/._week41-bs006.html +++ b/doc/pub/week41/html/._week41-bs006.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -421,7 +599,7 @@ humanities to life science and medicine.
  • 15
  • 16
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs007.html b/doc/pub/week41/html/._week41-bs007.html index 5910e8bfc..990a96dd2 100644 --- a/doc/pub/week41/html/._week41-bs007.html +++ b/doc/pub/week41/html/._week41-bs007.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -387,7 +565,7 @@ methods we discussed earlier.
  • 16
  • 17
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs008.html b/doc/pub/week41/html/._week41-bs008.html index 76a9e418a..9dc581225 100644 --- a/doc/pub/week41/html/._week41-bs008.html +++ b/doc/pub/week41/html/._week41-bs008.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -379,7 +557,7 @@ to all nodes in the subsequent layer, making this a so-called
  • 17
  • 18
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs009.html b/doc/pub/week41/html/._week41-bs009.html index 6c7dad006..762033d61 100644 --- a/doc/pub/week41/html/._week41-bs009.html +++ b/doc/pub/week41/html/._week41-bs009.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -388,7 +566,7 @@ recognition.
  • 18
  • 19
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs010.html b/doc/pub/week41/html/._week41-bs010.html index c1a686a1d..bacbd8b52 100644 --- a/doc/pub/week41/html/._week41-bs010.html +++ b/doc/pub/week41/html/._week41-bs010.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -380,7 +558,7 @@ especially well-suited for handwriting and speech recognition.
  • 19
  • 20
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs011.html b/doc/pub/week41/html/._week41-bs011.html index 0cdac594a..b2a474b05 100644 --- a/doc/pub/week41/html/._week41-bs011.html +++ b/doc/pub/week41/html/._week41-bs011.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -380,7 +558,7 @@ type of NN due the unusual activation functions.
  • 20
  • 21
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs012.html b/doc/pub/week41/html/._week41-bs012.html index 3e40e568a..ce111f58a 100644 --- a/doc/pub/week41/html/._week41-bs012.html +++ b/doc/pub/week41/html/._week41-bs012.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -376,7 +554,7 @@ activation functions.
  • 21
  • 22
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs013.html b/doc/pub/week41/html/._week41-bs013.html index 43e1b76fe..361a742c8 100644 --- a/doc/pub/week41/html/._week41-bs013.html +++ b/doc/pub/week41/html/._week41-bs013.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -381,7 +559,7 @@ as to not restrict the range of output values.
  • 22
  • 23
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs014.html b/doc/pub/week41/html/._week41-bs014.html index f74d680a6..1ba037ff4 100644 --- a/doc/pub/week41/html/._week41-bs014.html +++ b/doc/pub/week41/html/._week41-bs014.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -376,7 +554,7 @@ MathJax.Hub.Config({
  • 23
  • 24
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs015.html b/doc/pub/week41/html/._week41-bs015.html index 0e0a86f6b..2ec31a7e8 100644 --- a/doc/pub/week41/html/._week41-bs015.html +++ b/doc/pub/week41/html/._week41-bs015.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -429,7 +607,7 @@ ThetaAND = Xinv 24
  • 25
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs016.html b/doc/pub/week41/html/._week41-bs016.html index a7fb82f1d..154055d63 100644 --- a/doc/pub/week41/html/._week41-bs016.html +++ b/doc/pub/week41/html/._week41-bs016.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -441,7 +619,7 @@ logreg.fit(X, yAND)
  • 25
  • 26
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs017.html b/doc/pub/week41/html/._week41-bs017.html index 8539ee87b..767b07ac2 100644 --- a/doc/pub/week41/html/._week41-bs017.html +++ b/doc/pub/week41/html/._week41-bs017.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -399,7 +577,7 @@ FFNN.predict_proba(X)
  • 26
  • 27
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs018.html b/doc/pub/week41/html/._week41-bs018.html index 1a09ab719..d97942def 100644 --- a/doc/pub/week41/html/._week41-bs018.html +++ b/doc/pub/week41/html/._week41-bs018.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,20 +519,18 @@ MathJax.Hub.Config({

     

     

     

    -

    Mathematical model

    +

    Mathematics of deep learning

    -

    The output \( y \) is produced via the activation function \( f \)

    -$$ - y = f\left(\sum_{i=1}^n w_ix_i + b_i\right) = f(z), -$$ +
    + +
    -

    This function receives \( x_i \) as inputs. -Here the activation \( z=(\sum_{i=1}^n w_ix_i+b_i) \). -In an FFNN of such neurons, the inputs \( x_i \) are the outputs of -the neurons in the preceding layer. Furthermore, an MLP is -fully-connected, which means that each neuron receives a weighted sum -of the outputs of all neurons in the previous layer. -

    @@ -381,7 +557,7 @@ of the outputs of all neurons in the previous layer.

  • 27
  • 28
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs019.html b/doc/pub/week41/html/._week41-bs019.html index e0b2a41c8..ee22017c9 100644 --- a/doc/pub/week41/html/._week41-bs019.html +++ b/doc/pub/week41/html/._week41-bs019.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,48 +519,16 @@ MathJax.Hub.Config({

     

     

     

    -

    Mathematical model

    +

    Reminder on books with hands-on material and codes

    +
    + +
    -

    First, for each node \( i \) in the first hidden layer, we calculate a weighted sum \( z_i^1 \) of the input coordinates \( x_j \),

    - -$$ -\begin{equation} z_i^1 = \sum_{j=1}^{M} w_{ij}^1 x_j + b_i^1 -\tag{2} -\end{equation} -$$ - -

    Here \( b_i \) is the so-called bias which is normally needed in -case of zero activation weights or inputs. How to fix the biases and -the weights will be discussed below. The value of \( z_i^1 \) is the -argument to the activation function \( f_i \) of each node \( i \), The -variable \( M \) stands for all possible inputs to a given node \( i \) in the -first layer. We define the output \( y_i^1 \) of all neurons in layer 1 as -

    - -$$ -\begin{equation} - y_i^1 = f(z_i^1) = f\left(\sum_{j=1}^M w_{ij}^1 x_j + b_i^1\right) -\tag{3} -\end{equation} -$$ - -

    where we assume that all nodes in the same layer have identical -activation functions, hence the notation \( f \). In general, we could assume in the more general case that different layers have different activation functions. -In this case we would identify these functions with a superscript \( l \) for the \( l \)-th layer, -

    - -$$ -\begin{equation} - y_i^l = f^l(u_i^l) = f^l\left(\sum_{j=1}^{N_{l-1}} w_{ij}^l y_j^{l-1} + b_i^l\right) -\tag{4} -\end{equation} -$$ - -

    where \( N_l \) is the number of nodes in layer \( l \). When the output of -all the nodes in the first hidden layer are computed, the values of -the subsequent layer can be calculated and so forth until the output -is obtained. -

    @@ -409,7 +555,7 @@ is obtained.

  • 28
  • 29
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs020.html b/doc/pub/week41/html/._week41-bs020.html index 61a018ec7..30099a2c9 100644 --- a/doc/pub/week41/html/._week41-bs020.html +++ b/doc/pub/week41/html/._week41-bs020.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,32 +519,12 @@ MathJax.Hub.Config({

     

     

     

    -

    Mathematical model

    - -

    The output of neuron \( i \) in layer 2 is thus,

    - -$$ -\begin{align} - y_i^2 &= f^2\left(\sum_{j=1}^N w_{ij}^2 y_j^1 + b_i^2\right) -\tag{5}\\ - &= f^2\left[\sum_{j=1}^N w_{ij}^2f^1\left(\sum_{k=1}^M w_{jk}^1 x_k + b_j^1\right) + b_i^2\right] -\tag{6} -\end{align} -$$ - -

    where we have substituted \( y_k^1 \) with the inputs \( x_k \). Finally, the ANN output reads

    - -$$ -\begin{align} - y_i^3 &= f^3\left(\sum_{j=1}^N w_{ij}^3 y_j^2 + b_i^3\right) -\tag{7}\\ - &= f_3\left[\sum_{j} w_{ij}^3 f^2\left(\sum_{k} w_{jk}^2 f^1\left(\sum_{m} w_{km}^1 x_m + b_k^1\right) + b_j^2\right) - + b_1^3\right] -\tag{8} -\end{align} -$$ - +

    Reading recommendations

    +
      +
    1. Rashkca et al., chapter 11, jupyter-notebook sent separately, from GitHub
    2. +
    3. Goodfellow et al, chapter 6 and 7 contain most of the neural network background.
    4. +

    diff --git a/doc/pub/week41/html/._week41-bs021.html b/doc/pub/week41/html/._week41-bs021.html index 52173f3ab..d9343a38e 100644 --- a/doc/pub/week41/html/._week41-bs021.html +++ b/doc/pub/week41/html/._week41-bs021.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,21 +519,16 @@ MathJax.Hub.Config({

     

     

     

    -

    Mathematical model

    +

    Mathematics of deep learning and neural networks

    -

    We can generalize this expression to an MLP with \( l \) hidden -layers. The complete functional form is, -

    - -$$ -\begin{align} -&y^{l+1}_i = f^{l+1}\left[\!\sum_{j=1}^{N_l} w_{ij}^3 f^l\left(\sum_{k=1}^{N_{l-1}}w_{jk}^{l-1}\left(\dots f^1\left(\sum_{n=1}^{N_0} w_{mn}^1 x_n+ b_m^1\right)\dots\right)+b_k^2\right)+b_1^3\right] && -\tag{9} -\end{align} -$$ - -

    which illustrates a basic property of MLPs: The only independent -variables are the input values \( x_n \). +

    Neural networks, in its so-called feed-forward form, where each +iterations contains a feed-forward stage and a back-propgagation +stage, consist of series of affine matrix-matrix and matrix-vector +multiplications. The unknown parameters (the so-called biases and +weights which deternine the architecture of a neural network), are +uptaded iteratively using the so-called back-propagation algorithm. +This algorithm corresponds to the so-called reverse mode of +automatic differentation.

    @@ -383,7 +556,7 @@ variables are the input values \( x_n \).

  • 30
  • 31
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs022.html b/doc/pub/week41/html/._week41-bs022.html index f49982c83..daad49229 100644 --- a/doc/pub/week41/html/._week41-bs022.html +++ b/doc/pub/week41/html/._week41-bs022.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,31 +519,22 @@ MathJax.Hub.Config({

     

     

     

    -

    Mathematical model

    +

    Basics of an NN

    -

    This confirms that an MLP, despite its quite convoluted mathematical -form, is nothing more than an analytic function, specifically a -mapping of real-valued vectors \( \hat{x} \in \mathbb{R}^n \rightarrow -\hat{y} \in \mathbb{R}^m \). +

    A neural network consists of a series of hidden layers, in addition to +the input and output layers. Each layer \( l \) has a set of parameters +\( \boldsymbol{\Theta}^{(l)}=(\boldsymbol{W}^{(l)},\boldsymbol{b}^{(l)}) \) which are related to the +parameters in other layers through a series of affine transformations, +for a standard NN these are matrix-matrix and matrix-vector +multiplications. For all layers we will simply use a collective variable \( \boldsymbol{\Theta} \).

    -

    Furthermore, the flexibility and universality of an MLP can be -illustrated by realizing that the expression is essentially a nested -sum of scaled activation functions of the form -

    - -$$ -\begin{equation} - f(x) = c_1 f(c_2 x + c_3) + c_4 -\tag{10} -\end{equation} -$$ - -

    where the parameters \( c_i \) are weights and biases. By adjusting these -parameters, the activation functions can be shifted up and down or -left and right, change slope or be rescaled which is the key to the -flexibility of a neural network. -

    +

    It consist of two basic steps:

    +
      +
    1. a feed forward stage which takes a given input and produces a final output which is compared with the target values through our cost/loss function.
    2. +
    3. a back-propagation state where the unknown parameters \( \boldsymbol{\Theta} \) are updated through the optimization of the their gradients. The expressions for the gradients are obtained via the chain rule, starting from the derivative of the cost/function.
    4. +
    +

    These two steps make up one iteration. This iterative process is continued till we reach an eventual stopping criterion.

    @@ -392,7 +561,7 @@ flexibility of a neural network.

  • 31
  • 32
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs023.html b/doc/pub/week41/html/._week41-bs023.html index 4e54523da..bf7410778 100644 --- a/doc/pub/week41/html/._week41-bs023.html +++ b/doc/pub/week41/html/._week41-bs023.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,42 +519,23 @@ MathJax.Hub.Config({

     

     

     

    -

    Matrix-vector notation

    +

    Overarching view of a neural network

    -

    We can introduce a more convenient notation for the activations in an A NN.

    - -

    Additionally, we can represent the biases and activations -as layer-wise column vectors \( \hat{b}_l \) and \( \hat{y}_l \), so that the \( i \)-th element of each vector -is the bias \( b_i^l \) and activation \( y_i^l \) of node \( i \) in layer \( l \) respectively. +

    The architecture of a neural network defines our model. This model +aims at describing some function \( f(\boldsymbol{x} \) which represents +some final result (outputs or tagrget values) given a specific inpput +\( \boldsymbol{x} \). Note that here \( \boldsymbol{y} \) and \( \boldsymbol{x} \) are not limited to be +vectors.

    -

    We have that \( \mathrm{W}_l \) is an \( N_{l-1} \times N_l \) matrix, while \( \hat{b}_l \) and \( \hat{y}_l \) are \( N_l \times 1 \) column vectors. -With this notation, the sum becomes a matrix-vector multiplication, and we can write -the equation for the activations of hidden layer 2 (assuming three nodes for simplicity) as -

    -$$ -\begin{equation} - \hat{y}_2 = f_2(\mathrm{W}_2 \hat{y}_{1} + \hat{b}_{2}) = - f_2\left(\left[\begin{array}{ccc} - w^2_{11} &w^2_{12} &w^2_{13} \\ - w^2_{21} &w^2_{22} &w^2_{23} \\ - w^2_{31} &w^2_{32} &w^2_{33} \\ - \end{array} \right] \cdot - \left[\begin{array}{c} - y^1_1 \\ - y^1_2 \\ - y^1_3 \\ - \end{array}\right] + - \left[\begin{array}{c} - b^2_1 \\ - b^2_2 \\ - b^2_3 \\ - \end{array}\right]\right). -\tag{11} -\end{equation} -$$ - - +

    The architecture consists of

    +
      +
    1. An input and an output layer where the input layer is defined by the inputs \( \boldsymbol{x} \). The output layer produces the model ouput \( \boldsymbol{\tilde{y}} \) which is compared with the target value \( \boldsymbol{y} \)
    2. +
    3. A given number of hidden layers and neurons/nodes/units for each layer (this may vary)
    4. +
    5. A given activation function \( \sigma(\boldsymbol{z}) \) with arguments \( \boldsymbol{z} \) to be defined below. The activation functions may differ from layer to layer.
    6. +
    7. The last layer, normally called output layer has normally an activation function tailored to the specific problem
    8. +
    9. Finally we define a so-called cost or loss function which is used to gauge the quality of our model.
    10. +

    diff --git a/doc/pub/week41/html/._week41-bs024.html b/doc/pub/week41/html/._week41-bs024.html index fc24abaed..d68d705e3 100644 --- a/doc/pub/week41/html/._week41-bs024.html +++ b/doc/pub/week41/html/._week41-bs024.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,23 +519,22 @@ MathJax.Hub.Config({

     

     

     

    -

    Matrix-vector notation and activation

    +

    The optimization problem

    -

    The activation of node \( i \) in layer 2 is

    +

    The cost function is a function of the unknown parameters +\( \boldsymbol{\Theta} \) where the latter is a container for all possible +parameters needed to define a neural network +

    +

    If we are dealing with a regression task a typical cost/loss function +is the mean squared error +

    $$ -\begin{equation} - y^2_i = f_2\Bigr(w^2_{i1}y^1_1 + w^2_{i2}y^1_2 + w^2_{i3}y^1_3 + b^2_i\Bigr) = - f_2\left(\sum_{j=1}^3 w^2_{ij} y_j^1 + b^2_i\right). -\tag{12} -\end{equation} +C(\boldsymbol{\Theta})=\frac{1}{n}\left\{\left(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\right)^T\left(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\right)\right\}. $$ -

    This is not just a convenient and compact notation, but also a useful -and intuitive way to think about MLPs: The output is calculated by a -series of matrix-vector multiplications and vector additions that are -used as input to the activation functions. For each operation -\( \mathrm{W}_l \hat{y}_{l-1} \) we move forward one layer. +

    This function represents one of many possible ways to define +the so-called cost function. Note that here we have assumed a linear dependence in terms of the paramters \( \boldsymbol{\Theta} \). This is in general not the case.

    @@ -385,7 +562,7 @@ used as input to the activation functions. For each operation

  • 33
  • 34
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs025.html b/doc/pub/week41/html/._week41-bs025.html index 9ff173414..ec0b238cd 100644 --- a/doc/pub/week41/html/._week41-bs025.html +++ b/doc/pub/week41/html/._week41-bs025.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,20 +519,18 @@ MathJax.Hub.Config({

     

     

     

    -

    Activation functions

    - -

    A property that characterizes a neural network, other than its -connectivity, is the choice of activation function(s). As described -in, the following restrictions are imposed on an activation function -for a FFNN to fulfill the universal approximation theorem +

    Parameters of neural networks

    +

    For neural networks the parameters +\( \boldsymbol{\Theta} \) are given by the so-called weights and biases (to be +defined below). +

    + +

    The weights are given by matrix elements \( w_{ij}^{(l)} \) where the +superscript indicates the layer number. The biases are typically given +by vector elements representing each single node of a given layer, +that is \( b_j^{(l)} \).

    -

    diff --git a/doc/pub/week41/html/._week41-bs026.html b/doc/pub/week41/html/._week41-bs026.html index f0fa8b944..d41098641 100644 --- a/doc/pub/week41/html/._week41-bs026.html +++ b/doc/pub/week41/html/._week41-bs026.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,29 +519,25 @@ MathJax.Hub.Config({

     

     

     

    -

    Activation functions, Logistic and Hyperbolic ones

    +

    Other ingredients of a neural network

    -

    The second requirement excludes all linear functions. Furthermore, in -a MLP with only linear activation functions, each layer simply -performs a linear transformation of its inputs. +

    Having defined the architecture of a neural network, the optimization +of the cost function with respect to the parameters \( \boldsymbol{\Theta} \), +involves the calculations of gradients and their optimization. The +gradients represent the derivatives of a multidimensional object and +are often approximated by various gradient methods, including

    - -

    Regardless of the number of layers, the output of the NN will be -nothing but a linear function of the inputs. Thus we need to introduce -some kind of non-linearity to the NN to be able to fit non-linear -functions Typical examples are the logistic Sigmoid -

    - -$$ - f(x) = \frac{1}{1 + e^{-x}}, -$$ - -

    and the hyperbolic tangent function

    -$$ - f(x) = \tanh(x) -$$ - - +
      +
    1. various quasi-Newton methods,
    2. +
    3. plain gradient descent (GD) with a constant learning rate \( \eta \),
    4. +
    5. GD with momentum and other approximations to the learning rates such as
    6. + +
    7. Stochastic gradient descent and various families of learning rate approximations
    8. +

    diff --git a/doc/pub/week41/html/._week41-bs027.html b/doc/pub/week41/html/._week41-bs027.html index da3f819be..7a8eea069 100644 --- a/doc/pub/week41/html/._week41-bs027.html +++ b/doc/pub/week41/html/._week41-bs027.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,109 +519,13 @@ MathJax.Hub.Config({

     

     

     

    -

    Relevance

    +

    Other parameters

    -

    The sigmoid function are more biologically plausible because the -output of inactive neurons are zero. Such activation function are -called one-sided. However, it has been shown that the hyperbolic -tangent performs better than the sigmoid for training MLPs. has -become the most popular for deep neural networks +

    In addition to the above, there are often additional hyperparamaters +which are included in the setup of a neural network. These will be +discussed below.

    - - -
    -
    -
    -
    -
    -
    """The sigmoid function (or the logistic curve) is a 
    -function that takes any real number, z, and outputs a number (0,1).
    -It is useful in neural networks for assigning weights on a relative scale.
    -The value z is the weighted sum of parameters involved in the learning algorithm."""
    -
    -import numpy
    -import matplotlib.pyplot as plt
    -import math as mt
    -
    -z = numpy.arange(-5, 5, .1)
    -sigma_fn = numpy.vectorize(lambda z: 1/(1+numpy.exp(-z)))
    -sigma = sigma_fn(z)
    -
    -fig = plt.figure()
    -ax = fig.add_subplot(111)
    -ax.plot(z, sigma)
    -ax.set_ylim([-0.1, 1.1])
    -ax.set_xlim([-5,5])
    -ax.grid(True)
    -ax.set_xlabel('z')
    -ax.set_title('sigmoid function')
    -
    -plt.show()
    -
    -"""Step Function"""
    -z = numpy.arange(-5, 5, .02)
    -step_fn = numpy.vectorize(lambda z: 1.0 if z >= 0.0 else 0.0)
    -step = step_fn(z)
    -
    -fig = plt.figure()
    -ax = fig.add_subplot(111)
    -ax.plot(z, step)
    -ax.set_ylim([-0.5, 1.5])
    -ax.set_xlim([-5,5])
    -ax.grid(True)
    -ax.set_xlabel('z')
    -ax.set_title('step function')
    -
    -plt.show()
    -
    -"""Sine Function"""
    -z = numpy.arange(-2*mt.pi, 2*mt.pi, 0.1)
    -t = numpy.sin(z)
    -
    -fig = plt.figure()
    -ax = fig.add_subplot(111)
    -ax.plot(z, t)
    -ax.set_ylim([-1.0, 1.0])
    -ax.set_xlim([-2*mt.pi,2*mt.pi])
    -ax.grid(True)
    -ax.set_xlabel('z')
    -ax.set_title('sine function')
    -
    -plt.show()
    -
    -"""Plots a graph of the squashing function used by a rectified linear
    -unit"""
    -z = numpy.arange(-2, 2, .1)
    -zero = numpy.zeros(len(z))
    -y = numpy.max([zero, z], axis=0)
    -
    -fig = plt.figure()
    -ax = fig.add_subplot(111)
    -ax.plot(z, y)
    -ax.set_ylim([-2.0, 2.0])
    -ax.set_xlim([-2.0, 2.0])
    -ax.grid(True)
    -ax.set_xlabel('z')
    -ax.set_title('Rectified linear unit')
    -
    -plt.show()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    diff --git a/doc/pub/week41/html/._week41-bs028.html b/doc/pub/week41/html/._week41-bs028.html index 26b4c049b..75caeff2a 100644 --- a/doc/pub/week41/html/._week41-bs028.html +++ b/doc/pub/week41/html/._week41-bs028.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,38 +519,33 @@ MathJax.Hub.Config({

     

     

     

    -

    The multilayer perceptron (MLP)

    +

    Universal approximation theorem

    -

    The multilayer perceptron is a very popular, and easy to implement approach, to deep learning. It consists of

    -
      -
    1. A neural network with one or more layers of nodes between the input and the output nodes.
    2. -
    3. The multilayer network structure, or architecture, or topology, consists of an input layer, one or more hidden layers, and one output layer.
    4. -
    5. The input nodes pass values to the first hidden layer, its nodes pass the information on to the second and so on till we reach the output layer.
    6. -
    -

    As a convention it is normal to call a network with one layer of input units, one layer of hidden -units and one layer of output units as a two-layer network. A network with two layers of hidden units is called a three-layer network etc etc. +

    The universal approximation theorem plays a central role in deep +learning. Cybenko (1989) showed +the following:

    -

    For an MLP network there is no direct connection between the output nodes/neurons/units and the input nodes/neurons/units. -Hereafter we will call the various entities of a layer for nodes. -There are also no connections within a single layer. -

    +
    +
    + +

    Let \( \sigma \) be any continuous sigmoidal function such that

    +$$ +\sigma(z) = \left\{\begin{array}{cc} 1 & z\rightarrow \infty\\ 0 & z \rightarrow -\infty \end{array}\right. +$$ -

    The number of input nodes does not need to equal the number of output -nodes. This applies also to the hidden layers. Each layer may have its -own number of nodes and activation functions. +

    Given a continuous and deterministic function \( F(\boldsymbol{x}) \) on the unit +cube in \( d \)-dimensions \( F\in [0,1]^d \), \( x\in [0,1]^d \) and a parameter +\( \epsilon >0 \), there is a one-layer (hidden) neural network +\( f(\boldsymbol{x};\boldsymbol{\Theta}) \) with \( \boldsymbol{\Theta}=(\boldsymbol{W},\boldsymbol{b}) \) and \( \boldsymbol{W}\in +\mathbb{R}^{m\times n} \) and \( \boldsymbol{b}\in \mathbb{R}^{n} \), for which

    +$$ +\vert F(\boldsymbol{x})-f(\boldsymbol{x};\boldsymbol{\Theta})\vert < \epsilon \hspace{0.1cm} \forall \boldsymbol{x}\in[0,1]^d. +$$ +
    +
    -

    The hidden layers have their name from the fact that they are not -linked to observables and as we will see below when we define the -so-called activation \( \hat{z} \), we can think of this as a basis -expansion of the original inputs \( \hat{x} \). The difference however -between neural networks and say linear regression is that now these -basis functions (which will correspond to the weights in the network) -are learned from data. This results in an important difference between -neural networks and deep learning approaches on one side and methods -like logistic regression or linear regression and their modifications on the other side. -

    @@ -399,7 +572,7 @@ like logistic regression or linear regression and their modifications on the oth

  • 37
  • 38
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs029.html b/doc/pub/week41/html/._week41-bs029.html index c54484553..2a8a93468 100644 --- a/doc/pub/week41/html/._week41-bs029.html +++ b/doc/pub/week41/html/._week41-bs029.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,29 +519,13 @@ MathJax.Hub.Config({

     

     

     

    -

    From one to many layers, the universal approximation theorem

    +

    Some parallels from real analysis

    -

    A neural network with only one layer, what we called the simple -perceptron, is best suited if we have a standard binary model with -clear (linear) boundaries between the outcomes. As such it could -equally well be replaced by standard linear regression or logistic -regression. Networks with one or more hidden layers approximate -systems with more complex boundaries. -

    - -

    As stated earlier, -an important theorem in studies of neural networks, restated without -proof here, is the universal approximation -theorem. -

    - -

    It states that a feed-forward network with a single hidden layer -containing a finite number of neurons can approximate continuous -functions on compact subsets of real functions. The theorem thus -states that simple neural networks can represent a wide variety of -interesting functions when given appropriate parameters. It is the -multilayer feedforward architecture itself which gives neural networks -the potential of being universal approximators. +

    For those of you familiar with for example the Stone-Weierstrass +theorem +for polynomial approximations or the convergence criterion for Fourier +series, there are similarities in the derivation of the proof for +neural networks.

    @@ -391,7 +553,7 @@ the potential of being universal approximators.

  • 38
  • 39
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs030.html b/doc/pub/week41/html/._week41-bs030.html index cb4907c31..c488f9b55 100644 --- a/doc/pub/week41/html/._week41-bs030.html +++ b/doc/pub/week41/html/._week41-bs030.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,33 +519,23 @@ MathJax.Hub.Config({

     

     

     

    -

    Deriving the back propagation code for a multilayer perceptron model

    +

    The approximation theorem in words

    -

    As we have seen now in a feed forward network, we can express the final output of our network in terms of basic matrix-vector multiplications. -The unknowwn quantities are our weights \( w_{ij} \) and we need to find an algorithm for changing them so that our errors are as small as possible. -This leads us to the famous back propagation algorithm. -

    - -

    The questions we want to ask are how do changes in the biases and the -weights in our network change the cost function and how can we use the -final output to modify the weights? -

    - -

    To derive these equations let us start with a plain regression problem -and define our cost function as +

    Any continuous function \( y=F(\boldsymbol{x}) \) supported on the unit cube in +\( d \)-dimensions can be approximated by a one-layer sigmoidal network to +arbitrary accuracy.

    +

    Hornik (1991) extended the theorem by letting any non-constant, bounded activation function to be included using that the expectation value

    $$ -{\cal C}(\hat{W}) = \frac{1}{2}\sum_{i=1}^n\left(y_i - t_i\right)^2, +\mathbb{E}[\vert F(\boldsymbol{x})\vert^2] =\int_{\boldsymbol{x}\in D} \vert F(\boldsymbol{x})\vert^2p(\boldsymbol{x})d\boldsymbol{x} < \infty. +$$ + +

    Then we have

    +$$ +\mathbb{E}[\vert F(\boldsymbol{x})-f(\boldsymbol{x};\boldsymbol{\Theta})\vert^2] =\int_{\boldsymbol{x}\in D} \vert F(\boldsymbol{x})-f(\boldsymbol{x};\boldsymbol{\Theta})\vert^2p(\boldsymbol{x})d\boldsymbol{x} < \epsilon. $$ -

    where the $t_i$s are our \( n \) targets (the values we want to -reproduce), while the outputs of the network after having propagated -all inputs \( \hat{x} \) are given by \( y_i \). Below we will demonstrate -how the basic equations arising from the back propagation algorithm -can be modified in order to study classification problems with \( K \) -classes. -

    @@ -394,7 +562,7 @@ classes.

  • 39
  • 40
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs031.html b/doc/pub/week41/html/._week41-bs031.html index 29aa502f2..0d22b4e38 100644 --- a/doc/pub/week41/html/._week41-bs031.html +++ b/doc/pub/week41/html/._week41-bs031.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,40 +519,21 @@ MathJax.Hub.Config({

     

     

     

    -

    Definitions

    +

    More on the general approximation theorem

    -

    With our definition of the targets \( \hat{t} \), the outputs of the -network \( \hat{y} \) and the inputs \( \hat{x} \) we -define now the activation \( z_j^l \) of node/neuron/unit \( j \) of the -\( l \)-th layer as a function of the bias, the weights which add up from -the previous layer \( l-1 \) and the forward passes/outputs -\( \hat{a}^{l-1} \) from the previous layer as +

    None of the proofs give any insight into the relation between the +number of of hidden layers and nodes and the approximation error +\( \epsilon \), nor the magnitudes of \( \boldsymbol{W} \) and \( \boldsymbol{b} \).

    -$$ -z_j^l = \sum_{i=1}^{M_{l-1}}w_{ij}^la_i^{l-1}+b_j^l, -$$ +

    Neural networks (NNs) have what we may call a kind of universality no matter what function we want to compute.

    -

    where \( b_k^l \) are the biases from layer \( l \). Here \( M_{l-1} \) -represents the total number of nodes/neurons/units of layer \( l-1 \). The -figure here illustrates this equation. We can rewrite this in a more -compact form as the matrix-vector products we discussed earlier, -

    - -$$ -\hat{z}^l = \left(\hat{W}^l\right)^T\hat{a}^{l-1}+\hat{b}^l. -$$ - -

    With the activation values \( \hat{z}^l \) we can in turn define the -output of layer \( l \) as \( \hat{a}^l = f(\hat{z}^l) \) where \( f \) is our -activation function. In the examples here we will use the sigmoid -function discussed in our logistic regression lectures. We will also use the same activation function \( f \) for all layers -and their nodes. It means we have -

    - -$$ -a_j^l = f(z_j^l) = \frac{1}{1+\exp{-(z_j^l)}}. -$$ +
    +
    + +

    It does not mean that an NN can be used to exactly compute any function. Rather, we get an approximation that is as good as we want.

    +
    +

    @@ -402,7 +561,7 @@ $$

  • 40
  • 41
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs032.html b/doc/pub/week41/html/._week41-bs032.html index a922f2f91..d182f0f7f 100644 --- a/doc/pub/week41/html/._week41-bs032.html +++ b/doc/pub/week41/html/._week41-bs032.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,22 +519,16 @@ MathJax.Hub.Config({

     

     

     

    -

    Derivatives and the chain rule

    +

    Class of functions we can approximate

    -

    From the definition of the activation \( z_j^l \) we have

    -$$ -\frac{\partial z_j^l}{\partial w_{ij}^l} = a_i^{l-1}, -$$ - -

    and

    -$$ -\frac{\partial z_j^l}{\partial a_i^{l-1}} = w_{ji}^l. -$$ - -

    With our definition of the activation function we have that (note that this function depends only on \( z_j^l \))

    -$$ -\frac{\partial a_j^l}{\partial z_j^{l}} = a_j^l(1-a_j^l)=f(z_j^l)(1-f(z_j^l)). -$$ +
    +
    + +

    The class of functions that can be approximated are the continuous ones. +If the function \( F(\boldsymbol{x}) \) is discontinuous, it won't in general be possible to approximate it. However, an NN may still give an approximation even if we fail in some points. +

    +
    +

    @@ -384,7 +556,7 @@ $$

  • 41
  • 42
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs033.html b/doc/pub/week41/html/._week41-bs033.html index beca08e04..69c5acb2a 100644 --- a/doc/pub/week41/html/._week41-bs033.html +++ b/doc/pub/week41/html/._week41-bs033.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,26 +519,25 @@ MathJax.Hub.Config({

     

     

     

    -

    Derivative of the cost function

    +

    Setting up the equations for a neural network

    -

    With these definitions we can now compute the derivative of the cost function in terms of the weights.

    +

    The questions we want to ask are how do changes in the biases and the +weights in our network change the cost function and how can we use the +final output to modify the weights and biases? +

    -

    Let us specialize to the output layer \( l=L \). Our cost function is

    -$$ -{\cal C}(\hat{W^L}) = \frac{1}{2}\sum_{i=1}^n\left(y_i - t_i\right)^2=\frac{1}{2}\sum_{i=1}^n\left(a_i^L - t_i\right)^2, -$$ - -

    The derivative of this function with respect to the weights is

    +

    To derive these equations let us start with a plain regression problem +and define our cost function as +

    $$ -\frac{\partial{\cal C}(\hat{W^L})}{\partial w_{jk}^L} = \left(a_j^L - t_j\right)\frac{\partial a_j^L}{\partial w_{jk}^{L}}, -$$ - -

    The last partial derivative can easily be computed and reads (by applying the chain rule)

    -$$ -\frac{\partial a_j^L}{\partial w_{jk}^{L}} = \frac{\partial a_j^L}{\partial z_{j}^{L}}\frac{\partial z_j^L}{\partial w_{jk}^{L}}=a_j^L(1-a_j^L)a_k^{L-1}, +{\cal C}(\boldsymbol{\Theta}) = \frac{1}{2}\sum_{i=1}^n\left(y_i - \tilde{y}_i\right)^2, $$ +

    where the $y_i$s are our \( n \) targets (the values we want to +reproduce), while the outputs of the network after having propagated +all inputs \( \boldsymbol{x} \) are given by \( \boldsymbol{\tilde{y}}_i \). +

    @@ -387,7 +564,7 @@ $$

  • 42
  • 43
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs034.html b/doc/pub/week41/html/._week41-bs034.html index f96c786bb..5a7d512fa 100644 --- a/doc/pub/week41/html/._week41-bs034.html +++ b/doc/pub/week41/html/._week41-bs034.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,50 +519,13 @@ MathJax.Hub.Config({

     

     

     

    -

    Bringing it together, first back propagation equation

    - -

    We have thus

    -$$ -\frac{\partial{\cal C}(\hat{W^L})}{\partial w_{jk}^L} = \left(a_j^L - t_j\right)a_j^L(1-a_j^L)a_k^{L-1}, -$$ - -

    Defining

    -$$ -\delta_j^L = a_j^L(1-a_j^L)\left(a_j^L - t_j\right) = f'(z_j^L)\frac{\partial {\cal C}}{\partial (a_j^L)}, -$$ - -

    and using the Hadamard product of two vectors we can write this as

    -$$ -\hat{\delta}^L = f'(\hat{z}^L)\circ\frac{\partial {\cal C}}{\partial (\hat{a}^L)}. -$$ - -

    This is an important expression. The second term on the right handside -measures how fast the cost function is changing as a function of the $j$th -output activation. If, for example, the cost function doesn't depend -much on a particular output node \( j \), then \( \delta_j^L \) will be small, -which is what we would expect. The first term on the right, measures -how fast the activation function \( f \) is changing at a given activation -value \( z_j^L \). -

    - -

    Notice that everything in the above equations is easily computed. In -particular, we compute \( z_j^L \) while computing the behaviour of the -network, and it is only a small additional overhead to compute -\( f'(z^L_j) \). The exact form of the derivative with respect to the -output depends on the form of the cost function. -However, provided the cost function is known there should be little -trouble in calculating -

    - -$$ -\frac{\partial {\cal C}}{\partial (a_j^L)} -$$ - -

    With the definition of \( \delta_j^L \) we have a more compact definition of the derivative of the cost function in terms of the weights, namely

    -$$ -\frac{\partial{\cal C}(\hat{W^L})}{\partial w_{jk}^L} = \delta_j^La_k^{L-1}. -$$ +

    Layout of a neural network with three hidden layers

    +

    +
    +

    +
    +

    @@ -411,7 +552,7 @@ $$

  • 43
  • 44
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs035.html b/doc/pub/week41/html/._week41-bs035.html index f7f3ea6f2..6d6048d35 100644 --- a/doc/pub/week41/html/._week41-bs035.html +++ b/doc/pub/week41/html/._week41-bs035.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,20 +519,31 @@ MathJax.Hub.Config({

     

     

     

    -

    Derivatives in terms of \( z_j^L \)

    +

    Definitions

    -

    It is also easy to see that our previous equation can be written as

    +

    With our definition of the targets \( \boldsymbol{y} \), the outputs of the +network \( \boldsymbol{\tilde{y}} \) and the inputs \( \boldsymbol{x} \) we +define now the activation \( z_j^l \) of node/neuron/unit \( j \) of the +\( l \)-th layer as a function of the bias, the weights which add up from +the previous layer \( l-1 \) and the forward passes/outputs +\( \hat{a}^{l-1} \) from the previous layer as +

    $$ -\delta_j^L =\frac{\partial {\cal C}}{\partial z_j^L}= \frac{\partial {\cal C}}{\partial a_j^L}\frac{\partial a_j^L}{\partial z_j^L}, +z_j^l = \sum_{i=1}^{M_{l-1}}w_{ij}^la_i^{l-1}+b_j^l, $$ -

    which can also be interpreted as the partial derivative of the cost function with respect to the biases \( b_j^L \), namely

    +

    where \( b_k^l \) are the biases from layer \( l \). Here \( M_{l-1} \) +represents the total number of nodes/neurons/units of layer \( l-1 \). The +figure in the whiteboard notes illustrates this equation. We can rewrite this in a more +compact form as the matrix-vector products we discussed earlier, +

    + $$ -\delta_j^L = \frac{\partial {\cal C}}{\partial b_j^L}\frac{\partial b_j^L}{\partial z_j^L}=\frac{\partial {\cal C}}{\partial b_j^L}, +\hat{z}^l = \left(\hat{W}^l\right)^T\hat{a}^{l-1}+\hat{b}^l. $$ -

    That is, the error \( \delta_j^L \) is exactly equal to the rate of change of the cost function as a function of the bias.

    +

    diff --git a/doc/pub/week41/html/._week41-bs036.html b/doc/pub/week41/html/._week41-bs036.html index 8d45f72c9..32a5720ac 100644 --- a/doc/pub/week41/html/._week41-bs036.html +++ b/doc/pub/week41/html/._week41-bs036.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,62 +519,19 @@ MathJax.Hub.Config({

     

     

     

    -

    Bringing it together

    +

    Inputs to the activation function

    -

    We have now three equations that are essential for the computations of the derivatives of the cost function at the output layer. These equations are needed to start the algorithm and they are

    - -
    -
    - - -$$ -\begin{equation} -\frac{\partial{\cal C}(\hat{W^L})}{\partial w_{jk}^L} = \delta_j^La_k^{L-1}, -\tag{13} -\end{equation} -$$ - -

    and

    -$$ -\begin{equation} -\delta_j^L = f'(z_j^L)\frac{\partial {\cal C}}{\partial (a_j^L)}, -\tag{14} -\end{equation} -$$ - -

    and

    - -$$ -\begin{equation} -\delta_j^L = \frac{\partial {\cal C}}{\partial b_j^L}, -\tag{15} -\end{equation} -$$ -
    -
    - - -

    An interesting consequence of the above equations is that when the -activation \( a_k^{L-1} \) is small, the gradient term, that is the -derivative of the cost function with respect to the weights, will also -tend to be small. We say then that the weight learns slowly, meaning -that it changes slowly when we minimize the weights via say gradient -descent. In this case we say the system learns slowly. +

    With the activation values \( \boldsymbol{z}^l \) we can in turn define the +output of layer \( l \) as \( \boldsymbol{a}^l = f(\boldsymbol{z}^l) \) where \( f \) is our +activation function. In the examples here we will use the sigmoid +function discussed in our logistic regression lectures. We will also use the same activation function \( f \) for all layers +and their nodes. It means we have

    -

    Another interesting feature is that is when the activation function, -represented by the sigmoid function here, is rather flat when we move towards -its end values \( 0 \) and \( 1 \) (see the above Python codes). In these -cases, the derivatives of the activation function will also be close -to zero, meaning again that the gradients will be small and the -network learns slowly again. -

    +$$ +a_j^l = \sigma(z_j^l) = \frac{1}{1+\exp{-(z_j^l)}}. +$$ -

    We need a fourth equation and we are set. We are going to propagate -backwards in order to the determine the weights and biases. In order -to do so we need to represent the error in the layer before the final -one \( L-1 \) in terms of the errors in the final output layer. -

    @@ -423,7 +558,7 @@ one \( L-1 \) in terms of the errors in the final output layer.

  • 45
  • 46
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs037.html b/doc/pub/week41/html/._week41-bs037.html index 109cdad1a..a9c24d244 100644 --- a/doc/pub/week41/html/._week41-bs037.html +++ b/doc/pub/week41/html/._week41-bs037.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,32 +519,23 @@ MathJax.Hub.Config({

     

     

     

    -

    Final back propagating equation

    +

    Derivatives and the chain rule

    -

    We have that (replacing \( L \) with a general layer \( l \))

    +

    From the definition of the activation \( z_j^l \) we have

    $$ -\delta_j^l =\frac{\partial {\cal C}}{\partial z_j^l}. +\frac{\partial z_j^l}{\partial w_{ij}^l} = a_i^{l-1}, $$ -

    We want to express this in terms of the equations for layer \( l+1 \). Using the chain rule and summing over all \( k \) entries we have

    - +

    and

    $$ -\delta_j^l =\sum_k \frac{\partial {\cal C}}{\partial z_k^{l+1}}\frac{\partial z_k^{l+1}}{\partial z_j^{l}}=\sum_k \delta_k^{l+1}\frac{\partial z_k^{l+1}}{\partial z_j^{l}}, +\frac{\partial z_j^l}{\partial a_i^{l-1}} = w_{ji}^l. $$ -

    and recalling that

    +

    With our definition of the activation function we have that (note that this function depends only on \( z_j^l \))

    $$ -z_j^{l+1} = \sum_{i=1}^{M_{l}}w_{ij}^{l+1}a_i^{l}+b_j^{l+1}, +\frac{\partial a_j^l}{\partial z_j^{l}} = a_j^l(1-a_j^l)=\sigma(z_j^l)(1-\sigma(z_j^l)). $$ -

    with \( M_l \) being the number of nodes in layer \( l \), we obtain

    -$$ -\delta_j^l =\sum_k \delta_k^{l+1}w_{kj}^{l+1}f'(z_j^l), -$$ - -

    This is our final equation.

    - -

    We are now ready to set up the algorithm for back propagation and learning the weights and biases.

    @@ -393,7 +562,7 @@ $$

  • 46
  • 47
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs038.html b/doc/pub/week41/html/._week41-bs038.html index 20ecfbdbd..79a25237a 100644 --- a/doc/pub/week41/html/._week41-bs038.html +++ b/doc/pub/week41/html/._week41-bs038.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,74 +519,26 @@ MathJax.Hub.Config({

     

     

     

    -

    Setting up the Back propagation algorithm

    +

    Derivative of the cost function

    -

    The four equations provide us with a way of computing the gradient of the cost function. Let us write this out in the form of an algorithm.

    +

    With these definitions we can now compute the derivative of the cost function in terms of the weights.

    -
    -
    - -

    First, we set up the input data \( \hat{x} \) and the activations -\( \hat{z}_1 \) of the input layer and compute the activation function and -the pertinent outputs \( \hat{a}^1 \). -

    -
    -
    - - -
    -
    - -

    Secondly, we perform then the feed forward till we reach the output -layer and compute all \( \hat{z}_l \) of the input layer and compute the -activation function and the pertinent outputs \( \hat{a}^l \) for -\( l=2,3,\dots,L \). -

    -
    -
    - - -
    -
    - -

    Thereafter we compute the ouput error \( \hat{\delta}^L \) by computing all

    +

    Let us specialize to the output layer \( l=L \). Our cost function is

    $$ -\delta_j^L = f'(z_j^L)\frac{\partial {\cal C}}{\partial (a_j^L)}. -$$ -
    -
    - - -
    -
    - -

    Then we compute the back propagate error for each \( l=L-1,L-2,\dots,2 \) as

    -$$ -\delta_j^l = \sum_k \delta_k^{l+1}w_{kj}^{l+1}f'(z_j^l). -$$ -
    -
    - - -
    -
    - -

    Finally, we update the weights and the biases using gradient descent for each \( l=L-1,L-2,\dots,2 \) and update the weights and biases according to the rules

    -$$ -w_{jk}^l\leftarrow = w_{jk}^l- \eta \delta_j^la_k^{l-1}, +{\cal C}(\boldsymbol{\Theta}^L) = \frac{1}{2}\sum_{i=1}^n\left(y_i - \tilde{y}_i\right)^2=\frac{1}{2}\sum_{i=1}^n\left(a_i^L - y_i\right)^2, $$ +

    The derivative of this function with respect to the weights is

    $$ -b_j^l \leftarrow b_j^l-\eta \frac{\partial {\cal C}}{\partial b_j^l}=b_j^l-\eta \delta_j^l, +\frac{\partial{\cal C}(\boldsymbol{\Theta}^L)}{\partial w_{jk}^L} = \left(a_j^L - y_j\right)\frac{\partial a_j^L}{\partial w_{jk}^{L}}, $$ -
    -
    +

    The last partial derivative can easily be computed and reads (by applying the chain rule)

    +$$ +\frac{\partial a_j^L}{\partial w_{jk}^{L}} = \frac{\partial a_j^L}{\partial z_{j}^{L}}\frac{\partial z_j^L}{\partial w_{jk}^{L}}=a_j^L(1-a_j^L)a_k^{L-1}. +$$ -

    The parameter \( \eta \) is the learning parameter discussed in connection with the gradient descent methods. -Here it is convenient to use stochastic gradient descent (see the examples below) with mini-batches with an outer loop that steps through multiple epochs of training. -

    @@ -435,7 +565,7 @@ Here it is convenient to use stochastic gradient descent (see the examples below

  • 47
  • 48
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs039.html b/doc/pub/week41/html/._week41-bs039.html index 224632b2d..07ae6966b 100644 --- a/doc/pub/week41/html/._week41-bs039.html +++ b/doc/pub/week41/html/._week41-bs039.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,73 +519,12 @@ MathJax.Hub.Config({

     

     

     

    -

    Setting up the Back propagation algorithm

    +

    Simpler examples first, and automatic differentiation

    -

    The four equations above provide us with a way of computing the gradient of the cost function. Let us write this out in the form of an algorithm.

    - -
    -
    - -

    First, we set up the input data \( \boldsymbol{x} \) and the activations -\( \boldsymbol{z}_1 \) of the input layer and compute the activation function and -the pertinent outputs \( \boldsymbol{a}^1 \). -

    -
    -
    - - -
    -
    - -

    Secondly, we perform then the feed forward till we reach the output -layer and compute all \( \boldsymbol{z}_l \) of the input layer and compute the -activation function and the pertinent outputs \( \boldsymbol{a}^l \) for -\( l=2,3,\dots,L \). -

    -
    -
    - - -
    -
    - -

    Thereafter we compute the ouput error \( \boldsymbol{\delta}^L \) by computing all

    -$$ -\delta_j^L = f'(z_j^L)\frac{\partial {\cal C}}{\partial (a_j^L)}. -$$ -
    -
    - - -
    -
    - -

    Then we compute the back propagate error for each \( l=L-1,L-2,\dots,2 \) as

    -$$ -\delta_j^l = \sum_k \delta_k^{l+1}w_{kj}^{l+1}f'(z_j^l). -$$ -
    -
    - - -
    -
    - -

    Finally, we update the weights and the biases using gradient descent for each \( l=L-1,L-2,\dots,2 \) and update the weights and biases according to the rules

    -$$ -w_{jk}^l\leftarrow = w_{jk}^l- \eta \delta_j^la_k^{l-1}, -$$ - - -$$ -b_j^l \leftarrow b_j^l-\eta \frac{\partial {\cal C}}{\partial b_j^l}=b_j^l-\eta \delta_j^l, -$$ -
    -
    - - -

    The parameter \( \eta \) is the learning parameter discussed in connection with the gradient descent methods. -Here it is convenient to use stochastic gradient descent (see the examples below) with mini-batches with an outer loop that steps through multiple epochs of training. +

    In order to understand the back propagation algorithm and its +derivation (an implementation of the chain rule), let us first digress +with some simple examples. These examples are also meant to motivate +the link with back propagation and automatic differentiation.

    @@ -435,7 +552,7 @@ Here it is convenient to use stochastic gradient descent (see the examples below

  • 48
  • 49
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs040.html b/doc/pub/week41/html/._week41-bs040.html index f3791b8f1..c5ba4260a 100644 --- a/doc/pub/week41/html/._week41-bs040.html +++ b/doc/pub/week41/html/._week41-bs040.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,75 +519,14 @@ MathJax.Hub.Config({

     

     

     

    -

    Setting up the Back propagation algorithm

    +

    Reminder on the chain rule and gradients

    -

    The four equations derived discussed above provide us with a way of computing the gradient of the cost function. Let us write this out in the form of an algorithm.

    - -
    -
    - -

    First, we set up the input data \( \boldsymbol{x} \) and the activations -\( \boldsymbol{z}_1 \) of the input layer and compute the activation function and -the pertinent outputs \( \boldsymbol{a}^1 \). -

    -
    -
    - - -
    -
    - -

    Secondly, we perform then the feed forward till we reach the output -layer and compute all \( \boldsymbol{z}_l \) of the input layer and compute the -activation function and the pertinent outputs \( \boldsymbol{a}^l \) for -\( l=2,3,\dots,L \). -

    -
    -
    - - -
    -
    - -

    Thereafter we compute the ouput error \( \boldsymbol{\delta}^L \) by computing all

    +

    If we have a multivariate function \( f(x,y) \) where \( x=x(t) \) and \( y=y(t) \) are functions of a variable \( t \), we have that the gradient of \( f \) with respect to \( t \) (without the explicit unit vector components)

    $$ -\delta_j^L = f'(z_j^L)\frac{\partial {\cal C}}{\partial (a_j^L)}. -$$ -
    -
    - - -
    -
    - -

    Then we compute the back propagate error for each \( l=L-1,L-2,\dots,2 \) as

    -$$ -\delta_j^l = \sum_k \delta_k^{l+1}w_{kj}^{l+1}f'(z_j^l). -$$ -
    -
    - - -
    -
    - -

    Finally, we update the weights and the biases using gradient descent for each \( l=L-1,L-2,\dots,2 \) and update the weights and biases according to the rules

    -$$ -w_{jk}^l\leftarrow = w_{jk}^l- \eta \delta_j^la_k^{l-1}, +\frac{df}{dt} = \begin{bmatrix}\frac{\partial f}{\partial x} & \frac{\partial f}{\partial y} \end{bmatrix} \begin{bmatrix}\frac{\partial x}{\partial t} \\ \frac{\partial y}{\partial t} \end{bmatrix}=\frac{\partial f}{\partial x} \frac{\partial x}{\partial t} +\frac{\partial f}{\partial y} \frac{\partial y}{\partial t}. $$ -$$ -b_j^l \leftarrow b_j^l-\eta \frac{\partial {\cal C}}{\partial b_j^l}=b_j^l-\eta \delta_j^l, -$$ -
    -
    - - -

    The parameter \( \eta \) is the learning parameter discussed in connection with the gradient descent methods. -Here it is convenient to use stochastic gradient descent (see the examples below) with mini-batches with an outer loop that steps through multiple epochs of training. -

    -

    diff --git a/doc/pub/week41/html/._week41-bs041.html b/doc/pub/week41/html/._week41-bs041.html index f26abe70b..cdf0ee02e 100644 --- a/doc/pub/week41/html/._week41-bs041.html +++ b/doc/pub/week41/html/._week41-bs041.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -340,41 +518,23 @@ MathJax.Hub.Config({

     

     

     

    - -

    Setting up a Multi-layer perceptron model for classification

    + +

    Multivariable functions

    -

    We are now gong to develop an example based on the MNIST data -base. This is a classification problem and we need to use our -cross-entropy function we discussed in connection with logistic -regression. The cross-entropy defines our cost function for the -classificaton problems with neural networks. -

    - -

    In binary classification with two classes \( (0, 1) \) we define the -logistic/sigmoid function as the probability that a particular input -is in class \( 0 \) or \( 1 \). This is possible because the logistic -function takes any input from the real numbers and inputs a number -between 0 and 1, and can therefore be interpreted as a probability. It -also has other nice properties, such as a derivative that is simple to -calculate. -

    - -

    For an input \( \boldsymbol{a} \) from the hidden layer, the probability that the input \( \boldsymbol{x} \) -is in class 0 or 1 is just. We let \( \theta \) represent the unknown weights and biases to be adjusted by our equations). The variable \( x \) -represents our activation values \( z \). We have -

    +

    If we have a multivariate function \( f(x,y) \) where \( x=x(t,s) \) and \( y=y(t,s) \) are functions of the variables \( t \) and \( s \), we have that the partial derivatives

    $$ -P(y = 0 \mid \boldsymbol{x}, \boldsymbol{\theta}) = \frac{1}{1 + \exp{(- \boldsymbol{x}})} , +\frac{\partial f}{\partial s}=\frac{\partial f}{\partial x}\frac{\partial x}{\partial s}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial s}, $$

    and

    $$ -P(y = 1 \mid \boldsymbol{x}, \boldsymbol{\theta}) = 1 - P(y = 0 \mid \boldsymbol{x}, \boldsymbol{\theta}) , +\frac{\partial f}{\partial t}=\frac{\partial f}{\partial x}\frac{\partial x}{\partial t}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial t}. $$ -

    where \( y \in \{0, 1\} \) and \( \boldsymbol{\theta} \) represents the weights and biases -of our network. -

    +

    the gradient of \( f \) with respect to \( t \) and \( s \) (without the explicit unit vector components)

    +$$ +\frac{df}{d(s,t)} = \begin{bmatrix}\frac{\partial f}{\partial x} & \frac{\partial f}{\partial y} \end{bmatrix} \begin{bmatrix}\frac{\partial x}{\partial s} &\frac{\partial x}{\partial t} \\ \frac{\partial y}{\partial s} & \frac{\partial y}{\partial t} \end{bmatrix}. +$$

    @@ -402,7 +562,7 @@ of our network.

  • 50
  • 51
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs042.html b/doc/pub/week41/html/._week41-bs042.html index 49f61a4be..f4a8ed238 100644 --- a/doc/pub/week41/html/._week41-bs042.html +++ b/doc/pub/week41/html/._week41-bs042.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,57 +519,19 @@ MathJax.Hub.Config({

     

     

     

    -

    Defining the cost function

    +

    Automatic differentiation through examples

    -

    Our cost function is given as (see the Logistic regression lectures)

    -$$ -\mathcal{C}(\boldsymbol{\theta}) = - \ln P(\mathcal{D} \mid \boldsymbol{\theta}) = - \sum_{i=1}^n -y_i \ln[P(y_i = 0)] + (1 - y_i) \ln [1 - P(y_i = 0)] = \sum_{i=1}^n \mathcal{L}_i(\boldsymbol{\theta}) . -$$ +

    A great introduction to automatic differentiation is given by Baydin et al., see https://arxiv.org/abs/1502.05767.

    -

    This last equality means that we can interpret our cost function as a sum over the loss function -for each point in the dataset \( \mathcal{L}_i(\boldsymbol{\theta}) \). -The negative sign is just so that we can think about our algorithm as minimizing a positive number, rather -than maximizing a negative number. +

    Automatic differentiation is a represented by a repeated application +of the chain rule on well-known functions and allows for the +calculation of derivatives to numerical precision. It is not the same +as the calculation of symbolic derivatives via for example SymPy, nor +does it use approximative formulae based on Taylor-expansions of a +function around a given value. The latter are error prone due to +truncation errors and values of the step size \( \Delta \).

    -

    In multiclass classification it is common to treat each integer label as a so called one-hot vector:

    - -

    \( y = 5 \quad \rightarrow \quad \boldsymbol{y} = (0, 0, 0, 0, 0, 1, 0, 0, 0, 0) , \) and

    - -\( y = 1 \quad \rightarrow \quad \boldsymbol{y} = (0, 1, 0, 0, 0, 0, 0, 0, 0, 0) , \) - -

    i.e. a binary bit string of length \( C \), where \( C = 10 \) is the number of classes in the MNIST dataset (numbers from \( 0 \) to \( 9 \))..

    - -

    If \( \boldsymbol{x}_i \) is the \( i \)-th input (image), \( y_{ic} \) refers to the \( c \)-th component of the \( i \)-th -output vector \( \boldsymbol{y}_i \). -The probability of \( \boldsymbol{x}_i \) being in class \( c \) will be given by the softmax function: -

    - -$$ -P(y_{ic} = 1 \mid \boldsymbol{x}_i, \boldsymbol{\theta}) = \frac{\exp{((\boldsymbol{a}_i^{hidden})^T \boldsymbol{w}_c)}} -{\sum_{c'=0}^{C-1} \exp{((\boldsymbol{a}_i^{hidden})^T \boldsymbol{w}_{c'})}} , -$$ - -

    which reduces to the logistic function in the binary case. -The likelihood of this \( C \)-class classifier -is now given as: -

    - -$$ -P(\mathcal{D} \mid \boldsymbol{\theta}) = \prod_{i=1}^n \prod_{c=0}^{C-1} [P(y_{ic} = 1)]^{y_{ic}} . -$$ - -

    Again we take the negative log-likelihood to define our cost function:

    - -$$ -\mathcal{C}(\boldsymbol{\theta}) = - \log{P(\mathcal{D} \mid \boldsymbol{\theta})}. -$$ - -

    See the logistic regression lectures for a full definition of the cost function.

    - -

    The back propagation equations need now only a small change, namely the definition of a new cost function. We are thus ready to use the same equations as before!

    -

    diff --git a/doc/pub/week41/html/._week41-bs043.html b/doc/pub/week41/html/._week41-bs043.html index 33fbbe27f..933369525 100644 --- a/doc/pub/week41/html/._week41-bs043.html +++ b/doc/pub/week41/html/._week41-bs043.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,50 +519,49 @@ MathJax.Hub.Config({

     

     

     

    -

    Example: binary classification problem

    +

    Simple example

    -

    As an example of the above, relevant for project 2 as well, let us consider a binary class. As discussed in our logistic regression lectures, we defined a cost function in terms of the parameters \( \beta \) as

    +

    Our first example is rather simple,

    $$ -\mathcal{C}(\boldsymbol{\beta}) = - \sum_{i=1}^n \left(y_i\log{p(y_i \vert x_i,\boldsymbol{\beta})}+(1-y_i)\log{1-p(y_i \vert x_i,\boldsymbol{\beta})}\right), +f(x) =\exp{x^2}, $$ -

    where we had defined the logistic (sigmoid) function

    +

    with derivative

    $$ -p(y_i =1\vert x_i,\boldsymbol{\beta})=\frac{\exp{(\beta_0+\beta_1 x_i)}}{1+\exp{(\beta_0+\beta_1 x_i)}}, +f'(x) =2x\exp{x^2}. $$ -

    and

    -$$ -p(y_i =0\vert x_i,\boldsymbol{\beta})=1-p(y_i =1\vert x_i,\boldsymbol{\beta}). -$$ +

    We can use SymPy to extract the pertinent lines of Python code through the following simple example

    -

    The parameters \( \boldsymbol{\beta} \) were defined using a minimization method like gradient descent or Newton-Raphson's method.

    + +
    +
    +
    +
    +
    +
    from __future__ import division
    +from sympy import *
    +x = symbols('x')
    +expr = exp(x*x)
    +simplify(expr)
    +derivative = diff(expr,x)
    +print(python(expr))
    +print(python(derivative))
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    -

    Now we replace \( x_i \) with the activation \( z_i^l \) for a given layer \( l \) and the outputs as \( y_i=a_i^l=f(z_i^l) \), with \( z_i^l \) now being a function of the weights \( w_{ij}^l \) and biases \( b_i^l \). -We have then -

    -$$ -a_i^l = y_i = \frac{\exp{(z_i^l)}}{1+\exp{(z_i^l)}}, -$$ - -

    with

    -$$ -z_i^l = \sum_{j}w_{ij}^l a_j^{l-1}+b_i^l, -$$ - -

    where the superscript \( l-1 \) indicates that these are the outputs from layer \( l-1 \). -Our cost function at the final layer \( l=L \) is now -

    -$$ -\mathcal{C}(\boldsymbol{W}) = - \sum_{i=1}^n \left(t_i\log{a_i^L}+(1-t_i)\log{(1-a_i^L)}\right), -$$ - -

    where we have defined the targets \( t_i \). The derivatives of the cost function with respect to the output \( a_i^L \) are then easily calculated and we get

    -$$ -\frac{\partial \mathcal{C}(\boldsymbol{W})}{\partial a_i^L} = \frac{a_i^L-t_i}{a_i^L(1-a_i^L)}. -$$ - -

    In case we use another activation function than the logistic one, we need to evaluate other derivatives.

    @@ -411,7 +588,7 @@ $$

  • 52
  • 53
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs044.html b/doc/pub/week41/html/._week41-bs044.html index c5bae7036..f1ea409c7 100644 --- a/doc/pub/week41/html/._week41-bs044.html +++ b/doc/pub/week41/html/._week41-bs044.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,24 +519,22 @@ MathJax.Hub.Config({

     

     

     

    -

    The Softmax function

    -

    In case we employ the more general case given by the Softmax equation, we need to evaluate the derivative of the activation function with respect to the activation \( z_i^l \), that is we need

    +

    Smarter way of evaluating the above function

    +

    If we study this function, we note that we can reduce the number of operations by introducing an intermediate variable

    $$ -\frac{\partial f(z_i^l)}{\partial w_{jk}^l} = -\frac{\partial f(z_i^l)}{\partial z_j^l} \frac{\partial z_j^l}{\partial w_{jk}^l}= \frac{\partial f(z_i^l)}{\partial z_j^l}a_k^{l-1}. +a = x^2, $$ -

    For the Softmax function we have

    +

    leading to

    $$ -f(z_i^l) = \frac{\exp{(z_i^l)}}{\sum_{m=1}^K\exp{(z_m^l)}}. +f(x) = f(a(x)) = b= \exp{a}. $$ -

    Its derivative with respect to \( z_j^l \) gives

    -$$ -\frac{\partial f(z_i^l)}{\partial z_j^l}= f(z_i^l)\left(\delta_{ij}-f(z_j^l)\right), -$$ - -

    which in case of the simply binary model reduces to having \( i=j \).

    +

    We now assume that all operations can be counted in terms of equal +floating point operations. This means that in order to calculate +\( f(x) \) we need first to square \( x \) and then compute the exponential. We +have thus two floating point operations only. +

    @@ -385,7 +561,7 @@ $$

  • 53
  • 54
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs045.html b/doc/pub/week41/html/._week41-bs045.html index 7add6db3f..571c575e3 100644 --- a/doc/pub/week41/html/._week41-bs045.html +++ b/doc/pub/week41/html/._week41-bs045.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -340,19 +518,26 @@ MathJax.Hub.Config({

     

     

     

    - -

    Developing a code for doing neural networks with back propagation

    + +

    Reducing the number of operations

    -

    One can identify a set of key steps when using neural networks to solve supervised learning problems:

    +

    With the introduction of a precalculated quantity \( a \) and thereby \( f(x) \) we have that the derivative can be written as

    + +$$ +f'(x) = 2xb, +$$ + +

    which reduces the number of operations from four in the orginal +expression to two. This means that if we need to compute \( f(x) \) and +its derivative (a common task in optimizations), we have reduced the +number of operations from six to four in total. +

    + +

    Note that the usage of a symbolic software like SymPy does not +include such simplifications and the calculations of the function and +the derivatives yield in general more floating point operations. +

    -
      -
    1. Collect and pre-process data
    2. -
    3. Define model and architecture
    4. -
    5. Choose cost function and optimizer
    6. -
    7. Train the model
    8. -
    9. Evaluate model performance on test data
    10. -
    11. Adjust hyperparameters (if necessary, network architecture)
    12. -

    diff --git a/doc/pub/week41/html/._week41-bs046.html b/doc/pub/week41/html/._week41-bs046.html index 7dcb574c0..b4afc93e5 100644 --- a/doc/pub/week41/html/._week41-bs046.html +++ b/doc/pub/week41/html/._week41-bs046.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,116 +519,29 @@ MathJax.Hub.Config({

     

     

     

    -

    Collect and pre-process data

    +

    Chain rule, forward and reverse modes

    -

    Here we will be using the MNIST dataset, which is readily available through the scikit-learn -package. You may also find it for example here. -The MNIST (Modified National Institute of Standards and Technology) database is a large database -of handwritten digits that is commonly used for training various image processing systems. -The MNIST dataset consists of 70 000 images of size \( 28\times 28 \) pixels, each labeled from 0 to 9. -The scikit-learn dataset we will use consists of a selection of 1797 images of size \( 8\times 8 \) collected and processed from this database. -

    +

    In the above example we have introduced the variables \( a \) and \( b \), and our function is

    +$$ +f(x) = f(a(x)) = b= \exp{a}, +$$ -

    To feed data into a feed-forward neural network we need to represent -the inputs as a design/feature matrix \( X = (n_{inputs}, n_{features}) \). Each -row represents an input, in this case a handwritten digit, and -each column represents a feature, in this case a pixel. The -correct answers, also known as labels or targets are -represented as a 1D array of integers -\( Y = (n_{inputs}) = (5, 3, 1, 8,...) \). -

    +

    with \( a=x^2 \). We can decompose the derivative of \( f \) with respect to \( x \) as

    +$$ +\frac{df}{dx}=\frac{df}{db}\frac{db}{da}\frac{da}{dx}. +$$ -

    As an example, say we want to build a neural network using supervised learning to predict Body-Mass Index (BMI) from -measurements of height (in m) -and weight (in kg). If we have measurements of 5 people the design/feature matrix could be for example: -

    +

    We note that since \( b=f(x) \) that

    +$$ +\frac{df}{db}=1, +$$ -

    $$ X = \begin{bmatrix} -1.85 & 81\\ -1.71 & 65\\ -1.95 & 103\\ -1.55 & 42\\ -1.63 & 56 -\end{bmatrix} ,$$ -

    - -

    and the targets would be:

    - -

    $$ Y = (23.7, 22.2, 27.1, 17.5, 21.1) $$

    - -

    Since each input image is a 2D matrix, we need to flatten the image -(i.e. "unravel" the 2D matrix into a 1D array) to turn the data into a -design/feature matrix. This means we lose all spatial information in the -image, such as locality and translational invariance. More complicated -architectures such as Convolutional Neural Networks can take advantage -of such information, and are most commonly applied when analyzing -images. -

    - - - -
    -
    -
    -
    -
    -
    # import necessary packages
    -import numpy as np
    -import matplotlib.pyplot as plt
    -from sklearn import datasets
    -
    -
    -# ensure the same random numbers appear every time
    -np.random.seed(0)
    -
    -# display images in notebook
    -%matplotlib inline
    -plt.rcParams['figure.figsize'] = (12,12)
    -
    -
    -# download MNIST dataset
    -digits = datasets.load_digits()
    -
    -# define inputs and labels
    -inputs = digits.images
    -labels = digits.target
    -
    -print("inputs = (n_inputs, pixel_width, pixel_height) = " + str(inputs.shape))
    -print("labels = (n_inputs) = " + str(labels.shape))
    -
    -
    -# flatten the image
    -# the value -1 means dimension is inferred from the remaining dimensions: 8x8 = 64
    -n_inputs = len(inputs)
    -inputs = inputs.reshape(n_inputs, -1)
    -print("X = (n_inputs, n_features) = " + str(inputs.shape))
    -
    -
    -# choose some random images to display
    -indices = np.arange(n_inputs)
    -random_indices = np.random.choice(indices, size=5)
    -
    -for i, image in enumerate(digits.images[random_indices]):
    -    plt.subplot(1, 5, i+1)
    -    plt.axis('off')
    -    plt.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest')
    -    plt.title("Label: %d" % digits.target[random_indices[i]])
    -plt.show()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +

    leading to

    +$$ +\frac{df}{dx}=\frac{db}{da}\frac{da}{dx}=2x\exp{x^2}, +$$ +

    as before.

    @@ -477,7 +568,7 @@ plt.show()

  • 55
  • 56
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs047.html b/doc/pub/week41/html/._week41-bs047.html index 72c67a79a..ab159f857 100644 --- a/doc/pub/week41/html/._week41-bs047.html +++ b/doc/pub/week41/html/._week41-bs047.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,68 +519,33 @@ MathJax.Hub.Config({

     

     

     

    -

    Train and test datasets

    +

    Forward and reverse modes

    -

    Performing analysis before partitioning the dataset is a major error, that can lead to incorrect conclusions.

    +

    We have that

    +$$ +\frac{df}{dx}=\frac{df}{db}\frac{db}{da}\frac{da}{dx}, +$$ -

    We will reserve \( 80 \% \) of our dataset for training and \( 20 \% \) for testing.

    +

    which we can rewrite either as

    +$$ +\frac{df}{dx}=\left[\frac{df}{db}\frac{db}{da}\right]\frac{da}{dx}, +$$ -

    It is important that the train and test datasets are drawn randomly from our dataset, to ensure -no bias in the sampling. -Say you are taking measurements of weather data to predict the weather in the coming 5 days. -You don't want to train your model on measurements taken from the hours 00.00 to 12.00, and then test it on data -collected from 12.00 to 24.00. +

    or

    +$$ +\frac{df}{dx}=\frac{df}{db}\left[\frac{db}{da}\frac{da}{dx}\right]. +$$ + +

    The first expression is called reverse mode (or back propagation) +since we start by evaluating the derivatives at the end point and then +propagate backwards. This is the standard way of evaluating +derivatives (gradients) when optimizing the parameters of a neural +network. In the context of deep learning this is computationally +more efficient since the output of a neural network consists of either +one or some few other output variables.

    - - -
    -
    -
    -
    -
    -
    from sklearn.model_selection import train_test_split
    -
    -# one-liner from scikit-learn library
    -train_size = 0.8
    -test_size = 1 - train_size
    -X_train, X_test, Y_train, Y_test = train_test_split(inputs, labels, train_size=train_size,
    -                                                    test_size=test_size)
    -
    -# equivalently in numpy
    -def train_test_split_numpy(inputs, labels, train_size, test_size):
    -    n_inputs = len(inputs)
    -    inputs_shuffled = inputs.copy()
    -    labels_shuffled = labels.copy()
    -    
    -    np.random.shuffle(inputs_shuffled)
    -    np.random.shuffle(labels_shuffled)
    -    
    -    train_end = int(n_inputs*train_size)
    -    X_train, X_test = inputs_shuffled[:train_end], inputs_shuffled[train_end:]
    -    Y_train, Y_test = labels_shuffled[:train_end], labels_shuffled[train_end:]
    -    
    -    return X_train, X_test, Y_train, Y_test
    -
    -#X_train, X_test, Y_train, Y_test = train_test_split_numpy(inputs, labels, train_size, test_size)
    -
    -print("Number of training images: " + str(len(X_train)))
    -print("Number of test images: " + str(len(X_test)))
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - +

    The second equation defines the so-called forward mode.

    @@ -429,7 +572,7 @@ X_train, X_test, Y_train, Y_test = train_tes

  • 56
  • 57
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs048.html b/doc/pub/week41/html/._week41-bs048.html index e31750e36..fca954924 100644 --- a/doc/pub/week41/html/._week41-bs048.html +++ b/doc/pub/week41/html/._week41-bs048.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,46 +519,49 @@ MathJax.Hub.Config({

     

     

     

    -

    Define model and architecture

    +

    More complicated function

    -

    Our simple feed-forward neural network will consist of an input layer, a single hidden layer and an output layer. The activation \( y \) of each neuron is a weighted sum of inputs, passed through an activation function. In case of the simple perceptron model we have

    - -

    $$ z = \sum_{i=1}^n w_i a_i ,$$

    - -

    $$ y = f(z) ,$$

    - -

    where \( f \) is the activation function, \( a_i \) represents input from neuron \( i \) in the preceding layer -and \( w_i \) is the weight to input \( i \). -The activation of the neurons in the input layer is just the features (e.g. a pixel value). -

    - -

    The simplest activation function for a neuron is the Heaviside function:

    - -

    $$ f(z) = -\begin{cases} -1, & z > 0\\ -0, & \text{otherwise} -\end{cases} +

    We increase our ambitions and introduce a slightly more complicated function

    +$$ +f(x) =\sqrt{x^2+exp{x^2}}, $$ -

    -

    A feed-forward neural network with this activation is known as a perceptron. -For a binary classifier (i.e. two classes, 0 or 1, dog or not-dog) we can also use this in our output layer. -This activation can be generalized to \( k \) classes (using e.g. the one-against-all strategy), -and we call these architectures multiclass perceptrons. -

    +

    with derivative

    +$$ +f'(x) =\frac{x(1+\exp{x^2})}{\sqrt{x^2+exp{x^2}}}. +$$ -

    However, it is now common to use the terms Single Layer Perceptron (SLP) (1 hidden layer) and -Multilayer Perceptron (MLP) (2 or more hidden layers) to refer to feed-forward neural networks with any activation function. -

    +

    The corresponding SymPy code reads

    -

    Typical choices for activation functions include the sigmoid function, hyperbolic tangent, and Rectified Linear Unit (ReLU). -We will be using the sigmoid function \( \sigma(x) \): -

    + +
    +
    +
    +
    +
    +
    from __future__ import division
    +from sympy import *
    +x = symbols('x')
    +expr = sqrt(x*x+exp(x*x))
    +simplify(expr)
    +derivative = diff(expr,x)
    +print(python(expr))
    +print(python(derivative))
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    -

    $$ f(x) = \sigma(x) = \frac{1}{1 + e^{-x}} ,$$

    - -

    which is inspired by probability theory (see logistic regression) and was most commonly used until about 2011. See the discussion below concerning other activation functions.

    @@ -407,7 +588,7 @@ We will be using the sigmoid function \( \sigma(x) \):

  • 57
  • 58
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs049.html b/doc/pub/week41/html/._week41-bs049.html index 2fbcfdac8..6e54d00b7 100644 --- a/doc/pub/week41/html/._week41-bs049.html +++ b/doc/pub/week41/html/._week41-bs049.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -340,45 +518,15 @@ MathJax.Hub.Config({

     

     

     

    - -

    Layers

    + +

    Counting the number of floating point operations

    -
      -
    • Input
    • -
    -

    Since each input image has 8x8 = 64 pixels or features, we have an input layer of 64 neurons.

    - -
      -
    • Hidden layer
    • -
    -

    We will use 50 neurons in the hidden layer receiving input from the neurons in the input layer. -Since each neuron in the hidden layer is connected to the 64 inputs we have 64x50 = 3200 weights to the hidden layer. +

    A simple count of operations shows that we need five operations for +the function itself and ten for the derivative. Fifteen operations in total if we wish to proceed with the above codes.

    -
      -
    • Output
    • -
    -

    If we were building a binary classifier, it would be sufficient with a single neuron in the output layer, -which could output 0 or 1 according to the Heaviside function. This would be an example of a hard classifier, meaning it outputs the class of the input directly. However, if we are dealing with noisy data it is often beneficial to use a soft classifier, which outputs the probability of being in class 0 or 1. -

    - -

    For a soft binary classifier, we could use a single neuron and interpret the output as either being the probability of being in class 0 or the probability of being in class 1. Alternatively we could use 2 neurons, and interpret each neuron as the probability of being in each class.

    - -

    Since we are doing multiclass classification, with 10 categories, it is natural to use 10 neurons in the output layer. We number the neurons \( j = 0,1,...,9 \). The activation of each output neuron \( j \) will be according to the softmax function:

    - -

    $$ P(\text{class \( j \)} \mid \text{input \( \boldsymbol{a} \)}) = \frac{\exp{(\boldsymbol{a}^T \boldsymbol{w}_j)}} -{\sum_{c=0}^{9} \exp{(\boldsymbol{a}^T \boldsymbol{w}_c)}} ,$$ -

    - -

    i.e. each neuron \( j \) outputs the probability of being in class \( j \) given an input from the hidden layer \( \boldsymbol{a} \), with \( \boldsymbol{w}_j \) the weights of neuron \( j \) to the inputs. -The denominator is a normalization factor to ensure the outputs (probabilities) sum up to 1. -The exponent is just the weighted sum of inputs as before: -

    - -

    $$ z_j = \sum_{i=1}^n w_ {ij} a_i+b_j.$$

    - -

    Since each neuron in the output layer is connected to the 50 inputs from the hidden layer we have 50x10 = 500 -weights to the output layer. +

    Can we reduce this to +say half the number of operations?

    @@ -406,7 +554,7 @@ weights to the output layer.

  • 58
  • 59
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs050.html b/doc/pub/week41/html/._week41-bs050.html index db2b9c7d4..0ab2a00b7 100644 --- a/doc/pub/week41/html/._week41-bs050.html +++ b/doc/pub/week41/html/._week41-bs050.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -340,56 +518,30 @@ MathJax.Hub.Config({

     

     

     

    - -

    Weights and biases

    + +

    Defining intermediate operations

    -

    Typically weights are initialized with small values distributed around zero, drawn from a uniform -or normal distribution. Setting all weights to zero means all neurons give the same output, making the network useless. +

    We can indeed reduce the number of operation to half of those listed in the brute force approach above. +We define the following quantities

    +$$ +a = x^2, +$$ -

    Adding a bias value to the weighted sum of inputs allows the neural network to represent a greater range -of values. Without it, any input with the value 0 will be mapped to zero (before being passed through the activation). The bias unit has an output of 1, and a weight to each neuron \( j \), \( b_j \): -

    +

    and

    +$$ +b = \exp{x^2} = \exp{a}, +$$ -

    $$ z_j = \sum_{i=1}^n w_ {ij} a_i + b_j.$$

    +

    and

    +$$ +c= a+b, +$$ -

    The bias weights \( \boldsymbol{b} \) are often initialized to zero, but a small value like \( 0.01 \) ensures all neurons have some output which can be backpropagated in the first training cycle.

    - - -
    -
    -
    -
    -
    -
    # building our neural network
    -
    -n_inputs, n_features = X_train.shape
    -n_hidden_neurons = 50
    -n_categories = 10
    -
    -# we make the weights normally distributed using numpy.random.randn
    -
    -# weights and bias in the hidden layer
    -hidden_weights = np.random.randn(n_features, n_hidden_neurons)
    -hidden_bias = np.zeros(n_hidden_neurons) + 0.01
    -
    -# weights and bias in the output layer
    -output_weights = np.random.randn(n_hidden_neurons, n_categories)
    -output_bias = np.zeros(n_categories) + 0.01
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +

    and

    +$$ +d=f(x)=\sqrt{c}. +$$

    @@ -417,7 +569,7 @@ output_bias = np59

  • 60
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs051.html b/doc/pub/week41/html/._week41-bs051.html index c818a109d..b2a9692af 100644 --- a/doc/pub/week41/html/._week41-bs051.html +++ b/doc/pub/week41/html/._week41-bs051.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,27 +519,38 @@ MathJax.Hub.Config({

     

     

     

    -

    Feed-forward pass

    +

    New expression for the derivative

    -

    Denote \( F \) the number of features, \( H \) the number of hidden neurons and \( C \) the number of categories. -For each input image we calculate a weighted sum of input features (pixel values) to each neuron \( j \) in the hidden layer \( l \): -

    +

    With these definitions we obtain the following partial derivatives

    +$$ +\frac{\partial a}{\partial x} = 2x, +$$ -

    $$ z_{j}^{l} = \sum_{i=1}^{F} w_{ij}^{l} x_i + b_{j}^{l},$$

    +

    and

    +$$ +\frac{\partial b}{\partial a} = \exp{a}, +$$ -

    this is then passed through our activation function

    +

    and

    +$$ +\frac{\partial c}{\partial a} = 1, +$$ -

    $$ a_{j}^{l} = f(z_{j}^{l}) .$$

    +

    and

    +$$ +\frac{\partial c}{\partial b} = 1, +$$ -

    We calculate a weighted sum of inputs (activations in the hidden layer) to each neuron \( j \) in the output layer:

    +

    and

    +$$ +\frac{\partial d}{\partial c} = \frac{1}{2\sqrt{c}}, +$$ -

    $$ z_{j}^{L} = \sum_{i=1}^{H} w_{ij}^{L} a_{i}^{l} + b_{j}^{L}.$$

    +

    and finally

    +$$ +\frac{\partial f}{\partial d} = 1. +$$ -

    Finally we calculate the output of neuron \( j \) in the output layer using the softmax function:

    - -

    $$ a_{j}^{L} = \frac{\exp{(z_j^{L})}} -{\sum_{c=0}^{C-1} \exp{(z_c^{L})}} .$$ -

    @@ -388,7 +577,7 @@ For each input image we calculate a weighted sum of input features (pixel values

  • 60
  • 61
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs052.html b/doc/pub/week41/html/._week41-bs052.html index 244b7019d..21537fd9a 100644 --- a/doc/pub/week41/html/._week41-bs052.html +++ b/doc/pub/week41/html/._week41-bs052.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -340,95 +518,33 @@ MathJax.Hub.Config({

     

     

     

    - -

    Matrix multiplications

    + +

    Final derivatives

    +

    Our final derivatives are thus

    +$$ +\frac{\partial f}{\partial c} = \frac{\partial f}{\partial d} \frac{\partial d}{\partial c} = \frac{1}{2\sqrt{c}}, +$$ -

    Since our data has the dimensions \( X = (n_{inputs}, n_{features}) \) and our weights to the hidden -layer have the dimensions -\( W_{hidden} = (n_{features}, n_{hidden}) \), -we can easily feed the network all our training data in one go by taking the matrix product -

    +$$ +\frac{\partial f}{\partial b} = \frac{\partial f}{\partial c} \frac{\partial c}{\partial b} = \frac{1}{2\sqrt{c}}, +$$ -

    $$ X W^{h} = (n_{inputs}, n_{hidden}),$$

    +$$ +\frac{\partial f}{\partial a} = \frac{\partial f}{\partial c} \frac{\partial c}{\partial a}+ +\frac{\partial f}{\partial b} \frac{\partial b}{\partial a} = \frac{1+\exp{a}}{2\sqrt{c}}, +$$ -

    and obtain a matrix that holds the weighted sum of inputs to the hidden layer -for each input image and each hidden neuron. -We also add the bias to obtain a matrix of weighted sums to the hidden layer \( Z^{h} \): -

    +

    and finally

    +$$ +\frac{\partial f}{\partial x} = \frac{\partial f}{\partial a} \frac{\partial a}{\partial x} = \frac{x(1+\exp{a})}{\sqrt{c}}, +$$ -

    $$ \boldsymbol{z}^{l} = \boldsymbol{X} \boldsymbol{W}^{l} + \boldsymbol{b}^{l} ,$$

    - -

    meaning the same bias (1D array with size equal number of hidden neurons) is added to each input image. -This is then passed through the activation: -

    - -

    $$ \boldsymbol{a}^{l} = f(\boldsymbol{z}^l) .$$

    - -

    This is fed to the output layer:

    - -

    $$ \boldsymbol{z}^{L} = \boldsymbol{a}^{L} \boldsymbol{W}^{L} + \boldsymbol{b}^{L} .$$

    - -

    Finally we receive our output values for each image and each category by passing it through the softmax function:

    - -

    $$ output = softmax (\boldsymbol{z}^{L}) = (n_{inputs}, n_{categories}) .$$

    - - - -
    -
    -
    -
    -
    -
    # setup the feed-forward pass, subscript h = hidden layer
    -
    -def sigmoid(x):
    -    return 1/(1 + np.exp(-x))
    -
    -def feed_forward(X):
    -    # weighted sum of inputs to the hidden layer
    -    z_h = np.matmul(X, hidden_weights) + hidden_bias
    -    # activation in the hidden layer
    -    a_h = sigmoid(z_h)
    -    
    -    # weighted sum of inputs to the output layer
    -    z_o = np.matmul(a_h, output_weights) + output_bias
    -    # softmax output
    -    # axis 0 holds each input and axis 1 the probabilities of each category
    -    exp_term = np.exp(z_o)
    -    probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
    -    
    -    return probabilities
    -
    -probabilities = feed_forward(X_train)
    -print("probabilities = (n_inputs, n_categories) = " + str(probabilities.shape))
    -print("probability that image 0 is in category 0,1,2,...,9 = \n" + str(probabilities[0]))
    -print("probabilities sum up to: " + str(probabilities[0].sum()))
    -print()
    -
    -# we obtain a prediction by taking the class with the highest likelihood
    -def predict(X):
    -    probabilities = feed_forward(X)
    -    return np.argmax(probabilities, axis=1)
    -
    -predictions = predict(X_train)
    -print("predictions = (n_inputs) = " + str(predictions.shape))
    -print("prediction for image 0: " + str(predictions[0]))
    -print("correct label for image 0: " + str(Y_train[0]))
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +

    which is just

    +$$ +\frac{\partial f}{\partial x} = \frac{x(1+b)}{d}, +$$ +

    and requires only three operations if we can reuse all intermediate variables.

    @@ -455,7 +571,7 @@ predictions = predict(X_train)

  • 61
  • 62
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs053.html b/doc/pub/week41/html/._week41-bs053.html index 319ca1523..90fbc3a14 100644 --- a/doc/pub/week41/html/._week41-bs053.html +++ b/doc/pub/week41/html/._week41-bs053.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,33 +519,15 @@ MathJax.Hub.Config({

     

     

     

    -

    Choose cost function and optimizer

    +

    In general not this simple

    -

    To measure how well our neural network is doing we need to introduce a cost function. -We will call the function that gives the error of a single sample output the loss function, and the function -that gives the total error of our network across all samples the cost function. -A typical choice for multiclass classification is the cross-entropy loss, also known as the negative log likelihood. +

    In general, see the generalization below, unless we can obtain simple +analytical expressions which we can simplify further, the final +implementation of automatic differentiation involves repeated +calculations (and thereby operations) of derivatives of elementary +functions.

    -

    In multiclass classification it is common to treat each integer label as a so called one-hot vector:

    - -

    $$ y = 5 \quad \rightarrow \quad \boldsymbol{y} = (0, 0, 0, 0, 0, 1, 0, 0, 0, 0) ,$$

    - -

    $$ y = 1 \quad \rightarrow \quad \boldsymbol{y} = (0, 1, 0, 0, 0, 0, 0, 0, 0, 0) ,$$

    - -

    i.e. a binary bit string of length \( C \), where \( C = 10 \) is the number of classes in the MNIST dataset.

    - -

    Let \( y_{ic} \) denote the \( c \)-th component of the \( i \)-th one-hot vector. -We define the cost function \( \mathcal{C} \) as a sum over the cross-entropy loss for each point \( \boldsymbol{x}_i \) in the dataset. -

    - -

    In the one-hot representation only one of the terms in the loss function is non-zero, namely the -probability of the correct category \( c' \) -(i.e. the category \( c' \) such that \( y_{ic'} = 1 \)). This means that the cross entropy loss only punishes you for how wrong -you got the correct label. The probability of category \( c \) is given by the softmax function. The vector \( \boldsymbol{\theta} \) represents the parameters of our network, i.e. all the weights and biases. -

    - -

      @@ -393,7 +553,7 @@ you got the correct label. The probability of category \( c \) is given by the s
    • 62
    • 63
    • ...
    • -
    • 69
    • +
    • 113
    • »
    diff --git a/doc/pub/week41/html/._week41-bs054.html b/doc/pub/week41/html/._week41-bs054.html index b940a0a63..7b5f67f36 100644 --- a/doc/pub/week41/html/._week41-bs054.html +++ b/doc/pub/week41/html/._week41-bs054.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,39 +519,24 @@ MathJax.Hub.Config({

     

     

     

    -

    Optimizing the cost function

    +

    Automatic differentiation

    -

    The network is trained by finding the weights and biases that minimize the cost function. One of the most widely used classes of methods is gradient descent and its generalizations. The idea behind gradient descent -is simply to adjust the weights in the direction where the gradient of the cost function is large and negative. This ensures we flow toward a local minimum of the cost function. -Each parameter \( \theta \) is iteratively adjusted according to the rule +

    We can make this example more formal. Automatic differentiation is a +formalization of the previous example (see graph).

    -

    $$ \theta_{i+1} = \theta_i - \eta \nabla \mathcal{C}(\theta_i) ,$$

    +

    We define \( \boldsymbol{x}\in x_1,\dots, x_l \) input variables to a given function \( f(\boldsymbol{x}) \) and \( x_{l+1},\dots, x_L \) intermediate variables.

    -

    where \( \eta \) is known as the learning rate, which controls how big a step we take towards the minimum. -This update can be repeated for any number of iterations, or until we are satisfied with the result. +

    In the above example we have only one input variable, \( l=1 \) and four intermediate variables, that is

    +$$ +\begin{bmatrix} x_1=x & x_2 = x^2=a & x_3 =\exp{a}= b & x_4=c=a+b & x_5 = \sqrt{c}=d \end{bmatrix}. +$$ + +

    Furthemore, for \( i=l+1, \dots, L \) (here \( i=2,3,4,5 \) and \( f=x_L=d \)), we +define the elementary functions \( g_i(x_{Pa(x_i)}) \) where \( x_{Pa(x_i)} \) are the parent nodes of the variable \( x_i \).

    -

    A simple and effective improvement is a variant called Batch Gradient Descent. -Instead of calculating the gradient on the whole dataset, we calculate an approximation of the gradient -on a subset of the data called a minibatch. -If there are \( N \) data points and we have a minibatch size of \( M \), the total number of batches -is \( N/M \). -We denote each minibatch \( B_k \), with \( k = 1, 2,...,N/M \). The gradient then becomes: -

    - -

    $$ \nabla \mathcal{C}(\theta) = \frac{1}{N} \sum_{i=1}^N \nabla \mathcal{L}_i(\theta) \quad \rightarrow \quad -\frac{1}{M} \sum_{i \in B_k} \nabla \mathcal{L}_i(\theta) ,$$ -

    - -

    i.e. instead of averaging the loss over the entire dataset, we average over a minibatch.

    - -

    This has two important benefits:

    -
      -
    1. Introducing stochasticity decreases the chance that the algorithm becomes stuck in a local minima.
    2. -
    3. It significantly speeds up the calculation, since we do not have to use the entire dataset to calculate the gradient.
    4. -
    -

    The various optmization methods, with codes and algorithms, are discussed in our lectures on Gradient descent approaches.

    +

    In our case, we have for example for \( x_3=g_3(x_{Pa(x_i)})=\exp{a} \), that \( g_3=\exp{()} \) and \( x_{Pa(x_3)}=a \).

    @@ -400,7 +563,7 @@ We denote each minibatch \( B_k \), with \( k = 1, 2,...,N/M \). The gradient th

  • 63
  • 64
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs055.html b/doc/pub/week41/html/._week41-bs055.html index cda13907d..9697fb49e 100644 --- a/doc/pub/week41/html/._week41-bs055.html +++ b/doc/pub/week41/html/._week41-bs055.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -340,34 +518,27 @@ MathJax.Hub.Config({

     

     

     

    - -

    Regularization

    + +

    Chain rule

    -

    It is common to add an extra term to the cost function, proportional -to the size of the weights. This is equivalent to constraining the -size of the weights, so that they do not grow out of control. -Constraining the size of the weights means that the weights cannot -grow arbitrarily large to fit the training data, and in this way -reduces overfitting. +

    We can now compute the gradients by back-propagating the derivatives using the chain rule. +We have defined

    +$$ +\frac{\partial f}{\partial x_L} = 1, +$$ -

    We will measure the size of the weights using the so called L2-norm, meaning our cost function becomes:

    +

    which allows us to find the derivatives of the various variables \( x_i \) as

    +$$ +\frac{\partial f}{\partial x_i} = \sum_{x_j:x_i\in Pa(x_j)}\frac{\partial f}{\partial x_j} \frac{\partial x_j}{\partial x_i}=\sum_{x_j:x_i\in Pa(x_j)}\frac{\partial f}{\partial x_j} \frac{\partial g_j}{\partial x_i}. +$$ -

    $$ \mathcal{C}(\theta) = \frac{1}{N} \sum_{i=1}^N \mathcal{L}_i(\theta) \quad \rightarrow \quad -\frac{1}{N} \sum_{i=1}^N \mathcal{L}_i(\theta) + \lambda \lvert \lvert \boldsymbol{w} \rvert \rvert_2^2 -= \frac{1}{N} \sum_{i=1}^N \mathcal{L}(\theta) + \lambda \sum_{ij} w_{ij}^2,$$ -

    - -

    i.e. we sum up all the weights squared. The factor \( \lambda \) is known as a regularization parameter.

    - -

    In order to train the model, we need to calculate the derivative of -the cost function with respect to every bias and weight in the -network. In total our network has \( (64 + 1)\times 50=3250 \) weights in -the hidden layer and \( (50 + 1)\times 10=510 \) weights to the output -layer (\( +1 \) for the bias), and the gradient must be calculated for -every parameter. We use the backpropagation algorithm discussed -above. This is a clever use of the chain rule that allows us to -calculate the gradient efficently. +

    Whenever we have a function which can be expressed as a computation +graph and the various functions can be expressed in terms of +elementary functions that are differentiable, then automatic +differentiation works. The functions may not need to be elementary +functions, they could also be computer programs, although not all +programs can be automatically differentiated.

    @@ -395,7 +566,7 @@ calculate the gradient efficently.

  • 64
  • 65
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs056.html b/doc/pub/week41/html/._week41-bs056.html index 2d26209fe..65d3642cd 100644 --- a/doc/pub/week41/html/._week41-bs056.html +++ b/doc/pub/week41/html/._week41-bs056.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,130 +519,28 @@ MathJax.Hub.Config({

     

     

     

    -

    Matrix multiplication

    +

    First network example, simple percepetron with one input

    -

    To more efficently train our network these equations are implemented using matrix operations. -The error in the output layer is calculated simply as, with \( \boldsymbol{t} \) being our targets, +

    As yet another example we define now a simple perceptron model with +all quantities given by scalars. We consider only one input variable +\( x \) and one target value \( y \). We define an activation function +\( \sigma_1 \) which takes as input

    -

    $$ \delta_L = \boldsymbol{t} - \boldsymbol{y} = (n_{inputs}, n_{categories}) .$$

    +$$ +z_1 = w_1x+b_1, +$$ -

    The gradient for the output weights is calculated as

    - -

    $$ \nabla W_{L} = \boldsymbol{a}^T \delta_L = (n_{hidden}, n_{categories}) ,$$

    - -

    where \( \boldsymbol{a} = (n_{inputs}, n_{hidden}) \). This simply means that we are summing up the gradients for each input. -Since we are going backwards we have to transpose the activation matrix. +

    where \( w_1 \) is the weight and \( b_1 \) is the bias. These are the +parameters we want to optimize. The output is \( a_1=\sigma(z_1) \) (see +graph from whiteboard notes). This output is then fed into the +cost/loss function, which we here for the sake of simplicity just +define as the squared error

    -

    The gradient with respect to the output bias is then

    - -

    $$ \nabla \boldsymbol{b}_{L} = \sum_{i=1}^{n_{inputs}} \delta_L = (n_{categories}) .$$

    - -

    The error in the hidden layer is

    - -

    $$ \Delta_h = \delta_L W_{L}^T \circ f'(z_{h}) = \delta_L W_{L}^T \circ a_{h} \circ (1 - a_{h}) = (n_{inputs}, n_{hidden}) ,$$

    - -

    where \( f'(a_{h}) \) is the derivative of the activation in the hidden layer. The matrix products mean -that we are summing up the products for each neuron in the output layer. The symbol \( \circ \) denotes -the Hadamard product, meaning element-wise multiplication. -

    - -

    This again gives us the gradients in the hidden layer:

    - -

    $$ \nabla W_{h} = X^T \delta_h = (n_{features}, n_{hidden}) ,$$

    - -

    $$ \nabla b_{h} = \sum_{i=1}^{n_{inputs}} \delta_h = (n_{hidden}) .$$

    - - - -
    -
    -
    -
    -
    -
    # to categorical turns our integer vector into a onehot representation
    -from sklearn.metrics import accuracy_score
    -
    -# one-hot in numpy
    -def to_categorical_numpy(integer_vector):
    -    n_inputs = len(integer_vector)
    -    n_categories = np.max(integer_vector) + 1
    -    onehot_vector = np.zeros((n_inputs, n_categories))
    -    onehot_vector[range(n_inputs), integer_vector] = 1
    -    
    -    return onehot_vector
    -
    -#Y_train_onehot, Y_test_onehot = to_categorical(Y_train), to_categorical(Y_test)
    -Y_train_onehot, Y_test_onehot = to_categorical_numpy(Y_train), to_categorical_numpy(Y_test)
    -
    -def feed_forward_train(X):
    -    # weighted sum of inputs to the hidden layer
    -    z_h = np.matmul(X, hidden_weights) + hidden_bias
    -    # activation in the hidden layer
    -    a_h = sigmoid(z_h)
    -    
    -    # weighted sum of inputs to the output layer
    -    z_o = np.matmul(a_h, output_weights) + output_bias
    -    # softmax output
    -    # axis 0 holds each input and axis 1 the probabilities of each category
    -    exp_term = np.exp(z_o)
    -    probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
    -    
    -    # for backpropagation need activations in hidden and output layers
    -    return a_h, probabilities
    -
    -def backpropagation(X, Y):
    -    a_h, probabilities = feed_forward_train(X)
    -    
    -    # error in the output layer
    -    error_output = probabilities - Y
    -    # error in the hidden layer
    -    error_hidden = np.matmul(error_output, output_weights.T) * a_h * (1 - a_h)
    -    
    -    # gradients for the output layer
    -    output_weights_gradient = np.matmul(a_h.T, error_output)
    -    output_bias_gradient = np.sum(error_output, axis=0)
    -    
    -    # gradient for the hidden layer
    -    hidden_weights_gradient = np.matmul(X.T, error_hidden)
    -    hidden_bias_gradient = np.sum(error_hidden, axis=0)
    -
    -    return output_weights_gradient, output_bias_gradient, hidden_weights_gradient, hidden_bias_gradient
    -
    -print("Old accuracy on training data: " + str(accuracy_score(predict(X_train), Y_train)))
    -
    -eta = 0.01
    -lmbd = 0.01
    -for i in range(1000):
    -    # calculate gradients
    -    dWo, dBo, dWh, dBh = backpropagation(X_train, Y_train_onehot)
    -    
    -    # regularization term gradients
    -    dWo += lmbd * output_weights
    -    dWh += lmbd * hidden_weights
    -    
    -    # update weights and biases
    -    output_weights -= eta * dWo
    -    output_bias -= eta * dBo
    -    hidden_weights -= eta * dWh
    -    hidden_bias -= eta * dBh
    -
    -print("New accuracy on training data: " + str(accuracy_score(predict(X_train), Y_train)))
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +$$ +C(x;w_1,b_1)=\frac{1}{2}(a_1-y)^2. +$$

    @@ -492,7 +568,7 @@ lmbd = 0.0165

  • 66
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs057.html b/doc/pub/week41/html/._week41-bs057.html index c1096d126..a48266919 100644 --- a/doc/pub/week41/html/._week41-bs057.html +++ b/doc/pub/week41/html/._week41-bs057.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,21 +519,13 @@ MathJax.Hub.Config({

     

     

     

    -

    Improving performance

    +

    Layout of a simple neural network with no hidden layer

    -

    As we can see the network does not seem to be learning at all. It seems to be just guessing the label for each image. -In order to obtain a network that does something useful, we will have to do a bit more work. -

    - -

    The choice of hyperparameters such as learning rate and regularization parameter is hugely influential for the performance of the network. Typically a grid-search is performed, wherein we test different hyperparameters separated by orders of magnitude. For example we could test the learning rates \( \eta = 10^{-6}, 10^{-5},...,10^{-1} \) with different regularization parameters \( \lambda = 10^{-6},...,10^{-0} \).

    - -

    Next, we haven't implemented minibatching yet, which introduces stochasticity and is though to act as an important regularizer on the weights. We call a feed-forward + backward pass with a minibatch an iteration, and a full training period -going through the entire dataset (\( n/M \) batches) an epoch. -

    - -

    If this does not improve network performance, you may want to consider altering the network architecture, adding more neurons or hidden layers. -Andrew Ng goes through some of these considerations in this video. You can find a summary of the video here. -

    +

    +
    +

    +
    +

    @@ -382,7 +552,7 @@ Andrew Ng goes through some of these considerations in this 66

  • 67
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs058.html b/doc/pub/week41/html/._week41-bs058.html index d8d89a67a..0e978ba2a 100644 --- a/doc/pub/week41/html/._week41-bs058.html +++ b/doc/pub/week41/html/._week41-bs058.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,132 +519,32 @@ MathJax.Hub.Config({

     

     

     

    -

    Full object-oriented implementation

    +

    Optimizing the parameters

    -

    It is very natural to think of the network as an object, with specific instances of the network -being realizations of this object with different hyperparameters. An implementation using Python classes provides a clean structure and interface, and the full implementation of our neural network is given below. +

    In setting up the feed forward and back propagation parts of the +algorithm, we need now the derivative of the various variables we want +to train.

    +

    We need

    +$$ +\frac{\partial C}{\partial w_1} \hspace{0.1cm}\mathrm{and}\hspace{0.1cm}\frac{\partial C}{\partial b_1}. +$$ - -
    -
    -
    -
    -
    -
    class NeuralNetwork:
    -    def __init__(
    -            self,
    -            X_data,
    -            Y_data,
    -            n_hidden_neurons=50,
    -            n_categories=10,
    -            epochs=10,
    -            batch_size=100,
    -            eta=0.1,
    -            lmbd=0.0):
    +

    Using the chain rule we find

    +$$ +\frac{\partial C}{\partial w_1}=\frac{\partial C}{\partial a_1}\frac{\partial a_1}{\partial z_1}\frac{\partial z_1}{\partial w_1}=(a_1-y)\sigma_1'x, +$$ - self.X_data_full = X_data - self.Y_data_full = Y_data +

    and

    +$$ +\frac{\partial C}{\partial b_1}=\frac{\partial C}{\partial a_1}\frac{\partial a_1}{\partial z_1}\frac{\partial z_1}{\partial b_1}=(a_1-y)\sigma_1', +$$ - self.n_inputs = X_data.shape[0] - self.n_features = X_data.shape[1] - self.n_hidden_neurons = n_hidden_neurons - self.n_categories = n_categories - - self.epochs = epochs - self.batch_size = batch_size - self.iterations = self.n_inputs // self.batch_size - self.eta = eta - self.lmbd = lmbd - - self.create_biases_and_weights() - - def create_biases_and_weights(self): - self.hidden_weights = np.random.randn(self.n_features, self.n_hidden_neurons) - self.hidden_bias = np.zeros(self.n_hidden_neurons) + 0.01 - - self.output_weights = np.random.randn(self.n_hidden_neurons, self.n_categories) - self.output_bias = np.zeros(self.n_categories) + 0.01 - - def feed_forward(self): - # feed-forward for training - self.z_h = np.matmul(self.X_data, self.hidden_weights) + self.hidden_bias - self.a_h = sigmoid(self.z_h) - - self.z_o = np.matmul(self.a_h, self.output_weights) + self.output_bias - - exp_term = np.exp(self.z_o) - self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True) - - def feed_forward_out(self, X): - # feed-forward for output - z_h = np.matmul(X, self.hidden_weights) + self.hidden_bias - a_h = sigmoid(z_h) - - z_o = np.matmul(a_h, self.output_weights) + self.output_bias - - exp_term = np.exp(z_o) - probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True) - return probabilities - - def backpropagation(self): - error_output = self.probabilities - self.Y_data - error_hidden = np.matmul(error_output, self.output_weights.T) * self.a_h * (1 - self.a_h) - - self.output_weights_gradient = np.matmul(self.a_h.T, error_output) - self.output_bias_gradient = np.sum(error_output, axis=0) - - self.hidden_weights_gradient = np.matmul(self.X_data.T, error_hidden) - self.hidden_bias_gradient = np.sum(error_hidden, axis=0) - - if self.lmbd > 0.0: - self.output_weights_gradient += self.lmbd * self.output_weights - self.hidden_weights_gradient += self.lmbd * self.hidden_weights - - self.output_weights -= self.eta * self.output_weights_gradient - self.output_bias -= self.eta * self.output_bias_gradient - self.hidden_weights -= self.eta * self.hidden_weights_gradient - self.hidden_bias -= self.eta * self.hidden_bias_gradient - - def predict(self, X): - probabilities = self.feed_forward_out(X) - return np.argmax(probabilities, axis=1) - - def predict_probabilities(self, X): - probabilities = self.feed_forward_out(X) - return probabilities - - def train(self): - data_indices = np.arange(self.n_inputs) - - for i in range(self.epochs): - for j in range(self.iterations): - # pick datapoints with replacement - chosen_datapoints = np.random.choice( - data_indices, size=self.batch_size, replace=False - ) - - # minibatch training data - self.X_data = self.X_data_full[chosen_datapoints] - self.Y_data = self.Y_data_full[chosen_datapoints] - - self.feed_forward() - self.backpropagation() -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +

    which we later will just define as

    +$$ +\frac{\partial C}{\partial a_1}\frac{\partial a_1}{\partial z_1}=\delta_1. +$$

    @@ -494,7 +572,7 @@ being realizations of this object with different hyperparameters. An implementat

  • 67
  • 68
  • ...
  • -
  • 69
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs059.html b/doc/pub/week41/html/._week41-bs059.html index de21c8c11..908d986fd 100644 --- a/doc/pub/week41/html/._week41-bs059.html +++ b/doc/pub/week41/html/._week41-bs059.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,55 +519,29 @@ MathJax.Hub.Config({

     

     

     

    -

    Evaluate model performance on test data

    +

    Adding a hidden layer

    -

    To measure the performance of our network we evaluate how well it does it data it has never seen before, i.e. the test data. -We measure the performance of the network using the accuracy score. -The accuracy is as you would expect just the number of images correctly labeled divided by the total number of images. A perfect classifier will have an accuracy score of \( 1 \). +

    We change our simple model to (see graph) +a network with just one hidden layer but with scalar variables only.

    -

    $$ \text{Accuracy} = \frac{\sum_{i=1}^n I(\tilde{y}_i = y_i)}{n} ,$$

    +

    Our output variable changes to \( a_2 \) and \( a_1 \) is now the output from the hidden node and \( a_0=x \). +We have then +

    +$$ +z_1 = w_1a_0+b_1 \hspace{0.1cm} \wedge a_1 = \sigma_1(z_1), +$$ -

    where \( I \) is the indicator function, \( 1 \) if \( \tilde{y}_i = y_i \) and \( 0 \) otherwise.

    +$$ +z_2 = w_2a_1+b_2 \hspace{0.1cm} \wedge a_2 = \sigma_2(z_2), +$$ +

    and the cost function

    +$$ +C(x;\boldsymbol{\Theta})=\frac{1}{2}(a_2-y)^2, +$$ - -
    -
    -
    -
    -
    -
    epochs = 100
    -batch_size = 100
    -
    -dnn = NeuralNetwork(X_train, Y_train_onehot, eta=eta, lmbd=lmbd, epochs=epochs, batch_size=batch_size,
    -                    n_hidden_neurons=n_hidden_neurons, n_categories=n_categories)
    -dnn.train()
    -test_predict = dnn.predict(X_test)
    -
    -# accuracy score from scikit library
    -print("Accuracy score on test set: ", accuracy_score(Y_test, test_predict))
    -
    -# equivalent in numpy
    -def accuracy_score_numpy(Y_test, Y_pred):
    -    return np.sum(Y_test == Y_pred) / len(Y_test)
    -
    -#print("Accuracy score on test set: ", accuracy_score_numpy(Y_test, test_predict))
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - +

    with \( \boldsymbol{\Theta}=[w_1,w_2,b_1,b_2] \).

    @@ -415,6 +567,8 @@ test_predict = dnn67

  • 68
  • 69
  • +
  • ...
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs060.html b/doc/pub/week41/html/._week41-bs060.html index 384a3388c..1fffd7a23 100644 --- a/doc/pub/week41/html/._week41-bs060.html +++ b/doc/pub/week41/html/._week41-bs060.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,54 +519,13 @@ MathJax.Hub.Config({

     

     

     

    -

    Adjust hyperparameters

    - -

    We now perform a grid search to find the optimal hyperparameters for the network. -Note that we are only using 1 layer with 50 neurons, and human performance is estimated to be around \( 98\% \) (\( 2\% \) error rate). -

    - - - -
    -
    -
    -
    -
    -
    eta_vals = np.logspace(-5, 1, 7)
    -lmbd_vals = np.logspace(-5, 1, 7)
    -# store the models for later use
    -DNN_numpy = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object)
    -
    -# grid search
    -for i, eta in enumerate(eta_vals):
    -    for j, lmbd in enumerate(lmbd_vals):
    -        dnn = NeuralNetwork(X_train, Y_train_onehot, eta=eta, lmbd=lmbd, epochs=epochs, batch_size=batch_size,
    -                            n_hidden_neurons=n_hidden_neurons, n_categories=n_categories)
    -        dnn.train()
    -        
    -        DNN_numpy[i][j] = dnn
    -        
    -        test_predict = dnn.predict(X_test)
    -        
    -        print("Learning rate  = ", eta)
    -        print("Lambda = ", lmbd)
    -        print("Accuracy score on test set: ", accuracy_score(Y_test, test_predict))
    -        print()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +

    Layout of a simple neural network with one hidden layer

    +

    +
    +

    +
    +

    @@ -413,6 +550,9 @@ DNN_numpy = np.

  • 67
  • 68
  • 69
  • +
  • 70
  • +
  • ...
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs061.html b/doc/pub/week41/html/._week41-bs061.html index 61b59e731..4b97f4bd9 100644 --- a/doc/pub/week41/html/._week41-bs061.html +++ b/doc/pub/week41/html/._week41-bs061.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,63 +519,27 @@ MathJax.Hub.Config({

     

     

     

    -

    Visualization

    +

    The derivatives

    +

    The derivatives are now, using the chain rule again

    - -
    -
    -
    -
    -
    -
    # visual representation of grid search
    -# uses seaborn heatmap, you can also do this with matplotlib imshow
    -import seaborn as sns
    +$$
    +\frac{\partial C}{\partial w_2}=\frac{\partial C}{\partial a_2}\frac{\partial a_2}{\partial z_2}\frac{\partial z_2}{\partial w_2}=(a_2-y)\sigma_2'a_1=\delta_2a_1,
    +$$
     
    -sns.set()
    +$$
    +\frac{\partial C}{\partial b_2}=\frac{\partial C}{\partial a_2}\frac{\partial a_2}{\partial z_2}\frac{\partial z_2}{\partial b_2}=(a_2-y)\sigma_2'=\delta_2,
    +$$
     
    -train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
    -test_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
    +$$
    +\frac{\partial C}{\partial w_1}=\frac{\partial C}{\partial a_2}\frac{\partial a_2}{\partial z_2}\frac{\partial z_2}{\partial a_1}\frac{\partial a_1}{\partial z_1}\frac{\partial z_1}{\partial w_1}=(a_2-y)\sigma_2'a_1\sigma_1'a_0,
    +$$
     
    -for i in range(len(eta_vals)):
    -    for j in range(len(lmbd_vals)):
    -        dnn = DNN_numpy[i][j]
    -        
    -        train_pred = dnn.predict(X_train) 
    -        test_pred = dnn.predict(X_test)
    -
    -        train_accuracy[i][j] = accuracy_score(Y_train, train_pred)
    -        test_accuracy[i][j] = accuracy_score(Y_test, test_pred)
    -
    -        
    -fig, ax = plt.subplots(figsize = (10, 10))
    -sns.heatmap(train_accuracy, annot=True, ax=ax, cmap="viridis")
    -ax.set_title("Training Accuracy")
    -ax.set_ylabel("$\eta$")
    -ax.set_xlabel("$\lambda$")
    -plt.show()
    -
    -fig, ax = plt.subplots(figsize = (10, 10))
    -sns.heatmap(test_accuracy, annot=True, ax=ax, cmap="viridis")
    -ax.set_title("Test Accuracy")
    -ax.set_ylabel("$\eta$")
    -ax.set_xlabel("$\lambda$")
    -plt.show()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +$$ +\frac{\partial C}{\partial b_1}=\frac{\partial C}{\partial a_2}\frac{\partial a_2}{\partial z_2}\frac{\partial z_2}{\partial a_1}\frac{\partial a_1}{\partial z_1}\frac{\partial z_1}{\partial b_1}=(a_2-y)\sigma_2'\sigma_1'=\delta_1. +$$ +

    Can you generalize this to more than one hidden layer?

    @@ -421,6 +563,10 @@ plt.show()

  • 67
  • 68
  • 69
  • +
  • 70
  • +
  • 71
  • +
  • ...
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs062.html b/doc/pub/week41/html/._week41-bs062.html index ca8d088f8..6909c5002 100644 --- a/doc/pub/week41/html/._week41-bs062.html +++ b/doc/pub/week41/html/._week41-bs062.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,58 +519,18 @@ MathJax.Hub.Config({

     

     

     

    -

    scikit-learn implementation

    +

    Important observations

    -

    scikit-learn focuses more -on traditional machine learning methods, such as regression, -clustering, decision trees, etc. As such, it has only two types of -neural networks: Multi Layer Perceptron outputting continuous values, -MPLRegressor, and Multi Layer Perceptron outputting labels, -MLPClassifier. We will see how simple it is to use these classes. +

    +
    + +

    From the above equations we see that the derivatives of the activation +functions play a central role. If they vanish, the training may +stop. This is called the vanishing gradient problem, see discussions below. If they become +large, the parameters \( w_i \) and \( b_i \) may simply go to infinity. This +is referenced as the exploding gradient problem.

    - -

    scikit-learn implements a few improvements from our neural network, -such as early stopping, a varying learning rate, different -optimization methods, etc. We would therefore expect a better -performance overall. -

    - - - -
    -
    -
    -
    -
    -
    from sklearn.neural_network import MLPClassifier
    -# store models for later use
    -DNN_scikit = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object)
    -
    -for i, eta in enumerate(eta_vals):
    -    for j, lmbd in enumerate(lmbd_vals):
    -        dnn = MLPClassifier(hidden_layer_sizes=(n_hidden_neurons), activation='logistic',
    -                            alpha=lmbd, learning_rate_init=eta, max_iter=epochs)
    -        dnn.fit(X_train, Y_train)
    -        
    -        DNN_scikit[i][j] = dnn
    -        
    -        print("Learning rate  = ", eta)
    -        print("Lambda = ", lmbd)
    -        print("Accuracy score on test set: ", dnn.score(X_test, Y_test))
    -        print()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    @@ -417,6 +555,11 @@ DNN_scikit = np
  • 67
  • 68
  • 69
  • +
  • 70
  • +
  • 71
  • +
  • 72
  • +
  • ...
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs063.html b/doc/pub/week41/html/._week41-bs063.html index 57455ba41..a145f440d 100644 --- a/doc/pub/week41/html/._week41-bs063.html +++ b/doc/pub/week41/html/._week41-bs063.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,63 +519,24 @@ MathJax.Hub.Config({

     

     

     

    -

    Visualization

    +

    The training

    - -
    -
    -
    -
    -
    -
    # optional
    -# visual representation of grid search
    -# uses seaborn heatmap, could probably do this in matplotlib
    -import seaborn as sns
    +

    The training of the parameters is done through various gradient descent approximations with

    -sns.set() +$$ +w_{i}\leftarrow w_{i}- \eta \delta_i a_{i-1}, +$$ -train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals))) -test_accuracy = np.zeros((len(eta_vals), len(lmbd_vals))) +

    and

    +$$ +b_i \leftarrow b_i-\eta \delta_i, +$$ -for i in range(len(eta_vals)): - for j in range(len(lmbd_vals)): - dnn = DNN_scikit[i][j] - - train_pred = dnn.predict(X_train) - test_pred = dnn.predict(X_test) +

    with \( \eta \) is the learning rate.

    - train_accuracy[i][j] = accuracy_score(Y_train, train_pred) - test_accuracy[i][j] = accuracy_score(Y_test, test_pred) - - -fig, ax = plt.subplots(figsize = (10, 10)) -sns.heatmap(train_accuracy, annot=True, ax=ax, cmap="viridis") -ax.set_title("Training Accuracy") -ax.set_ylabel("$\eta$") -ax.set_xlabel("$\lambda$") -plt.show() - -fig, ax = plt.subplots(figsize = (10, 10)) -sns.heatmap(test_accuracy, annot=True, ax=ax, cmap="viridis") -ax.set_title("Test Accuracy") -ax.set_ylabel("$\eta$") -ax.set_xlabel("$\lambda$") -plt.show() -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +

    One iteration consists of one feed forward step and one back-propagation step. Each back-propagation step does one update of the parameters \( \boldsymbol{\Theta} \).

    +

    For the first hidden layer \( a_{i-1}=a_0=x \) for this simple model.

    @@ -419,6 +558,12 @@ plt.show()

  • 67
  • 68
  • 69
  • +
  • 70
  • +
  • 71
  • +
  • 72
  • +
  • 73
  • +
  • ...
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs064.html b/doc/pub/week41/html/._week41-bs064.html index 558cd4f6c..b53c1e041 100644 --- a/doc/pub/week41/html/._week41-bs064.html +++ b/doc/pub/week41/html/._week41-bs064.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,29 +519,101 @@ MathJax.Hub.Config({

     

     

     

    -

    Testing our code for the XOR, OR and AND gates

    +

    Code example

    -

    Last week we discussed three different types of gates, the so-called -XOR, the OR and the AND gates. Their inputs and outputs can be -summarized using the following tables, first for the OR gate with -inputs \( x_1 \) and \( x_2 \) and outputs \( y \): +

    The code here implements the above model with one hidden layer and +scalar variables for the same function we studied in the previous +example. The code is however set up so that we can add multiple +inputs \( x \) and target values \( y \). Note also that we have the +possibility of defining a feature matrix \( \boldsymbol{X} \) with more than just +one column for the input values. This will turn useful in our next example. We have also defined matrices and vectors for all of our operations although it is not necessary here.

    -
    -
    - - - - - - - - - - -
    \( x_1 \) \( x_2 \) \( y \)
    0 0 0
    0 1 1
    1 0 1
    1 1 1
    -
    -
    + + +
    +
    +
    +
    +
    +
    import numpy as np
    +# We use the Sigmoid function as activation function
    +def sigmoid(z):
    +    return 1.0/(1.0+np.exp(-z))
    +
    +def forwardpropagation(x):
    +    # weighted sum of inputs to the hidden layer
    +    z_1 = np.matmul(x, w_1) + b_1
    +    # activation in the hidden layer
    +    a_1 = sigmoid(z_1)
    +    # weighted sum of inputs to the output layer
    +    z_2 = np.matmul(a_1, w_2) + b_2
    +    a_2 = z_2
    +    return a_1, a_2
    +
    +def backpropagation(x, y):
    +    a_1, a_2 = forwardpropagation(x)
    +    # parameter delta for the output layer, note that a_2=z_2 and its derivative wrt z_2 is just 1
    +    delta_2 = a_2 - y
    +    print(0.5*((a_2-y)**2))
    +    # delta for  the hidden layer
    +    delta_1 = np.matmul(delta_2, w_2.T) * a_1 * (1 - a_1)
    +    # gradients for the output layer
    +    output_weights_gradient = np.matmul(a_1.T, delta_2)
    +    output_bias_gradient = np.sum(delta_2, axis=0)
    +    # gradient for the hidden layer
    +    hidden_weights_gradient = np.matmul(x.T, delta_1)
    +    hidden_bias_gradient = np.sum(delta_1, axis=0)
    +    return output_weights_gradient, output_bias_gradient, hidden_weights_gradient, hidden_bias_gradient
    +
    +
    +# ensure the same random numbers appear every time
    +np.random.seed(0)
    +# Input variable
    +x = np.array([4.0],dtype=np.float64)
    +# Target values
    +y = 2*x+1.0 
    +
    +# Defining the neural network, only scalars here
    +n_inputs = x.shape
    +n_features = 1
    +n_hidden_neurons = 1
    +n_outputs = 1
    +
    +# Initialize the network
    +# weights and bias in the hidden layer
    +w_1 = np.random.randn(n_features, n_hidden_neurons)
    +b_1 = np.zeros(n_hidden_neurons) + 0.01
    +
    +# weights and bias in the output layer
    +w_2 = np.random.randn(n_hidden_neurons, n_outputs)
    +b_2 = np.zeros(n_outputs) + 0.01
    +
    +eta = 0.1
    +for i in range(50):
    +    # calculate gradients
    +    derivW2, derivB2, derivW1, derivB1 = backpropagation(x, y)
    +    # update weights and biases
    +    w_2 -= eta * derivW2
    +    b_2 -= eta * derivB2
    +    w_1 -= eta * derivW1
    +    b_1 -= eta * derivB1
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +

    We see that after some few iterations (the results do depend on the learning rate however), we get an error which is rather small.

    @@ -384,6 +634,13 @@ inputs \( x_1 \) and \( x_2 \) and outputs \( y \):

  • 67
  • 68
  • 69
  • +
  • 70
  • +
  • 71
  • +
  • 72
  • +
  • 73
  • +
  • 74
  • +
  • ...
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs065.html b/doc/pub/week41/html/._week41-bs065.html index e43595548..b77770542 100644 --- a/doc/pub/week41/html/._week41-bs065.html +++ b/doc/pub/week41/html/._week41-bs065.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,43 +519,20 @@ MathJax.Hub.Config({

     

     

     

    -

    The AND and XOR Gates

    -

    The AND gate is defined as

    + +

    Exercise 1: Including more data

    -
    -
    - - - - - - - - - - -
    \( x_1 \) \( x_2 \) \( y \)
    0 0 0
    0 1 0
    1 0 0
    1 1 1
    -
    -
    +

    Try to increase the amount of input and +target/output data. Try also to perform calculations for more values +of the learning rates. Feel free to add either hyperparameters with an +\( l_1 \) norm or an \( l_2 \) norm and discuss your results. +Discuss your results as functions of the amount of training data and various learning rates. +

    -

    And finally we have the XOR gate

    +

    Challenge: Try to change the activation functions and replace the hard-coded analytical expressions with automatic derivation via either autograd or JAX.

    -
    -
    - - - - - - - - - - -
    \( x_1 \) \( x_2 \) \( y \)
    0 0 0
    0 1 1
    1 0 1
    1 1 0
    -
    -
    +

    @@ -397,6 +552,14 @@ MathJax.Hub.Config({

  • 67
  • 68
  • 69
  • +
  • 70
  • +
  • 71
  • +
  • 72
  • +
  • 73
  • +
  • 74
  • +
  • 75
  • +
  • ...
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs066.html b/doc/pub/week41/html/._week41-bs066.html index 54db0a3c5..6b6e58b82 100644 --- a/doc/pub/week41/html/._week41-bs066.html +++ b/doc/pub/week41/html/._week41-bs066.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,18 +519,25 @@ MathJax.Hub.Config({

     

     

     

    -

    Representing the Data Sets

    +

    Simple neural network and the back propagation equations

    -

    Our design matrix is defined by the input values \( x_1 \) and \( x_2 \). Since we have four possible outputs, our design matrix reads

    +

    Let us now try to increase our level of ambition and attempt at setting +up the equations for a neural network with two input nodes, one hidden +layer with two hidden nodes and one output layer with one output node/neuron only (see graph).. +

    +

    We need to define the following parameters and variables with the input layer (layer \( (0) \)) +where we label the nodes \( x_0 \) and \( x_1 \) +

    $$ -\boldsymbol{X}=\begin{bmatrix} 0 & 0 \\ - 0 & 1 \\ - 1 & 0 \\ - 1 & 1 \end{bmatrix}, +x_0 = a_0^{(0)} \wedge x_1 = a_1^{(0)}. +$$ + +

    The hidden layer (layer \( (1) \)) has nodes which yield the outputs \( a_0^{(1)} \) and \( a_1^{(1)} \)) with weight \( \boldsymbol{w} \) and bias \( \boldsymbol{b} \) parameters

    +$$ +w_{ij}^{(1)}=\left\{w_{00}^{(1)},w_{01}^{(1)},w_{10}^{(1)},w_{11}^{(1)}\right\} \wedge b^{(1)}=\left\{b_0^{(1)},b_1^{(1)}\right\}. $$ -

    while the vector of outputs is \( \boldsymbol{y}^T=[0,1,1,0] \) for the XOR gate, \( \boldsymbol{y}^T=[0,0,0,1] \) for the AND gate and \( \boldsymbol{y}^T=[0,1,1,1] \) for the OR gate.

    @@ -371,6 +556,15 @@ $$

  • 67
  • 68
  • 69
  • +
  • 70
  • +
  • 71
  • +
  • 72
  • +
  • 73
  • +
  • 74
  • +
  • 75
  • +
  • 76
  • +
  • ...
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs067.html b/doc/pub/week41/html/._week41-bs067.html index dcd6b4113..81fae1b9e 100644 --- a/doc/pub/week41/html/._week41-bs067.html +++ b/doc/pub/week41/html/._week41-bs067.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,98 +519,13 @@ MathJax.Hub.Config({

     

     

     

    -

    Setting up the Neural Network

    +

    Layout of a simple neural network with two input nodes, one hidden layer and one output node

    -

    We define first our design matrix and the various output vectors for the different gates.

    - - - -
    -
    -
    -
    -
    -
    """
    -Simple code that tests XOR, OR and AND gates with linear regression
    -"""
    -
    -# import necessary packages
    -import numpy as np
    -import matplotlib.pyplot as plt
    -from sklearn import datasets
    -
    -def sigmoid(x):
    -    return 1/(1 + np.exp(-x))
    -
    -def feed_forward(X):
    -    # weighted sum of inputs to the hidden layer
    -    z_h = np.matmul(X, hidden_weights) + hidden_bias
    -    # activation in the hidden layer
    -    a_h = sigmoid(z_h)
    -    
    -    # weighted sum of inputs to the output layer
    -    z_o = np.matmul(a_h, output_weights) + output_bias
    -    # softmax output
    -    # axis 0 holds each input and axis 1 the probabilities of each category
    -    probabilities = sigmoid(z_o)
    -    return probabilities
    -
    -# we obtain a prediction by taking the class with the highest likelihood
    -def predict(X):
    -    probabilities = feed_forward(X)
    -    return np.argmax(probabilities, axis=1)
    -
    -# ensure the same random numbers appear every time
    -np.random.seed(0)
    -
    -# Design matrix
    -X = np.array([ [0, 0], [0, 1], [1, 0],[1, 1]],dtype=np.float64)
    -
    -# The XOR gate
    -yXOR = np.array( [ 0, 1 ,1, 0])
    -# The OR gate
    -yOR = np.array( [ 0, 1 ,1, 1])
    -# The AND gate
    -yAND = np.array( [ 0, 0 ,0, 1])
    -
    -# Defining the neural network
    -n_inputs, n_features = X.shape
    -n_hidden_neurons = 2
    -n_categories = 2
    -n_features = 2
    -
    -# we make the weights normally distributed using numpy.random.randn
    -
    -# weights and bias in the hidden layer
    -hidden_weights = np.random.randn(n_features, n_hidden_neurons)
    -hidden_bias = np.zeros(n_hidden_neurons) + 0.01
    -
    -# weights and bias in the output layer
    -output_weights = np.random.randn(n_hidden_neurons, n_categories)
    -output_bias = np.zeros(n_categories) + 0.01
    -
    -probabilities = feed_forward(X)
    -print(probabilities)
    -
    -
    -predictions = predict(X)
    -print(predictions)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    Not an impressive result, but this was our first forward pass with randomly assigned weights. Let us now add the full network with the back-propagation algorithm discussed above.

    +

    +
    +

    +
    +

    @@ -450,6 +543,16 @@ predictions = predict(X)

  • 67
  • 68
  • 69
  • +
  • 70
  • +
  • 71
  • +
  • 72
  • +
  • 73
  • +
  • 74
  • +
  • 75
  • +
  • 76
  • +
  • 77
  • +
  • ...
  • +
  • 113
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs068.html b/doc/pub/week41/html/._week41-bs068.html index 92286541e..2ff202d52 100644 --- a/doc/pub/week41/html/._week41-bs068.html +++ b/doc/pub/week41/html/._week41-bs068.html @@ -91,36 +91,67 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d None, 'does-logistic-regression-do-a-better-job'), ('Adding Neural Networks', 2, None, 'adding-neural-networks'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Mathematical model', 2, None, 'mathematical-model'), - ('Matrix-vector notation', 3, None, 'matrix-vector-notation'), - ('Matrix-vector notation and activation', - 3, - None, - 'matrix-vector-notation-and-activation'), - ('Activation functions', 3, None, 'activation-functions'), - ('Activation functions, Logistic and Hyperbolic ones', - 3, - None, - 'activation-functions-logistic-and-hyperbolic-ones'), - ('Relevance', 3, None, 'relevance'), - ('The multilayer perceptron (MLP)', + ('Mathematics of deep learning', 2, None, - 'the-multilayer-perceptron-mlp'), - ('From one to many layers, the universal approximation theorem', + 'mathematics-of-deep-learning'), + ('Reminder on books with hands-on material and codes', 2, None, - 'from-one-to-many-layers-the-universal-approximation-theorem'), - ('Deriving the back propagation code for a multilayer perceptron ' - 'model', + 'reminder-on-books-with-hands-on-material-and-codes'), + ('Reading recommendations', 2, None, 'reading-recommendations'), + ('Mathematics of deep learning and neural networks', 2, None, - 'deriving-the-back-propagation-code-for-a-multilayer-perceptron-model'), + 'mathematics-of-deep-learning-and-neural-networks'), + ('Basics of an NN', 2, None, 'basics-of-an-nn'), + ('Overarching view of a neural network', + 2, + None, + 'overarching-view-of-a-neural-network'), + ('The optimization problem', 2, None, 'the-optimization-problem'), + ('Parameters of neural networks', + 2, + None, + 'parameters-of-neural-networks'), + ('Other ingredients of a neural network', + 2, + None, + 'other-ingredients-of-a-neural-network'), + ('Other parameters', 2, None, 'other-parameters'), + ('Universal approximation theorem', + 2, + None, + 'universal-approximation-theorem'), + ('Some parallels from real analysis', + 2, + None, + 'some-parallels-from-real-analysis'), + ('The approximation theorem in words', + 2, + None, + 'the-approximation-theorem-in-words'), + ('More on the general approximation theorem', + 2, + None, + 'more-on-the-general-approximation-theorem'), + ('Class of functions we can approximate', + 2, + None, + 'class-of-functions-we-can-approximate'), + ('Setting up the equations for a neural network', + 2, + None, + 'setting-up-the-equations-for-a-neural-network'), + ('Layout of a neural network with three hidden layers', + 2, + None, + 'layout-of-a-neural-network-with-three-hidden-layers'), ('Definitions', 2, None, 'definitions'), + ('Inputs to the activation function', + 2, + None, + 'inputs-to-the-activation-function'), ('Derivatives and the chain rule', 2, None, @@ -129,10 +160,125 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'derivative-of-the-cost-function'), - ('Bringing it together, first back propagation equation', + ('Simpler examples first, and automatic differentiation', 2, None, - 'bringing-it-together-first-back-propagation-equation'), + 'simpler-examples-first-and-automatic-differentiation'), + ('Reminder on the chain rule and gradients', + 2, + None, + 'reminder-on-the-chain-rule-and-gradients'), + ('Multivariable functions', 2, None, 'multivariable-functions'), + ('Automatic differentiation through examples', + 2, + None, + 'automatic-differentiation-through-examples'), + ('Simple example', 2, None, 'simple-example'), + ('Smarter way of evaluating the above function', + 2, + None, + 'smarter-way-of-evaluating-the-above-function'), + ('Reducing the number of operations', + 2, + None, + 'reducing-the-number-of-operations'), + ('Chain rule, forward and reverse modes', + 2, + None, + 'chain-rule-forward-and-reverse-modes'), + ('Forward and reverse modes', + 2, + None, + 'forward-and-reverse-modes'), + ('More complicated function', + 2, + None, + 'more-complicated-function'), + ('Counting the number of floating point operations', + 2, + None, + 'counting-the-number-of-floating-point-operations'), + ('Defining intermediate operations', + 2, + None, + 'defining-intermediate-operations'), + ('New expression for the derivative', + 2, + None, + 'new-expression-for-the-derivative'), + ('Final derivatives', 2, None, 'final-derivatives'), + ('In general not this simple', + 2, + None, + 'in-general-not-this-simple'), + ('Automatic differentiation', + 2, + None, + 'automatic-differentiation'), + ('Chain rule', 2, None, 'chain-rule'), + ('First network example, simple percepetron with one input', + 2, + None, + 'first-network-example-simple-percepetron-with-one-input'), + ('Layout of a simple neural network with no hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-no-hidden-layer'), + ('Optimizing the parameters', + 2, + None, + 'optimizing-the-parameters'), + ('Adding a hidden layer', 2, None, 'adding-a-hidden-layer'), + ('Layout of a simple neural network with one hidden layer', + 2, + None, + 'layout-of-a-simple-neural-network-with-one-hidden-layer'), + ('The derivatives', 2, None, 'the-derivatives'), + ('Important observations', 2, None, 'important-observations'), + ('The training', 2, None, 'the-training'), + ('Code example', 2, None, 'code-example'), + ('Exercise 1: Including more data', + 2, + None, + 'exercise-1-including-more-data'), + ('Simple neural network and the back propagation equations', + 2, + None, + 'simple-neural-network-and-the-back-propagation-equations'), + ('Layout of a simple neural network with two input nodes, one ' + 'hidden layer and one output node', + 2, + None, + 'layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node'), + ('The ouput layer', 2, None, 'the-ouput-layer'), + ('Compact expressions', 2, None, 'compact-expressions'), + ('Output layer', 2, None, 'output-layer'), + ('Explicit derivatives', 2, None, 'explicit-derivatives'), + ('Derivatives of the hidden layer', + 2, + None, + 'derivatives-of-the-hidden-layer'), + ('Final expression', 2, None, 'final-expression'), + ('Completing the list', 2, None, 'completing-the-list'), + ('Final expressions for the biases of the hidden layer', + 2, + None, + 'final-expressions-for-the-biases-of-the-hidden-layer'), + ('Gradient expressions', 2, None, 'gradient-expressions'), + ('Exercise 2: Extended program', + 2, + None, + 'exercise-2-extended-program'), + ('Getting serious, the back propagation equations for a neural ' + 'network', + 2, + None, + 'getting-serious-the-back-propagation-equations-for-a-neural-network'), + ('Analyzing the last results', + 2, + None, + 'analyzing-the-last-results'), + ('More considerations', 2, None, 'more-considerations'), ('Derivatives in terms of $z_j^L$', 2, None, @@ -142,92 +288,80 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d 2, None, 'final-back-propagating-equation'), - ('Setting up the Back propagation algorithm', + ('Using the chain rule and summing over all $k$ entries', + 2, + None, + 'using-the-chain-rule-and-summing-over-all-k-entries'), + ('Setting up the back propagation algorithm', 2, None, 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + ('Setting up the back propagation algorithm, part 2', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up the Back propagation algorithm', + 'setting-up-the-back-propagation-algorithm-part-2'), + ('Setting up the Back propagation algorithm, part 3', 2, None, - 'setting-up-the-back-propagation-algorithm'), - ('Setting up a Multi-layer perceptron model for classification', + 'setting-up-the-back-propagation-algorithm-part-3'), + ('Updating the gradients', 2, None, 'updating-the-gradients'), + ('Activation functions', 3, None, 'activation-functions'), + ('Activation functions, Logistic and Hyperbolic ones', + 3, + None, + 'activation-functions-logistic-and-hyperbolic-ones'), + ('Relevance', 3, None, 'relevance'), + ('Fine-tuning neural network hyperparameters', 2, None, - 'setting-up-a-multi-layer-perceptron-model-for-classification'), - ('Defining the cost function', + 'fine-tuning-neural-network-hyperparameters'), + ('Hidden layers', 2, None, 'hidden-layers'), + ('Vanishing gradients', 2, None, 'vanishing-gradients'), + ('Exploding gradients', 2, None, 'exploding-gradients'), + ('Is the Logistic activation function (Sigmoid) our choice?', 2, None, - 'defining-the-cost-function'), - ('Example: binary classification problem', + 'is-the-logistic-activation-function-sigmoid-our-choice'), + ('Logistic function as the root of problems', 2, None, - 'example-binary-classification-problem'), - ('The Softmax function', 2, None, 'the-softmax-function'), - ('Developing a code for doing neural networks with back ' - 'propagation', + 'logistic-function-as-the-root-of-problems'), + ('The derivative of the Logistic funtion', 2, None, - 'developing-a-code-for-doing-neural-networks-with-back-propagation'), - ('Collect and pre-process data', + 'the-derivative-of-the-logistic-funtion'), + ('Insights from the paper by Glorot and Bengio', 2, None, - 'collect-and-pre-process-data'), - ('Train and test datasets', 2, None, 'train-and-test-datasets'), - ('Define model and architecture', + 'insights-from-the-paper-by-glorot-and-bengio'), + ('The RELU function family', 2, None, 'the-relu-function-family'), + ('ELU function', 2, None, 'elu-function'), + ('Which activation function should we use?', 2, None, - 'define-model-and-architecture'), - ('Layers', 2, None, 'layers'), - ('Weights and biases', 2, None, 'weights-and-biases'), - ('Feed-forward pass', 2, None, 'feed-forward-pass'), - ('Matrix multiplications', 2, None, 'matrix-multiplications'), - ('Choose cost function and optimizer', + 'which-activation-function-should-we-use'), + ('More on activation functions, output layers', 2, None, - 'choose-cost-function-and-optimizer'), - ('Optimizing the cost function', + 'more-on-activation-functions-output-layers'), + ('Batch Normalization', 2, None, 'batch-normalization'), + ('Dropout', 2, None, 'dropout'), + ('Gradient Clipping', 2, None, 'gradient-clipping'), + ('A top-down perspective on Neural networks', 2, None, - 'optimizing-the-cost-function'), - ('Regularization', 2, None, 'regularization'), - ('Matrix multiplication', 2, None, 'matrix-multiplication'), - ('Improving performance', 2, None, 'improving-performance'), - ('Full object-oriented implementation', + 'a-top-down-perspective-on-neural-networks'), + ('More top-down perspectives', 2, None, - 'full-object-oriented-implementation'), - ('Evaluate model performance on test data', + 'more-top-down-perspectives'), + ('Limitations of supervised learning with deep networks', 2, None, - 'evaluate-model-performance-on-test-data'), - ('Adjust hyperparameters', 2, None, 'adjust-hyperparameters'), - ('Visualization', 2, None, 'visualization'), - ('scikit-learn implementation', - 2, - None, - 'scikit-learn-implementation'), - ('Visualization', 2, None, 'visualization'), - ('Testing our code for the XOR, OR and AND gates', - 2, - None, - 'testing-our-code-for-the-xor-or-and-and-gates'), - ('The AND and XOR Gates', 2, None, 'the-and-and-xor-gates'), - ('Representing the Data Sets', - 2, - None, - 'representing-the-data-sets'), - ('Setting up the Neural Network', - 2, - None, - 'setting-up-the-neural-network'), - ('The Code using Scikit-Learn', - 2, - None, - 'the-code-using-scikit-learn')]} + 'limitations-of-supervised-learning-with-deep-networks'), + ('Limitations of NNs', 2, None, 'limitations-of-nns'), + ('Homogeneous data', 2, None, 'homogeneous-data'), + ('More limitations', 2, None, 'more-limitations')]} end of tocinfo --> @@ -279,57 +413,101 @@ MathJax.Hub.Config({
  • Examples of XOR, OR and AND gates
  • Does Logistic Regression do a better Job?
  • Adding Neural Networks
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  • Mathematical model
  • -
  •    Matrix-vector notation
  • -
  •    Matrix-vector notation and activation
  • -
  •    Activation functions
  • -
  •    Activation functions, Logistic and Hyperbolic ones
  • -
  •    Relevance
  • -
  • The multilayer perceptron (MLP)
  • -
  • From one to many layers, the universal approximation theorem
  • -
  • Deriving the back propagation code for a multilayer perceptron model
  • -
  • Definitions
  • -
  • Derivatives and the chain rule
  • -
  • Derivative of the cost function
  • -
  • Bringing it together, first back propagation equation
  • -
  • Derivatives in terms of \( z_j^L \)
  • -
  • Bringing it together
  • -
  • Final back propagating equation
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up the Back propagation algorithm
  • -
  • Setting up a Multi-layer perceptron model for classification
  • -
  • Defining the cost function
  • -
  • Example: binary classification problem
  • -
  • The Softmax function
  • -
  • Developing a code for doing neural networks with back propagation
  • -
  • Collect and pre-process data
  • -
  • Train and test datasets
  • -
  • Define model and architecture
  • -
  • Layers
  • -
  • Weights and biases
  • -
  • Feed-forward pass
  • -
  • Matrix multiplications
  • -
  • Choose cost function and optimizer
  • -
  • Optimizing the cost function
  • -
  • Regularization
  • -
  • Matrix multiplication
  • -
  • Improving performance
  • -
  • Full object-oriented implementation
  • -
  • Evaluate model performance on test data
  • -
  • Adjust hyperparameters
  • -
  • Visualization
  • -
  • scikit-learn implementation
  • -
  • Visualization
  • -
  • Testing our code for the XOR, OR and AND gates
  • -
  • The AND and XOR Gates
  • -
  • Representing the Data Sets
  • -
  • Setting up the Neural Network
  • -
  • The Code using Scikit-Learn
  • +
  • Mathematics of deep learning
  • +
  • Reminder on books with hands-on material and codes
  • +
  • Reading recommendations
  • +
  • Mathematics of deep learning and neural networks
  • +
  • Basics of an NN
  • +
  • Overarching view of a neural network
  • +
  • The optimization problem
  • +
  • Parameters of neural networks
  • +
  • Other ingredients of a neural network
  • +
  • Other parameters
  • +
  • Universal approximation theorem
  • +
  • Some parallels from real analysis
  • +
  • The approximation theorem in words
  • +
  • More on the general approximation theorem
  • +
  • Class of functions we can approximate
  • +
  • Setting up the equations for a neural network
  • +
  • Layout of a neural network with three hidden layers
  • +
  • Definitions
  • +
  • Inputs to the activation function
  • +
  • Derivatives and the chain rule
  • +
  • Derivative of the cost function
  • +
  • Simpler examples first, and automatic differentiation
  • +
  • Reminder on the chain rule and gradients
  • +
  • Multivariable functions
  • +
  • Automatic differentiation through examples
  • +
  • Simple example
  • +
  • Smarter way of evaluating the above function
  • +
  • Reducing the number of operations
  • +
  • Chain rule, forward and reverse modes
  • +
  • Forward and reverse modes
  • +
  • More complicated function
  • +
  • Counting the number of floating point operations
  • +
  • Defining intermediate operations
  • +
  • New expression for the derivative
  • +
  • Final derivatives
  • +
  • In general not this simple
  • +
  • Automatic differentiation
  • +
  • Chain rule
  • +
  • First network example, simple percepetron with one input
  • +
  • Layout of a simple neural network with no hidden layer
  • +
  • Optimizing the parameters
  • +
  • Adding a hidden layer
  • +
  • Layout of a simple neural network with one hidden layer
  • +
  • The derivatives
  • +
  • Important observations
  • +
  • The training
  • +
  • Code example
  • +
  • Exercise 1: Including more data
  • +
  • Simple neural network and the back propagation equations
  • +
  • Layout of a simple neural network with two input nodes, one hidden layer and one output node
  • +
  • The ouput layer
  • +
  • Compact expressions
  • +
  • Output layer
  • +
  • Explicit derivatives
  • +
  • Derivatives of the hidden layer
  • +
  • Final expression
  • +
  • Completing the list
  • +
  • Final expressions for the biases of the hidden layer
  • +
  • Gradient expressions
  • +
  • Exercise 2: Extended program
  • +
  • Getting serious, the back propagation equations for a neural network
  • +
  • Analyzing the last results
  • +
  • More considerations
  • +
  • Derivatives in terms of \( z_j^L \)
  • +
  • Bringing it together
  • +
  • Final back propagating equation
  • +
  • Using the chain rule and summing over all \( k \) entries
  • +
  • Setting up the back propagation algorithm
  • +
  • Setting up the back propagation algorithm, part 2
  • +
  • Setting up the Back propagation algorithm, part 3
  • +
  • Updating the gradients
  • +
  •    Activation functions
  • +
  •    Activation functions, Logistic and Hyperbolic ones
  • +
  •    Relevance
  • +
  • Fine-tuning neural network hyperparameters
  • +
  • Hidden layers
  • +
  • Vanishing gradients
  • +
  • Exploding gradients
  • +
  • Is the Logistic activation function (Sigmoid) our choice?
  • +
  • Logistic function as the root of problems
  • +
  • The derivative of the Logistic funtion
  • +
  • Insights from the paper by Glorot and Bengio
  • +
  • The RELU function family
  • +
  • ELU function
  • +
  • Which activation function should we use?
  • +
  • More on activation functions, output layers
  • +
  • Batch Normalization
  • +
  • Dropout
  • +
  • Gradient Clipping
  • +
  • A top-down perspective on Neural networks
  • +
  • More top-down perspectives
  • +
  • Limitations of supervised learning with deep networks
  • +
  • Limitations of NNs
  • +
  • Homogeneous data
  • +
  • More limitations
  • @@ -341,86 +519,19 @@ MathJax.Hub.Config({

     

     

     

    -

    The Code using Scikit-Learn

    +

    The ouput layer

    +

    Finally, we have the ouput layer given by layer label \( (2) \) with output \( a^{(2)} \) and weights and biases to be determined given by the variables

    +$$ +w_{i}^{(2)}=\left\{w_{0}^{(2)},w_{1}^{(2)}\right\} \wedge b^{(2)}. +$$ - -
    -
    -
    -
    -
    -
    # import necessary packages
    -import numpy as np
    -import matplotlib.pyplot as plt
    -from sklearn.neural_network import MLPClassifier
    -from sklearn.metrics import accuracy_score
    -import seaborn as sns
    -
    -# ensure the same random numbers appear every time
    -np.random.seed(0)
    -
    -# Design matrix
    -X = np.array([ [0, 0], [0, 1], [1, 0],[1, 1]],dtype=np.float64)
    -
    -# The XOR gate
    -yXOR = np.array( [ 0, 1 ,1, 0])
    -# The OR gate
    -yOR = np.array( [ 0, 1 ,1, 1])
    -# The AND gate
    -yAND = np.array( [ 0, 0 ,0, 1])
    -
    -# Defining the neural network
    -n_inputs, n_features = X.shape
    -n_hidden_neurons = 2
    -n_categories = 2
    -n_features = 2
    -
    -eta_vals = np.logspace(-5, 1, 7)
    -lmbd_vals = np.logspace(-5, 1, 7)
    -# store models for later use
    -DNN_scikit = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object)
    -epochs = 100
    -
    -for i, eta in enumerate(eta_vals):
    -    for j, lmbd in enumerate(lmbd_vals):
    -        dnn = MLPClassifier(hidden_layer_sizes=(n_hidden_neurons), activation='logistic',
    -                            alpha=lmbd, learning_rate_init=eta, max_iter=epochs)
    -        dnn.fit(X, yXOR)
    -        DNN_scikit[i][j] = dnn
    -        print("Learning rate  = ", eta)
    -        print("Lambda = ", lmbd)
    -        print("Accuracy score on data set: ", dnn.score(X, yXOR))
    -        print()
    -
    -sns.set()
    -test_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
    -for i in range(len(eta_vals)):
    -    for j in range(len(lmbd_vals)):
    -        dnn = DNN_scikit[i][j]
    -        test_pred = dnn.predict(X)
    -        test_accuracy[i][j] = accuracy_score(yXOR, test_pred)
    -
    -fig, ax = plt.subplots(figsize = (10, 10))
    -sns.heatmap(test_accuracy, annot=True, ax=ax, cmap="viridis")
    -ax.set_title("Test Accuracy")
    -ax.set_ylabel("$\eta$")
    -ax.set_xlabel("$\lambda$")
    -plt.show()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +

    Our output is \( \tilde{y}=a^{(2)} \) and we define a generic cost function \( C(a^{(2)},y;\boldsymbol{\Theta}) \) where \( y \) is the target value (a scalar here). +The parameters we need to optimize are given by +

    +$$ +\boldsymbol{\Theta}=\left\{w_{00}^{(1)},w_{01}^{(1)},w_{10}^{(1)},w_{11}^{(1)},w_{0}^{(2)},w_{1}^{(2)},b_0^{(1)},b_1^{(1)},b^{(2)}\right\}. +$$

    @@ -438,6 +549,18 @@ plt.show()

  • 67
  • 68
  • 69
  • +
  • 70
  • +
  • 71
  • +
  • 72
  • +
  • 73
  • +
  • 74
  • +
  • 75
  • +
  • 76
  • +
  • 77
  • +
  • 78
  • +
  • ...
  • +
  • 113
  • +
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs069.html b/doc/pub/week41/html/._week41-bs069.html index 3e8cf6f38..3e506965c 100644 --- a/doc/pub/week41/html/._week41-bs069.html +++ b/doc/pub/week41/html/._week41-bs069.html @@ -8,8 +8,8 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d - -Week 41 Constructing a Neural Network code, Tensor flow and start Convolutional Neural Networks + +Week 41 Neural networks and constructing a neural network code @@ -36,129 +36,306 @@ doconce format html week41.do.txt --html_style=bootstrap --pygments_html_style=d @@ -339,115 +389,125 @@ MathJax.Hub.Config({ - Week 41 Constructing a Neural Network code, Tensor flow and start Convolutional Neural Networks + Week 41 Neural networks and constructing a neural network code