From 7dbf9c6e9ff5eee32a7b05792285ecc0932b1195 Mon Sep 17 00:00:00 2001 From: mhjensen Date: Mon, 5 Oct 2020 22:28:56 +0200 Subject: [PATCH] update week41 --- doc/pub/week41/html/._week41-bs000.html | 187 +- doc/pub/week41/html/._week41-bs001.html | 225 +- doc/pub/week41/html/._week41-bs002.html | 210 +- doc/pub/week41/html/._week41-bs003.html | 273 ++- doc/pub/week41/html/._week41-bs004.html | 230 +- doc/pub/week41/html/._week41-bs005.html | 248 +- doc/pub/week41/html/._week41-bs006.html | 238 +- doc/pub/week41/html/._week41-bs007.html | 211 +- doc/pub/week41/html/._week41-bs008.html | 205 +- doc/pub/week41/html/._week41-bs009.html | 282 ++- doc/pub/week41/html/._week41-bs010.html | 238 +- doc/pub/week41/html/._week41-bs011.html | 239 +- doc/pub/week41/html/._week41-bs012.html | 235 +- doc/pub/week41/html/._week41-bs013.html | 250 ++- doc/pub/week41/html/._week41-bs014.html | 220 +- doc/pub/week41/html/._week41-bs015.html | 385 ++-- doc/pub/week41/html/._week41-bs016.html | 239 +- doc/pub/week41/html/._week41-bs017.html | 245 +- doc/pub/week41/html/._week41-bs018.html | 251 ++- doc/pub/week41/html/._week41-bs019.html | 315 ++- doc/pub/week41/html/._week41-bs020.html | 234 +- doc/pub/week41/html/._week41-bs021.html | 307 ++- doc/pub/week41/html/week41-bs.html | 187 +- doc/pub/week41/html/week41-reveal.html | 2041 ++++++++++++++++- doc/pub/week41/html/week41-solarized.html | 2044 ++++++++++++++++- doc/pub/week41/html/week41.html | 2044 ++++++++++++++++- doc/pub/week41/ipynb/ipynb-week41-src.tar.gz | Bin 87181 -> 87344 bytes doc/pub/week41/ipynb/week41.ipynb | 2122 +++++++++++++++++- doc/src/week41/week41.do.txt | 1668 ++++++++++++++ 29 files changed, 13902 insertions(+), 1671 deletions(-) diff --git a/doc/pub/week41/html/._week41-bs000.html b/doc/pub/week41/html/._week41-bs000.html index 2d605a454..112def37d 100644 --- a/doc/pub/week41/html/._week41-bs000.html +++ b/doc/pub/week41/html/._week41-bs000.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -167,7 +264,7 @@ MathJax.Hub.Config({
[2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

-

Sep 16, 2020

+

Oct 5, 2020


@@ -191,7 +288,7 @@ MathJax.Hub.Config({

  • 9
  • 10
  • ...
  • -
  • 22
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs001.html b/doc/pub/week41/html/._week41-bs001.html index ebfb1bdde..14450926f 100644 --- a/doc/pub/week41/html/._week41-bs001.html +++ b/doc/pub/week41/html/._week41-bs001.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,41 +245,15 @@ MathJax.Hub.Config({ -

    Convolutional Neural Networks (recognizing images)

    +

    Plan for week 40

    -

    -Convolutional neural networks (CNNs) were developed during the last -decade of the previous century, with a focus on character recognition -tasks. Nowadays, CNNs are a central element in the spectacular success -of dee learning methods. The success in for example image -classifications have made them a central tool for most machine -learning practitioners. +

    -

    -CNNs are very similar to ordinary Neural Networks. -They are made up of neurons that have learnable weights and -biases. Each neuron receives some inputs, performs a dot product and -optionally follows it with a non-linearity. The whole network still -expresses a single differentiable score function: from the raw image -pixels on one end to class scores at the other. And they still have a -loss function (for example Softmax) on the last (fully-connected) layer -and all the tips/tricks we developed for learning regular Neural -Networks still apply (back propagation, gradient descent etc etc). - -

    -What is the difference? CNN architectures make the explicit assumption that -the inputs are images, which allows us to encode certain properties -into the architecture. These then make the forward function more -efficient to implement and vastly reduce the amount of parameters in -the network. - -

    -Here we provide only a superficial overview, for the more interested, we recommend highly the course -IN5400 – Machine Learning for Image Analysis -and the slides of CS231. - -

    -Another good read is the article here https://arxiv.org/pdf/1603.07285.pdf. +Reading suggestions for both days: Aurelien Geron's chapters 10-11 and Hastie et al chapter 11.

    @@ -201,7 +272,7 @@ Another good read is the article here 10

  • 11
  • ...
  • -
  • 22
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs002.html b/doc/pub/week41/html/._week41-bs002.html index 9cd64b985..77353ed99 100644 --- a/doc/pub/week41/html/._week41-bs002.html +++ b/doc/pub/week41/html/._week41-bs002.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,30 +245,11 @@ MathJax.Hub.Config({ -

    Regular NNs don’t scale well to full images

    +

    Overview video for week 41

    -As an example, consider -an image of size \( 32\times 32\times 3 \) (32 wide, 32 high, 3 color channels), so a -single fully-connected neuron in a first hidden layer of a regular -Neural Network would have \( 32\times 32\times 3 = 3072 \) weights. This amount still -seems manageable, but clearly this fully-connected structure does not -scale to larger images. For example, an image of more respectable -size, say \( 200\times 200\times 3 \), would lead to neurons that have -\( 200\times 200\times 3 = 120,000 \) weights. - -

    -We could have -several such neurons, and the parameters would add up quickly! Clearly, -this full connectivity is wasteful and the huge number of parameters -would quickly lead to possible overfitting. - -

    -

    -
    -

    Figure 1: A regular 3-layer Neural Network.

    -

    -
    +"Overview Video, from Stochastic Gradient methods to Neural Networks":"https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h20\ +/forelesningsvideoer/OverviewWeek41.mp4?vrtx=view-as-webpage"

    @@ -191,7 +269,7 @@ would quickly lead to possible overfitting.

  • 11
  • 12
  • ...
  • -
  • 22
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs003.html b/doc/pub/week41/html/._week41-bs003.html index c7d1e2c90..2950424d8 100644 --- a/doc/pub/week41/html/._week41-bs003.html +++ b/doc/pub/week41/html/._week41-bs003.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,42 +245,78 @@ MathJax.Hub.Config({ -

    3D volumes of neurons

    +

    Setting up the Back propagation algorithm

    -Convolutional Neural Networks take advantage of the fact that the -input consists of images and they constrain the architecture in a more -sensible way. +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.

    -In particular, unlike a regular Neural Network, the -layers of a CNN have neurons arranged in 3 dimensions: width, -height, depth. (Note that the word depth here refers to the third -dimension of an activation volume, not to the depth of a full Neural -Network, which can refer to the total number of layers in a network.) +

    +
    +

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

    +
    +

    -To understand it better, the above example of an image -with an input volume of -activations has dimensions \( 32\times 32\times 3 \) (width, height, -depth respectively). +

    +
    +

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

    +
    +

    -The neurons in a layer will -only be connected to a small region of the layer before it, instead of -all of the neurons in a fully-connected manner. Moreover, the final -output layer could for this specific image have dimensions \( 1\times 1 \times 10 \), -because by the -end of the CNN architecture we will reduce the full image into a -single vector of class scores, arranged along the depth -dimension. +

    +
    +

    +Thereafter we compute the ouput error \( \hat{\delta}^L \) by computing all +$$ +\delta_j^L = f'(z_j^L)\frac{\partial {\cal C}}{\partial (a_j^L)}. +$$ +

    +
    +

    -

    -
    -

    Figure 2: A CNN arranges its neurons in three dimensions (width, height, depth), as visualized in one of the layers. Every layer of a CNN transforms the 3D input volume to a 3D output volume of neuron activations. In this example, the red input layer holds the image, so its width and height would be the dimensions of the image, and the depth would be 3 (Red, Green, Blue channels).

    -

    -
    +
    +
    +

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

    @@ -204,7 +337,7 @@ dimension.

  • 12
  • 13
  • ...
  • -
  • 22
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs004.html b/doc/pub/week41/html/._week41-bs004.html index 701a7a0e4..be4e3edca 100644 --- a/doc/pub/week41/html/._week41-bs004.html +++ b/doc/pub/week41/html/._week41-bs004.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,27 +245,42 @@ MathJax.Hub.Config({ -

    Layers used to build CNNs

    +

    Setting up a Multi-layer perceptron model for classification

    -A simple CNN is a sequence of layers, and every layer of a CNN -transforms one volume of activations to another through a -differentiable function. We use three main types of layers to build -CNN architectures: Convolutional Layer, Pooling Layer, and -Fully-Connected Layer (exactly as seen in regular Neural Networks). We -will stack these layers to form a full CNN architecture. +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.

    -A simple CNN for image classification could have the architecture: +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 +$$ +P(y = 0 \mid \hat{x}, \hat{\theta}) = \frac{1}{1 + \exp{(- \hat{x}})} , +$$ +and +$$ +P(y = 1 \mid \hat{x}, \hat{\theta}) = 1 - P(y = 0 \mid \hat{x}, \hat{\theta}) , +$$ + +

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

    diff --git a/doc/pub/week41/html/._week41-bs005.html b/doc/pub/week41/html/._week41-bs005.html index 8ee02e01b..07d12bec2 100644 --- a/doc/pub/week41/html/._week41-bs005.html +++ b/doc/pub/week41/html/._week41-bs005.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,21 +245,62 @@ MathJax.Hub.Config({ -

    Transforming images

    +

    Defining the cost function

    -CNNs transform the original image layer by layer from the original -pixel values to the final class scores. +Our cost function is given as (see the Logistic regression lectures) +$$ +\mathcal{C}(\hat{\theta}) = - \ln P(\mathcal{D} \mid \hat{\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(\hat{\theta}) . +$$

    -Observe that some layers contain -parameters and other don’t. In particular, the CNN layers perform -transformations that are a function of not only the activations in the -input volume, but also of the parameters (the weights and biases of -the neurons). On the other hand, the RELU/POOL layers will implement a -fixed function. The parameters in the CONV/FC layers will be trained -with gradient descent so that the class scores that the CNN computes -are consistent with the labels in the training set for each image. +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(\hat{\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. + +

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

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

    +\( y = 1 \quad \rightarrow \quad \hat{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 \( \hat{x}_i \) is the \( i \)-th input (image), \( y_{ic} \) refers to the \( c \)-th component of the \( i \)-th +output vector \( \hat{y}_i \). +The probability of \( \hat{x}_i \) being in class \( c \) will be given by the softmax function: + +$$ +P(y_{ic} = 1 \mid \hat{x}_i, \hat{\theta}) = \frac{\exp{((\hat{a}_i^{hidden})^T \hat{w}_c)}} +{\sum_{c'=0}^{C-1} \exp{((\hat{a}_i^{hidden})^T \hat{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 \hat{\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}(\hat{\theta}) = - \log{P(\mathcal{D} \mid \hat{\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!

    @@ -185,7 +323,7 @@ are consistent with the labels in the training set for each image.

  • 14
  • 15
  • ...
  • -
  • 22
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs006.html b/doc/pub/week41/html/._week41-bs006.html index 041a03b41..ec4443f11 100644 --- a/doc/pub/week41/html/._week41-bs006.html +++ b/doc/pub/week41/html/._week41-bs006.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,23 +245,50 @@ MathJax.Hub.Config({ -

    CNNs in brief

    +

    Example: binary classification problem

    -In summary: +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 +$$ +\mathcal{C}(\hat{\beta}) = - \sum_{i=1}^n \left(y_i\log{p(y_i \vert x_i,\hat{\beta})}+(1-y_i)\log{1-p(y_i \vert x_i,\hat{\beta})}\right), +$$ -

    +where we had defined the logistic (sigmoid) function +$$ +p(y_i =1\vert x_i,\hat{\beta})=\frac{\exp{(\beta_0+\beta_1 x_i)}}{1+\exp{(\beta_0+\beta_1 x_i)}}, +$$ -For more material on convolutional networks, we strongly recommend -the course -IN5400 – Machine Learning for Image Analysis -and the slides of CS231 which is taught at Stanford University (consistently ranked as one of the top computer science programs in the world). Michael Nielsen's book is a must read, in particular chapter 6 which deals with CNNs. +and +$$ +p(y_i =0\vert x_i,\hat{\beta})=1-p(y_i =1\vert x_i,\hat{\beta}). +$$ + +The parameters \( \hat{\beta} \) were defined using a minimization method like gradient descent or Newton-Raphson's method. + +

    +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}(\hat{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}(\hat{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.

    @@ -188,7 +312,7 @@ and the slides of 15

  • 16
  • ...
  • -
  • 22
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs007.html b/doc/pub/week41/html/._week41-bs007.html index 528796d71..400b02552 100644 --- a/doc/pub/week41/html/._week41-bs007.html +++ b/doc/pub/week41/html/._week41-bs007.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,18 +245,24 @@ MathJax.Hub.Config({ -

    CNNs in more detail, building convolutional neural networks in Tensorflow and Keras

    +

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

    -As discussed above, CNNs are neural networks built from the assumption that the inputs -to the network are 2D images. This is important because the number of features or pixels in images -grows very fast with the image size, and an enormous number of weights and biases are needed in order to build an accurate network. +For the Softmax function we have +$$ +f(z_i^l) = \frac{\exp{(z_i^l)}}{\sum_{m=1}^K\exp{(z_m^l)}}. +$$ -

    -As before, we still have our input, a hidden layer and an output. What's novel about convolutional networks -are the convolutional and pooling layers stacked in pairs between the input and the hidden layer. -In addition, the data is no longer represented as a 2D feature matrix, instead each input is a number of 2D -matrices, typically 1 for each color dimension (Red, Green, Blue). +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 \).

    @@ -184,7 +287,7 @@ matrices, typically 1 for each color dimension (Red, Green, Blue).

  • 16
  • 17
  • ...
  • -
  • 22
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs008.html b/doc/pub/week41/html/._week41-bs008.html index 41a92332c..5bb82204f 100644 --- a/doc/pub/week41/html/._week41-bs008.html +++ b/doc/pub/week41/html/._week41-bs008.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -146,18 +243,22 @@ MathJax.Hub.Config({

     

     

     

    - + -

    Setting it up

    +

    Developing a code for doing neural networks with back propagation

    -It means that to represent the entire -dataset of images, we require a 4D matrix or tensor. This tensor has the dimensions: -$$ -(n_{inputs},\, n_{pixels, width},\, n_{pixels, height},\, depth) . -$$ +One can identify a set of key steps when using neural networks to solve supervised learning problems: + +

      +
    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-bs009.html b/doc/pub/week41/html/._week41-bs009.html index 79edd608d..f5b1c1062 100644 --- a/doc/pub/week41/html/._week41-bs009.html +++ b/doc/pub/week41/html/._week41-bs009.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,21 +245,98 @@ MathJax.Hub.Config({ -

    The MNIST dataset again

    +

    Collect and pre-process data

    -The MNIST dataset consists of grayscale images with a pixel size of -\( 28\times 28 \), meaning we require \( 28 \times 28 = 724 \) weights to each -neuron in the first hidden layer. +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.

    -If we were to analyze images of size \( 128\times 128 \) we would require -\( 128 \times 128 = 16384 \) weights to each neuron. Even worse if we were -dealing with color images, as most images are, we have an image matrix -of size \( 128\times 128 \) for each color dimension (Red, Green, Blue), -meaning 3 times the number of weights \( = 49152 \) are required for every -single neuron in the first hidden layer. +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,...) \). +

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

    @@ -188,7 +362,7 @@ single neuron in the first hidden layer.

  • 18
  • 19
  • ...
  • -
  • 22
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs010.html b/doc/pub/week41/html/._week41-bs010.html index 527c6f64f..a2c31fe99 100644 --- a/doc/pub/week41/html/._week41-bs010.html +++ b/doc/pub/week41/html/._week41-bs010.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,19 +245,52 @@ MathJax.Hub.Config({ -

    Strong correlations

    -Images typically have strong local correlations, meaning that a small -part of the image varies little from its neighboring regions. If for -example we have an image of a blue car, we can roughly assume that a -small blue part of the image is surrounded by other blue regions. +

    Train and test datasets

    -Therefore, instead of connecting every single pixel to a neuron in the -first hidden layer, as we have previously done with deep neural -networks, we can instead connect each neuron to a small part of the -image (in all 3 RGB depth dimensions). The size of each small area is -fixed, and known as a receptive. +Performing analysis before partitioning the dataset is a major error, that can lead to incorrect conclusions. +

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

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

    + + +

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

    @@ -187,7 +317,7 @@ fixed, and known as a 19

  • 20
  • ...
  • -
  • 22
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs011.html b/doc/pub/week41/html/._week41-bs011.html index dad56be77..d26119227 100644 --- a/doc/pub/week41/html/._week41-bs011.html +++ b/doc/pub/week41/html/._week41-bs011.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -146,26 +243,50 @@ MathJax.Hub.Config({

     

     

     

    - + -

    Layers of a CNN

    -The layers of a convolutional neural network arrange neurons in 3D: width, height and depth. -The input image is typically a square matrix of depth 3. +

    Define model and architecture

    -A convolution is performed on the image which outputs -a 3D volume of neurons. The weights to the input are arranged in a number of 2D matrices, known as filters. +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) ,$$

    -Each filter slides along the input image, taking the dot product -between each small part of the image and the filter, in all depth -dimensions. This is then passed through a non-linear function, -typically the Rectified Linear (ReLu) function, which serves as the -activation of the neurons in the first convolutional layer. This is -further passed through a pooling layer, which reduces the size of the -convolutional layer, e.g. by taking the maximum or average across some -small regions, and this serves as input to the next convolutional -layer. +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} +$$ + +

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

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

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

    @@ -193,7 +314,7 @@ layer.

  • 20
  • 21
  • ...
  • -
  • 22
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs012.html b/doc/pub/week41/html/._week41-bs012.html index 1f1d5303c..8c94d2216 100644 --- a/doc/pub/week41/html/._week41-bs012.html +++ b/doc/pub/week41/html/._week41-bs012.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -146,19 +243,49 @@ MathJax.Hub.Config({

     

     

     

    - + -

    Systematic reduction

    +

    Layers

    + + + +Since each input image has 8x8 = 64 pixels or features, we have an input layer of 64 neurons. + + + +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. + + + +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.

    -By systematically reducing the size of the input volume, through -convolution and pooling, the network should create representations of -small parts of the input, and then from them assemble representations -of larger areas. The final pooling layer is flattened to serve as -input to a hidden layer, such that each neuron in the final pooling -layer is connected to every single neuron in the hidden layer. This -then serves as input to the output layer, e.g. a softmax output for -classification. +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 \( \hat{a} \)}) = \frac{\exp{(\hat{a}^T \hat{w}_j)}} +{\sum_{c=0}^{9} \exp{(\hat{a}^T \hat{w}_c)}} ,$$ + +

    +i.e. each neuron \( j \) outputs the probability of being in class \( j \) given an input from the hidden layer \( \hat{a} \), with \( \hat{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.

    @@ -185,6 +312,8 @@ classification.

  • 20
  • 21
  • 22
  • +
  • ...
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs013.html b/doc/pub/week41/html/._week41-bs013.html index 33119da27..0182956eb 100644 --- a/doc/pub/week41/html/._week41-bs013.html +++ b/doc/pub/week41/html/._week41-bs013.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -146,52 +243,40 @@ MathJax.Hub.Config({

     

     

     

    - + -

    Prerequisites: Collect and pre-process data

    +

    Weights and biases

    + +

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

    +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 \): + +$$ z_j = \sum_{i=1}^n w_ {ij} a_i + b_j.$$ + +

    +The bias weights \( \hat{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.

    -

    # import necessary packages
    -import numpy as np
    -import matplotlib.pyplot as plt
    -from sklearn import datasets
    +
    # building our neural network
     
    +n_inputs, n_features = X_train.shape
    +n_hidden_neurons = 50
    +n_categories = 10
     
    -# ensure the same random numbers appear every time
    -np.random.seed(0)
    +# we make the weights normally distributed using numpy.random.randn
     
    -# display images in notebook
    -%matplotlib inline
    -plt.rcParams['figure.figsize'] = (12,12)
    +# 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
     
    -
    -# download MNIST dataset
    -digits = datasets.load_digits()
    -
    -# define inputs and labels
    -inputs = digits.images
    -labels = digits.target
    -
    -# RGB images have a depth of 3
    -# our images are grayscale so they should have a depth of 1
    -inputs = inputs[:,:,:,np.newaxis]
    -
    -print("inputs = (n_inputs, pixel_width, pixel_height, depth) = " + str(inputs.shape))
    -print("labels = (n_inputs) = " + str(labels.shape))
    -
    -
    -# choose some random images to display
    -n_inputs = len(inputs)
    -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()
    +# 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
     

    @@ -217,6 +302,9 @@ plt.show()

  • 20
  • 21
  • 22
  • +
  • 23
  • +
  • ...
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs014.html b/doc/pub/week41/html/._week41-bs014.html index 6968789cc..a53280081 100644 --- a/doc/pub/week41/html/._week41-bs014.html +++ b/doc/pub/week41/html/._week41-bs014.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,23 +245,30 @@ MathJax.Hub.Config({ -

    Importing Keras and Tensorflow

    +

    Feed-forward pass

    +

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

    from keras.utils import to_categorical
    -from sklearn.model_selection import train_test_split
    +$$ z_{j}^{l} = \sum_{i=1}^{F} w_{ij}^{l} x_i + b_{j}^{l},$$
     
    -# representation of labels
    -labels = to_categorical(labels)
    +

    +this is then passed through our activation function + +$$ a_{j}^{l} = f(z_{j}^{l}) .$$ + +

    +We calculate a weighted sum of inputs (activations in the hidden layer) to each neuron \( j \) in the output layer: + +$$ z_{j}^{L} = \sum_{i=1}^{H} w_{ij}^{L} a_{i}^{l} + b_{j}^{L}.$$ + +

    +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})}} .$$ -# split into train and test data -# 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) -

    @@ -188,6 +292,10 @@ X_train, X_test, Y_train, Y_test = train_tes

  • 20
  • 21
  • 22
  • +
  • 23
  • +
  • 24
  • +
  • ...
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs015.html b/doc/pub/week41/html/._week41-bs015.html index e27b7bcf0..c4be49193 100644 --- a/doc/pub/week41/html/._week41-bs015.html +++ b/doc/pub/week41/html/._week41-bs015.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -146,152 +243,79 @@ MathJax.Hub.Config({

     

     

     

    - + -

    Using TensorFlow backend

    +

    Matrix multiplications

    -We need to define model and architecture and choose cost function and optmizer. +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 + +$$ X W^{h} = (n_{inputs}, n_{hidden}),$$ + +

    +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} \): + +$$ \hat{z}^{l} = \hat{X} \hat{W}^{l} + \hat{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: + +$$ \hat{a}^{l} = f(\hat{z}^l) .$$ + +

    +This is fed to the output layer: + +$$ \hat{z}^{L} = \hat{a}^{L} \hat{W}^{L} + \hat{b}^{L} .$$ + +

    +Finally we receive our output values for each image and each category by passing it through the softmax function: + +$$ output = softmax (\hat{z}^{L}) = (n_{inputs}, n_{categories}) .$$ +

    - -

    import tensorflow as tf
    +
    +
    # setup the feed-forward pass, subscript h = hidden layer
     
    -class ConvolutionalNeuralNetworkTensorflow:
    -    def __init__(
    -            self,
    -            X_train,
    -            Y_train,
    -            X_test,
    -            Y_test,
    -            n_filters=10,
    -            n_neurons_connected=50,
    -            n_categories=10,
    -            receptive_field=3,
    -            stride=1,
    -            padding=1,
    -            epochs=10,
    -            batch_size=100,
    -            eta=0.1,
    -            lmbd=0.0):
    -        
    -        self.global_step = tf.Variable(0, dtype=tf.int32, trainable=False, name='global_step')
    -        
    -        self.X_train = X_train
    -        self.Y_train = Y_train
    -        self.X_test = X_test
    -        self.Y_test = Y_test
    -        
    -        self.n_inputs, self.input_width, self.input_height, self.depth = X_train.shape
    -        
    -        self.n_filters = n_filters
    -        self.n_downsampled = int(self.input_width*self.input_height*n_filters / 4)
    -        self.n_neurons_connected = n_neurons_connected
    -        self.n_categories = n_categories
    -        
    -        self.receptive_field = receptive_field
    -        self.stride = stride
    -        self.strides = [stride, stride, stride, stride]
    -        self.padding = padding
    -        
    -        self.epochs = epochs
    -        self.batch_size = batch_size
    -        self.iterations = self.n_inputs // self.batch_size
    -        self.eta = eta
    -        self.lmbd = lmbd
    -        
    -        self.create_placeholders()
    -        self.create_CNN()
    -        self.create_loss()
    -        self.create_optimiser()
    -        self.create_accuracy()
    -    
    -    def create_placeholders(self):
    -        with tf.name_scope('data'):
    -            self.X = tf.placeholder(tf.float32, shape=(None, self.input_width, self.input_height, self.depth), name='X_data')
    -            self.Y = tf.placeholder(tf.float32, shape=(None, self.n_categories), name='Y_data')
    -    
    -    def create_CNN(self):
    -        with tf.name_scope('CNN'):
    -            
    -            # Convolutional layer
    -            self.W_conv = self.weight_variable([self.receptive_field, self.receptive_field, self.depth, self.n_filters], name='conv', dtype=tf.float32)
    -            b_conv = self.weight_variable([self.n_filters], name='conv', dtype=tf.float32)
    -            z_conv = tf.nn.conv2d(self.X, self.W_conv, self.strides, padding='SAME', name='conv') + b_conv
    -            a_conv = tf.nn.relu(z_conv)
    -            
    -            # 2x2 max pooling
    -            a_pool = tf.nn.max_pool(a_conv, [1, 2, 2, 1], [1, 2, 2, 1], padding='SAME', name='pool')
    -            
    -            # Fully connected layer
    -            a_pool_flat = tf.reshape(a_pool, [-1, self.n_downsampled])
    -            self.W_fc = self.weight_variable([self.n_downsampled, self.n_neurons_connected], name='fc', dtype=tf.float32)
    -            b_fc = self.bias_variable([self.n_neurons_connected], name='fc', dtype=tf.float32)
    -            a_fc = tf.nn.relu(tf.matmul(a_pool_flat, self.W_fc) + b_fc)
    -            
    -            # Output layer
    -            self.W_out = self.weight_variable([self.n_neurons_connected, self.n_categories], name='out', dtype=tf.float32)
    -            b_out = self.bias_variable([self.n_categories], name='out', dtype=tf.float32)
    -            self.z_out = tf.matmul(a_fc, self.W_out) + b_out
    -    
    -    def create_loss(self):
    -        with tf.name_scope('loss'):
    -            softmax_loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits_v2(labels=self.Y, logits=self.z_out))
    -            
    -            regularizer_loss_conv = tf.nn.l2_loss(self.W_conv)
    -            regularizer_loss_fc = tf.nn.l2_loss(self.W_fc)
    -            regularizer_loss_out = tf.nn.l2_loss(self.W_out)
    -            regularizer_loss = self.lmbd*(regularizer_loss_conv + regularizer_loss_fc + regularizer_loss_out)
    -            
    -            self.loss = softmax_loss + regularizer_loss
    +def sigmoid(x):
    +    return 1/(1 + np.exp(-x))
     
    -    def create_accuracy(self):
    -        with tf.name_scope('accuracy'):
    -            probabilities = tf.nn.softmax(self.z_out)
    -            predictions = tf.argmax(probabilities, 1)
    -            labels = tf.argmax(self.Y, 1)
    -            
    -            correct_predictions = tf.equal(predictions, labels)
    -            correct_predictions = tf.cast(correct_predictions, tf.float32)
    -            self.accuracy = tf.reduce_mean(correct_predictions)
    +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)
         
    -    def create_optimiser(self):
    -        with tf.name_scope('optimizer'):
    -            self.optimizer = tf.train.GradientDescentOptimizer(learning_rate=self.eta).minimize(self.loss, global_step=self.global_step)
    -            
    -    def weight_variable(self, shape, name='', dtype=tf.float32):
    -        initial = tf.truncated_normal(shape, stddev=0.1)
    -        return tf.Variable(initial, name=name, dtype=dtype)
    +    # 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)
         
    -    def bias_variable(self, shape, name='', dtype=tf.float32):
    -        initial = tf.constant(0.1, shape=shape)
    -        return tf.Variable(initial, name=name, dtype=dtype)
    +    return probabilities
     
    -    def fit(self):
    -        data_indices = np.arange(self.n_inputs)
    +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()
     
    -        with tf.Session() as sess:
    -            sess.run(tf.global_variables_initializer())
    -            for i in range(self.epochs):
    -                for j in range(self.iterations):
    -                    chosen_datapoints = np.random.choice(data_indices, size=self.batch_size, replace=False)
    -                    batch_X, batch_Y = self.X_train[chosen_datapoints], self.Y_train[chosen_datapoints]
    -            
    -                    sess.run([CNN.loss, CNN.optimizer],
    -                        feed_dict={CNN.X: batch_X,
    -                                   CNN.Y: batch_Y})
    -                    accuracy = sess.run(CNN.accuracy,
    -                        feed_dict={CNN.X: batch_X,
    -                                   CNN.Y: batch_Y})
    -                    step = sess.run(CNN.global_step)
    -    
    -            self.train_loss, self.train_accuracy = sess.run([CNN.loss, CNN.accuracy],
    -                feed_dict={CNN.X: self.X_train,
    -                           CNN.Y: self.Y_train})
    -        
    -            self.test_loss, self.test_accuracy = sess.run([CNN.loss, CNN.accuracy],
    -                feed_dict={CNN.X: self.X_test,
    -                           CNN.Y: self.Y_test})
    +# 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]))
     

    @@ -315,6 +339,11 @@ class ConvolutionalNeuralNetworkTensorflow:

  • 20
  • 21
  • 22
  • +
  • 23
  • +
  • 24
  • +
  • 25
  • +
  • ...
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs016.html b/doc/pub/week41/html/._week41-bs016.html index c6486199d..9914319d8 100644 --- a/doc/pub/week41/html/._week41-bs016.html +++ b/doc/pub/week41/html/._week41-bs016.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,38 +245,34 @@ MathJax.Hub.Config({ -

    Train the model

    +

    Choose cost function and optimizer

    -We need now to train the model, evaluate it and test its performance on test data, and eventually include hyperparameters. +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 multiclass classification it is common to treat each integer label as a so called one-hot vector: - -

    epochs = 100
    -batch_size = 100
    -n_filters = 10
    -n_neurons_connected = 50
    -n_categories = 10
    +$$ y = 5 \quad \rightarrow \quad \hat{y} = (0, 0, 0, 0, 0, 1, 0, 0, 0, 0) ,$$  
    +
    +$$ y = 1 \quad \rightarrow \quad \hat{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 \( \hat{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 \( \hat{\theta} \) represents the parameters of our network, i.e. all the weights and biases. -eta_vals = np.logspace(-5, 1, 7) -lmbd_vals = np.logspace(-5, 1, 7) -CNN_tf = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object) - -for i, eta in enumerate(eta_vals): - for j, lmbd in enumerate(lmbd_vals): - CNN = ConvolutionalNeuralNetworkTensorflow(X_train, Y_train, X_test, Y_test, - n_filters=n_filters, n_neurons_connected=n_neurons_connected, - n_categories=n_categories, epochs=epochs, batch_size=batch_size, - eta=eta, lmbd=lmbd) - CNN.fit() - - print("Learning rate = ", eta) - print("Lambda = ", lmbd) - print("Test accuracy: %.3f" % CNN.test_accuracy) - print() - - CNN_tf[i][j] = CNN -

    @@ -201,6 +294,12 @@ CNN_tf = np.20

  • 21
  • 22
  • +
  • 23
  • +
  • 24
  • +
  • 25
  • +
  • 26
  • +
  • ...
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs017.html b/doc/pub/week41/html/._week41-bs017.html index 2667dae4b..44acb9c33 100644 --- a/doc/pub/week41/html/._week41-bs017.html +++ b/doc/pub/week41/html/._week41-bs017.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,42 +245,43 @@ MathJax.Hub.Config({ -

    Visualizing the results

    +

    Optimizing the cost function

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

    # visual representation of grid search
    -# uses seaborn heatmap, could probably do this in matplotlib
    -import seaborn as sns
    +$$ \theta_{i+1} = \theta_i - \eta \nabla \mathcal{C}(\theta_i) ,$$
     
    -sns.set()
    +

    +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. -train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals))) -test_accuracy = np.zeros((len(eta_vals), len(lmbd_vals))) +

    +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: -for i in range(len(eta_vals)): - for j in range(len(lmbd_vals)): - CNN = CNN_tf[i][j] +$$ \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) ,$$ - train_accuracy[i][j] = CNN.train_accuracy - test_accuracy[i][j] = CNN.test_accuracy +

    +i.e. instead of averaging the loss over the entire dataset, we average over a minibatch. - -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() +

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

    @@ -204,6 +302,13 @@ plt.show()

  • 20
  • 21
  • 22
  • +
  • 23
  • +
  • 24
  • +
  • 25
  • +
  • 26
  • +
  • 27
  • +
  • ...
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs018.html b/doc/pub/week41/html/._week41-bs018.html index cc2172079..5dd5012fe 100644 --- a/doc/pub/week41/html/._week41-bs018.html +++ b/doc/pub/week41/html/._week41-bs018.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -146,48 +243,38 @@ MathJax.Hub.Config({

     

     

     

    - + -

    Running with Keras

    +

    Regularization

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

    from keras.models import Sequential
    -from keras.layers.convolutional import Conv2D
    -from keras.layers.convolutional import MaxPooling2D
    -from keras.layers import Flatten
    -from keras.layers import Dense
    -from keras.regularizers import l2
    -from keras.optimizers import SGD
    +

    +We will measure the size of the weights using the so called L2-norm, meaning our cost function becomes: -def create_convolutional_neural_network_keras(input_shape, receptive_field, - n_filters, n_neurons_connected, n_categories, - eta, lmbd): - model = Sequential() - model.add(Conv2D(n_filters, (receptive_field, receptive_field), input_shape=input_shape, padding='same', - activation='relu', kernel_regularizer=l2(lmbd))) - model.add(MaxPooling2D(pool_size=(2, 2))) - model.add(Flatten()) - model.add(Dense(n_neurons_connected, activation='relu', kernel_regularizer=l2(lmbd))) - model.add(Dense(n_categories, activation='softmax', kernel_regularizer=l2(lmbd))) - - sgd = SGD(lr=eta) - model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy']) - - return model +$$ \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 \hat{w} \rvert \rvert_2^2 += \frac{1}{N} \sum_{i=1}^N \mathcal{L}(\theta) + \lambda \sum_{ij} w_{ij}^2,$$ -epochs = 100 -batch_size = 100 -input_shape = X_train.shape[1:4] -receptive_field = 3 -n_filters = 10 -n_neurons_connected = 50 -n_categories = 10 +

    +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. -eta_vals = np.logspace(-5, 1, 7) -lmbd_vals = np.logspace(-5, 1, 7) -

    @@ -207,6 +294,14 @@ lmbd_vals = np.

  • 20
  • 21
  • 22
  • +
  • 23
  • +
  • 24
  • +
  • 25
  • +
  • 26
  • +
  • 27
  • +
  • 28
  • +
  • ...
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs019.html b/doc/pub/week41/html/._week41-bs019.html index f78036ff1..b900c854b 100644 --- a/doc/pub/week41/html/._week41-bs019.html +++ b/doc/pub/week41/html/._week41-bs019.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,27 +245,116 @@ MathJax.Hub.Config({ -

    Final part

    +

    Matrix multiplication

    + +

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

    +The gradient for the output weights is calculated as + +$$ \nabla W_{L} = \hat{a}^T \delta_L = (n_{hidden}, n_{categories}) ,$$ + +

    +where \( \hat{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. + +

    +The gradient with respect to the output bias is then + +$$ \nabla \hat{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}) .$$

    -

    CNN_keras = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object)
    -        
    -for i, eta in enumerate(eta_vals):
    -    for j, lmbd in enumerate(lmbd_vals):
    -        CNN = create_convolutional_neural_network_keras(input_shape, receptive_field,
    -                                              n_filters, n_neurons_connected, n_categories,
    -                                              eta, lmbd)
    -        CNN.fit(X_train, Y_train, epochs=epochs, batch_size=batch_size, verbose=0)
    -        scores = CNN.evaluate(X_test, Y_test)
    -        
    -        CNN_keras[i][j] = CNN
    -        
    -        print("Learning rate = ", eta)
    -        print("Lambda = ", lmbd)
    -        print("Test accuracy: %.3f" % scores[1])
    -        print()
    +
    # 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)))
     

    @@ -188,6 +374,15 @@ MathJax.Hub.Config({

  • 20
  • 21
  • 22
  • +
  • 23
  • +
  • 24
  • +
  • 25
  • +
  • 26
  • +
  • 27
  • +
  • 28
  • +
  • 29
  • +
  • ...
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs020.html b/doc/pub/week41/html/._week41-bs020.html index dd7b06487..409b5e319 100644 --- a/doc/pub/week41/html/._week41-bs020.html +++ b/doc/pub/week41/html/._week41-bs020.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,42 +245,23 @@ MathJax.Hub.Config({ -

    Final visualization

    +

    Improving performance

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

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

    +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} \). -sns.set() +

    +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. -train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals))) -test_accuracy = np.zeros((len(eta_vals), len(lmbd_vals))) +

    +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. -for i in range(len(eta_vals)): - for j in range(len(lmbd_vals)): - CNN = CNN_keras[i][j] - - train_accuracy[i][j] = CNN.evaluate(X_train, Y_train)[1] - test_accuracy[i][j] = CNN.evaluate(X_test, Y_test)[1] - - -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() -

    @@ -201,6 +279,16 @@ plt.show()

  • 20
  • 21
  • 22
  • +
  • 23
  • +
  • 24
  • +
  • 25
  • +
  • 26
  • +
  • 27
  • +
  • 28
  • +
  • 29
  • +
  • 30
  • +
  • ...
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/._week41-bs021.html b/doc/pub/week41/html/._week41-bs021.html index 275cd4af3..5a0156ca8 100644 --- a/doc/pub/week41/html/._week41-bs021.html +++ b/doc/pub/week41/html/._week41-bs021.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -148,14 +245,116 @@ MathJax.Hub.Config({ -

    Fun links

    +

    Full object-oriented implementation

    -
      -
    1. Self-Driving cars using a convolutional neural network
    2. -
    3. Abstract art using convolutional neural networks
    4. -
    +

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

    + +

    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):
    +
    +        self.X_data_full = X_data
    +        self.Y_data_full = Y_data
    +
    +        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()
    +
    +

    diff --git a/doc/pub/week41/html/week41-bs.html b/doc/pub/week41/html/week41-bs.html index 2d605a454..112def37d 100644 --- a/doc/pub/week41/html/week41-bs.html +++ b/doc/pub/week41/html/week41-bs.html @@ -41,40 +41,98 @@ Automatically generated HTML file from DocOnce source @@ -112,27 +170,66 @@ MathJax.Hub.Config({ @@ -167,7 +264,7 @@ MathJax.Hub.Config({
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

    -

    Sep 16, 2020

    +

    Oct 5, 2020


    @@ -191,7 +288,7 @@ MathJax.Hub.Config({

  • 9
  • 10
  • ...
  • -
  • 22
  • +
  • 61
  • »
  • diff --git a/doc/pub/week41/html/week41-reveal.html b/doc/pub/week41/html/week41-reveal.html index 755f227a9..8f9ad9417 100644 --- a/doc/pub/week41/html/week41-reveal.html +++ b/doc/pub/week41/html/week41-reveal.html @@ -148,7 +148,7 @@ MathJax.Hub.Config({
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

     
    -

    Sep 16, 2020

    +

    Oct 5, 2020


    @@ -159,7 +159,1980 @@ MathJax.Hub.Config({

    -

    Convolutional Neural Networks (recognizing images)

    +

    Plan for week 40

    + +
      +

    • Thursday: Building our own Feed-forward Neural Network
    • +

    • Friday: Playing around with our own Feed-forward Neural Network and introduction to TensorFlow. Start convolutional Neural Networks.
    • +
    +

    + +Reading suggestions for both days: Aurelien Geron's chapters 10-11 and Hastie et al chapter 11. +

    + + +
    +

    Overview video for week 41

    + +

    +"Overview Video, from Stochastic Gradient methods to Neural Networks":"https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h20\ +/forelesningsvideoer/OverviewWeek41.mp4?vrtx=view-as-webpage" +

    + + +
    +

    Setting up the Back propagation algorithm

    + +

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

    +

    + +

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

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

    + + +
    +

    Setting up a Multi-layer perceptron model for classification

    + +

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

     
    +$$ +P(y = 0 \mid \hat{x}, \hat{\theta}) = \frac{1}{1 + \exp{(- \hat{x}})} , +$$ +

     
    + +and +

     
    +$$ +P(y = 1 \mid \hat{x}, \hat{\theta}) = 1 - P(y = 0 \mid \hat{x}, \hat{\theta}) , +$$ +

     
    + +

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

    + + +
    +

    Defining the cost function

    + +

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

     
    +$$ +\mathcal{C}(\hat{\theta}) = - \ln P(\mathcal{D} \mid \hat{\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(\hat{\theta}) . +$$ +

     
    + +

    +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(\hat{\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. + +

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

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

    +\( y = 1 \quad \rightarrow \quad \hat{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 \( \hat{x}_i \) is the \( i \)-th input (image), \( y_{ic} \) refers to the \( c \)-th component of the \( i \)-th +output vector \( \hat{y}_i \). +The probability of \( \hat{x}_i \) being in class \( c \) will be given by the softmax function: + +

     
    +$$ +P(y_{ic} = 1 \mid \hat{x}_i, \hat{\theta}) = \frac{\exp{((\hat{a}_i^{hidden})^T \hat{w}_c)}} +{\sum_{c'=0}^{C-1} \exp{((\hat{a}_i^{hidden})^T \hat{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 \hat{\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}(\hat{\theta}) = - \log{P(\mathcal{D} \mid \hat{\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! +

    + + +
    +

    Example: binary classification problem

    + +

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

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

     
    + +where we had defined the logistic (sigmoid) function +

     
    +$$ +p(y_i =1\vert x_i,\hat{\beta})=\frac{\exp{(\beta_0+\beta_1 x_i)}}{1+\exp{(\beta_0+\beta_1 x_i)}}, +$$ +

     
    + +and +

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

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

    +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}(\hat{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}(\hat{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. +

    + + +
    +

    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 +

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

     
    + +For the Softmax function we have +

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

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

    + + +
    +

    Developing a code for doing neural networks with back propagation

    + +

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

      +

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

    Collect and pre-process data

    + +

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

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

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

     
    +$$ 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()
    +
    +
    + + +
    +

    Train and test datasets

    + +

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

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

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

    + + +

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

    Define model and architecture

    + +

    +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} +$$ +

     
    + +

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

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

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

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

    + + +
    +

    Layers

    + +
      +

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

      +

    • 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 \( \hat{a} \)}) = \frac{\exp{(\hat{a}^T \hat{w}_j)}} +{\sum_{c=0}^{9} \exp{(\hat{a}^T \hat{w}_c)}} ,$$ +

     
    + +

    +i.e. each neuron \( j \) outputs the probability of being in class \( j \) given an input from the hidden layer \( \hat{a} \), with \( \hat{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. +

    + + +
    +

    Weights and biases

    + +

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

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

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

     
    + +

    +The bias weights \( \hat{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
    +
    +
    + + +
    +

    Feed-forward pass

    + +

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

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

     
    + +

    +this is then passed through our activation function + +

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

     
    + +

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

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

     
    + +

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

     
    +

    + + +
    +

    Matrix multiplications

    + +

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

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

     
    + +

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

     
    +$$ \hat{z}^{l} = \hat{X} \hat{W}^{l} + \hat{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: + +

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

     
    + +

    +This is fed to the output layer: + +

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

     
    + +

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

     
    +$$ output = softmax (\hat{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]))
    +
    +
    + + +
    +

    Choose cost function and optimizer

    + +

    +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 multiclass classification it is common to treat each integer label as a so called one-hot vector: + +

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

     
    + +

     
    +$$ y = 1 \quad \rightarrow \quad \hat{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 \( \hat{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 \( \hat{\theta} \) represents the parameters of our network, i.e. all the weights and biases. +

    + + +
    +

    Optimizing the cost function

    + +

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

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

     
    + +

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

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

    + + +
    +

    Regularization

    + +

    +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 will measure the size of the weights using the so called L2-norm, meaning our cost function becomes: + +

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

    + + +
    +

    Matrix multiplication

    + +

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

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

     
    + +

    +The gradient for the output weights is calculated as + +

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

     
    + +

    +where \( \hat{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. + +

    +The gradient with respect to the output bias is then + +

     
    +$$ \nabla \hat{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)))
    +
    +
    + + +
    +

    Improving performance

    + +

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

    + + +
    +

    Full object-oriented implementation

    + +

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

    + + +

    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):
    +
    +        self.X_data_full = X_data
    +        self.Y_data_full = Y_data
    +
    +        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()
    +
    +
    + + +
    +

    Evaluate model performance on test data

    + +

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

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

     
    + +

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

    + + +

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

    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()
    +
    +
    + + +
    +

    Visualization

    + +

    + + +

    # visual representation of grid search
    +# uses seaborn heatmap, you can also do this with matplotlib imshow
    +import seaborn as sns
    +
    +sns.set()
    +
    +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
    +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_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()
    +
    +
    + + +
    +

    scikit-learn implementation

    + +

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

    +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()
    +
    +
    + + +
    +

    Visualization

    +

    + + +

    # optional
    +# visual representation of grid search
    +# uses seaborn heatmap, could probably do this in matplotlib
    +import seaborn as sns
    +
    +sns.set()
    +
    +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
    +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]
    +        
    +        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()
    +
    +
    + + +
    +

    Building neural networks in Tensorflow and Keras

    + +

    +Now we want to build on the experience gained from our neural network implementation in NumPy and scikit-learn +and use it to construct a neural network in Tensorflow. Once we have constructed a neural network in NumPy +and Tensorflow, building one in Keras is really quite trivial, though the performance may suffer. + +

    +In our previous example we used only one hidden layer, and in this we will use two. From this it should be quite +clear how to build one using an arbitrary number of hidden layers, using data structures such as Python lists or +NumPy arrays. +

    + + +
    +

    Tensorflow

    + +

    +Tensorflow is an open source library machine learning library +developed by the Google Brain team for internal use. It was released +under the Apache 2.0 open source license in November 9, 2015. + +

    +Tensorflow is a computational framework that allows you to construct +machine learning models at different levels of abstraction, from +high-level, object-oriented APIs like Keras, down to the C++ kernels +that Tensorflow is built upon. The higher levels of abstraction are +simpler to use, but less flexible, and our choice of implementation +should reflect the problems we are trying to solve. + +

    +Tensorflow uses so-called graphs to represent your computation +in terms of the dependencies between individual operations, such that you first build a Tensorflow graph +to represent your model, and then create a Tensorflow session to run the graph. + +

    +In this guide we will analyze the same data as we did in our NumPy and +scikit-learn tutorial, gathered from the MNIST database of images. We +will give an introduction to the lower level Python Application +Program Interfaces (APIs), and see how we use them to build our graph. +Then we will build (effectively) the same graph in Keras, to see just +how simple solving a machine learning problem can be. + +

    +To install tensorflow on Unix/Linux systems, use pip as +

    + + +

    pip3 install tensorflow
    +
    +

    +and/or if you use anaconda, just write (or install from the graphical user interface) +

    + + +

    conda install tensorflow
    +
    +
    + + +
    +

    Collect and pre-process data

    + +

    + + +

    # 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()
    +
    +

    + + +

    from keras.utils import to_categorical
    +from sklearn.model_selection import train_test_split
    +
    +# one-hot representation of labels
    +labels = to_categorical(labels)
    +
    +# split into train and test data
    +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)
    +
    +
    + + +
    +

    Using TensorFlow backend

    + +
      +

    1. Define model and architecture
    2. +

    3. Choose cost function and optimizer
    4. +
    +

    + + +

    import tensorflow as tf
    +
    +class NeuralNetworkTensorflow:
    +    def __init__(
    +            self,
    +            X_train,
    +            Y_train,
    +            X_test,
    +            Y_test,
    +            n_neurons_layer1=100,
    +            n_neurons_layer2=50,
    +            n_categories=2,
    +            epochs=10,
    +            batch_size=100,
    +            eta=0.1,
    +            lmbd=0.0):
    +        
    +        # keep track of number of steps
    +        self.global_step = tf.Variable(0, dtype=tf.int32, trainable=False, name='global_step')
    +        
    +        self.X_train = X_train
    +        self.Y_train = Y_train
    +        self.X_test = X_test
    +        self.Y_test = Y_test
    +        
    +        self.n_inputs = X_train.shape[0]
    +        self.n_features = X_train.shape[1]
    +        self.n_neurons_layer1 = n_neurons_layer1
    +        self.n_neurons_layer2 = n_neurons_layer2
    +        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
    +        
    +        # build network piece by piece
    +        # name scopes (with) are used to enforce creation of new variables
    +        # https://www.tensorflow.org/guide/variables
    +        self.create_placeholders()
    +        self.create_DNN()
    +        self.create_loss()
    +        self.create_optimiser()
    +        self.create_accuracy()
    +    
    +    def create_placeholders(self):
    +        # placeholders are fine here, but "Datasets" are the preferred method
    +        # of streaming data into a model
    +        with tf.name_scope('data'):
    +            self.X = tf.placeholder(tf.float32, shape=(None, self.n_features), name='X_data')
    +            self.Y = tf.placeholder(tf.float32, shape=(None, self.n_categories), name='Y_data')
    +    
    +    def create_DNN(self):
    +        with tf.name_scope('DNN'):
    +            # the weights are stored to calculate regularization loss later
    +            
    +            # Fully connected layer 1
    +            self.W_fc1 = self.weight_variable([self.n_features, self.n_neurons_layer1], name='fc1', dtype=tf.float32)
    +            b_fc1 = self.bias_variable([self.n_neurons_layer1], name='fc1', dtype=tf.float32)
    +            a_fc1 = tf.nn.sigmoid(tf.matmul(self.X, self.W_fc1) + b_fc1)
    +            
    +            # Fully connected layer 2
    +            self.W_fc2 = self.weight_variable([self.n_neurons_layer1, self.n_neurons_layer2], name='fc2', dtype=tf.float32)
    +            b_fc2 = self.bias_variable([self.n_neurons_layer2], name='fc2', dtype=tf.float32)
    +            a_fc2 = tf.nn.sigmoid(tf.matmul(a_fc1, self.W_fc2) + b_fc2)
    +            
    +            # Output layer
    +            self.W_out = self.weight_variable([self.n_neurons_layer2, self.n_categories], name='out', dtype=tf.float32)
    +            b_out = self.bias_variable([self.n_categories], name='out', dtype=tf.float32)
    +            self.z_out = tf.matmul(a_fc2, self.W_out) + b_out
    +    
    +    def create_loss(self):
    +        with tf.name_scope('loss'):
    +            softmax_loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits_v2(labels=self.Y, logits=self.z_out))
    +            
    +            regularizer_loss_fc1 = tf.nn.l2_loss(self.W_fc1)
    +            regularizer_loss_fc2 = tf.nn.l2_loss(self.W_fc2)
    +            regularizer_loss_out = tf.nn.l2_loss(self.W_out)
    +            regularizer_loss = self.lmbd*(regularizer_loss_fc1 + regularizer_loss_fc2 + regularizer_loss_out)
    +            
    +            self.loss = softmax_loss + regularizer_loss
    +
    +    def create_accuracy(self):
    +        with tf.name_scope('accuracy'):
    +            probabilities = tf.nn.softmax(self.z_out)
    +            predictions = tf.argmax(probabilities, axis=1)
    +            labels = tf.argmax(self.Y, axis=1)
    +            
    +            correct_predictions = tf.equal(predictions, labels)
    +            correct_predictions = tf.cast(correct_predictions, tf.float32)
    +            self.accuracy = tf.reduce_mean(correct_predictions)
    +    
    +    def create_optimiser(self):
    +        with tf.name_scope('optimizer'):
    +            self.optimizer = tf.train.GradientDescentOptimizer(learning_rate=self.eta).minimize(self.loss, global_step=self.global_step)
    +            
    +    def weight_variable(self, shape, name='', dtype=tf.float32):
    +        initial = tf.truncated_normal(shape, stddev=0.1)
    +        return tf.Variable(initial, name=name, dtype=dtype)
    +    
    +    def bias_variable(self, shape, name='', dtype=tf.float32):
    +        initial = tf.constant(0.1, shape=shape)
    +        return tf.Variable(initial, name=name, dtype=dtype)
    +    
    +    def fit(self):
    +        data_indices = np.arange(self.n_inputs)
    +
    +        with tf.Session() as sess:
    +            sess.run(tf.global_variables_initializer())
    +            for i in range(self.epochs):
    +                for j in range(self.iterations):
    +                    chosen_datapoints = np.random.choice(data_indices, size=self.batch_size, replace=False)
    +                    batch_X, batch_Y = self.X_train[chosen_datapoints], self.Y_train[chosen_datapoints]
    +            
    +                    sess.run([DNN.loss, DNN.optimizer],
    +                        feed_dict={DNN.X: batch_X,
    +                                   DNN.Y: batch_Y})
    +                    accuracy = sess.run(DNN.accuracy,
    +                        feed_dict={DNN.X: batch_X,
    +                                   DNN.Y: batch_Y})
    +                    step = sess.run(DNN.global_step)
    +    
    +            self.train_loss, self.train_accuracy = sess.run([DNN.loss, DNN.accuracy],
    +                feed_dict={DNN.X: self.X_train,
    +                           DNN.Y: self.Y_train})
    +        
    +            self.test_loss, self.test_accuracy = sess.run([DNN.loss, DNN.accuracy],
    +                feed_dict={DNN.X: self.X_test,
    +                           DNN.Y: self.Y_test})
    +
    +
    + + +
    +

    Optimizing and using gradient descent

    + +

    + + +

    epochs = 100
    +batch_size = 100
    +n_neurons_layer1 = 100
    +n_neurons_layer2 = 50
    +n_categories = 10
    +eta_vals = np.logspace(-5, 1, 7)
    +lmbd_vals = np.logspace(-5, 1, 7)
    +
    +

    + + +

    DNN_tf = 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 = NeuralNetworkTensorflow(X_train, Y_train, X_test, Y_test,
    +                                      n_neurons_layer1, n_neurons_layer2, n_categories,
    +                                      epochs=epochs, batch_size=batch_size, eta=eta, lmbd=lmbd)
    +        DNN.fit()
    +        
    +        DNN_tf[i][j] = DNN
    +        
    +        print("Learning rate = ", eta)
    +        print("Lambda = ", lmbd)
    +        print("Test accuracy: %.3f" % DNN.test_accuracy)
    +        print()
    +
    +

    + + +

    # optional
    +# visual representation of grid search
    +# uses seaborn heatmap, could probably do this in matplotlib
    +import seaborn as sns
    +
    +sns.set()
    +
    +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
    +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_tf[i][j]
    +
    +        train_accuracy[i][j] = DNN.train_accuracy
    +        test_accuracy[i][j] = DNN.test_accuracy
    +
    +        
    +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()
    +
    +

    + + +

    # optional
    +# we can use log files to visualize our graph in Tensorboard
    +writer = tf.summary.FileWriter('logs/')
    +writer.add_graph(tf.get_default_graph())
    +
    +
    + + +
    +

    Using Keras

    + +

    +Keras is a high level neural network +that supports Tensorflow, CTNK and Theano as backends. +If you have Tensorflow installed Keras is available through the tf.keras module. +If you have Anaconda installed you may run the following command +

    + + +

    conda install keras
    +
    +

    +Alternatively, if you have Tensorflow or one of the other supported backends install you may use the pip package manager: + +

    + + +

    pip3 install keras
    +
    +

    +or look up the instructions here. + +

    + + +

    from keras.models import Sequential
    +from keras.layers import Dense
    +from keras.regularizers import l2
    +from keras.optimizers import SGD
    +
    +def create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories, eta, lmbd):
    +    model = Sequential()
    +    model.add(Dense(n_neurons_layer1, activation='sigmoid', kernel_regularizer=l2(lmbd)))
    +    model.add(Dense(n_neurons_layer2, activation='sigmoid', kernel_regularizer=l2(lmbd)))
    +    model.add(Dense(n_categories, activation='softmax'))
    +    
    +    sgd = SGD(lr=eta)
    +    model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])
    +    
    +    return model
    +
    +

    + + +

    DNN_keras = 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 = create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories,
    +                                         eta=eta, lmbd=lmbd)
    +        DNN.fit(X_train, Y_train, epochs=epochs, batch_size=batch_size, verbose=0)
    +        scores = DNN.evaluate(X_test, Y_test)
    +        
    +        DNN_keras[i][j] = DNN
    +        
    +        print("Learning rate = ", eta)
    +        print("Lambda = ", lmbd)
    +        print("Test accuracy: %.3f" % scores[1])
    +        print()
    +
    +

    + + +

    # optional
    +# visual representation of grid search
    +# uses seaborn heatmap, could probably do this in matplotlib
    +import seaborn as sns
    +
    +sns.set()
    +
    +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
    +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_keras[i][j]
    +
    +        train_accuracy[i][j] = DNN.evaluate(X_train, Y_train)[1]
    +        test_accuracy[i][j] = DNN.evaluate(X_test, Y_test)[1]
    +
    +        
    +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()
    +
    +
    + + +
    +

    Which activation function should I use?

    + +

    +The Back propagation algorithm we derived above works by going from +the output layer to the input layer, propagating the error gradient on +the way. Once the algorithm has computed the gradient of the cost +function with regards to each parameter in the network, it uses these +gradients to update each parameter with a Gradient Descent (GD) step. + +

    +Unfortunately for us, the gradients often get smaller and smaller as the +algorithm progresses down to the first hidden layers. As a result, the +GD update leaves the lower layer connection weights +virtually unchanged, and training never converges to a good +solution. This is known in the literature as +the vanishing gradients problem. + +

    +In other cases, the opposite can happen, namely the the gradients can grow bigger and +bigger. The result is that many of the layers get large updates of the +weights the +algorithm diverges. This is the exploding gradients problem, which is +mostly encountered in recurrent neural networks. More generally, deep +neural networks suffer from unstable gradients, different layers may +learn at widely different speeds +

    + + +
    +

    Is the Logistic activation function (Sigmoid) our choice?

    + +

    +Although this unfortunate behavior has been empirically observed for +quite a while (it was one of the reasons why deep neural networks were +mostly abandoned for a long time), it is only around 2010 that +significant progress was made in understanding it. + +

    +A paper titled Understanding the Difficulty of Training Deep +Feedforward Neural Networks by Xavier Glorot and Yoshua Bengio found that +the problems with the popular logistic +sigmoid activation function and the weight initialization technique +that was most popular at the time, namely random initialization using +a normal distribution with a mean of 0 and a standard deviation of +1. + +

    +They showed that with this activation function and this +initialization scheme, the variance of the outputs of each layer is +much greater than the variance of its inputs. Going forward in the +network, the variance keeps increasing after each layer until the +activation function saturates at the top layers. This is actually made +worse by the fact that the logistic function has a mean of 0.5, not 0 +(the hyperbolic tangent function has a mean of 0 and behaves slightly +better than the logistic function in deep networks). +

    + + +
    +

    The derivative of the Logistic funtion

    + +

    +Looking at the logistic activation function, when inputs become large +(negative or positive), the function saturates at 0 or 1, with a +derivative extremely close to 0. Thus when backpropagation kicks in, +it has virtually no gradient to propagate back through the network, +and what little gradient exists keeps getting diluted as +backpropagation progresses down through the top layers, so there is +really nothing left for the lower layers. + +

    +In their paper, Glorot and Bengio propose a way to significantly +alleviate this problem. We need the signal to flow properly in both +directions: in the forward direction when making predictions, and in +the reverse direction when backpropagating gradients. We don’t want +the signal to die out, nor do we want it to explode and saturate. For +the signal to flow properly, the authors argue that we need the +variance of the outputs of each layer to be equal to the variance of +its inputs, and we also need the gradients to have equal variance +before and after flowing through a layer in the reverse direction. + +

    +One of the insights in the 2010 paper by Glorot and Bengio was that +the vanishing/exploding gradients problems were in part due to a poor +choice of activation function. Until then most people had assumed that +if Nature had chosen to use roughly sigmoid activation functions in +biological neurons, they must be an excellent choice. But it turns out +that other activation functions behave much better in deep neural +networks, in particular the ReLU activation function, mostly because +it does not saturate for positive values (and also because it is quite +fast to compute). +

    + + +
    +

    The RELU function family

    + +

    +The ReLU activation function suffers from a problem known as the dying +ReLUs: during training, some neurons effectively die, meaning they +stop outputting anything other than 0. + +

    +In some cases, you may find that half of your network’s neurons are +dead, especially if you used a large learning rate. During training, +if a neuron’s weights get updated such that the weighted sum of the +neuron’s inputs is negative, it will start outputting 0. When this +happen, the neuron is unlikely to come back to life since the gradient +of the ReLU function is 0 when its input is negative. + +

    +To solve this problem, nowadays practitioners use a variant of the ReLU +function, such as the leaky ReLU discussed above or the so-called +exponential linear unit (ELU) function + +

     
    +$$ +ELU(z) = \left\{\begin{array}{cc} \alpha\left( \exp{(z)}-1\right) & z < 0,\\ z & z \ge 0.\end{array}\right. +$$ +

     
    +

    + + +
    +

    Which activation function should we use?

    + +

    +In general it seems that the ELU activation function is better than +the leaky ReLU function (and its variants), which is better than +ReLU. ReLU performs better than \( \tanh \) which in turn performs better +than the logistic function. + +

    +If runtime +performance is an issue, then you may opt for the leaky ReLU function over the +ELU function If you don’t +want to tweak yet another hyperparameter, you may just use the default +\( \alpha \) of \( 0.01 \) for the leaky ReLU, and \( 1 \) for ELU. If you have +spare time and computing power, you can use cross-validation or +bootstrap to evaluate other activation functions. +

    + + +
    +

    A top-down perspective on Neural networks

    + +

    +The first thing we would like to do is divide the data into two or three +parts. A training set, a validation or dev (development) set, and a +test set. The test set is the data on which we want to make +predictions. The dev set is a subset of the training data we use to +check how well we are doing out-of-sample, after training the model on +the training dataset. We use the validation error as a proxy for the +test error in order to make tweaks to our model. It is crucial that we +do not use any of the test data to train the algorithm. This is a +cardinal sin in ML. Then: + +

      +

    • Estimate optimal error rate
    • +

    • Minimize underfitting (bias) on training data set.
    • +

    • Make sure you are not overfitting.
    • +
    +

    + +If the validation and test sets are drawn from the same distributions, +then a good performance on the validation set should lead to similarly +good performance on the test set. + +

    +However, sometimes +the training data and test data differ in subtle ways because, for +example, they are collected using slightly different methods, or +because it is cheaper to collect data in one way versus another. In +this case, there can be a mismatch between the training and test +data. This can lead to the neural network overfitting these small +differences between the test and training sets, and a poor performance +on the test set despite having a good performance on the validation +set. To rectify this, Andrew Ng suggests making two validation or dev +sets, one constructed from the training data and one constructed from +the test data. The difference between the performance of the algorithm +on these two validation sets quantifies the train-test mismatch. This +can serve as another important diagnostic when using DNNs for +supervised learning. +

    + + +
    +

    Limitations of supervised learning with deep networks

    + +

    +Like all statistical methods, supervised learning using neural +networks has important limitations. This is especially important when +one seeks to apply these methods, especially to physics problems. Like +all tools, DNNs are not a universal solution. Often, the same or +better performance on a task can be achieved by using a few +hand-engineered features (or even a collection of random +features). + +

    +Here we list some of the important limitations of supervised neural network based models. + +

      +

    • Need labeled data. All supervised learning methods, DNNs for supervised learning require labeled data. Often, labeled data is harder to acquire than unlabeled data (e.g. one must pay for human experts to label images).
    • +

    • Supervised neural networks are extremely data intensive. DNNs are data hungry. They perform best when data is plentiful. This is doubly so for supervised methods where the data must also be labeled. The utility of DNNs is extremely limited if data is hard to acquire or the datasets are small (hundreds to a few thousand samples). In this case, the performance of other methods that utilize hand-engineered features can exceed that of DNNs.
    • +

    • Homogeneous data. Almost all DNNs deal with homogeneous data of one type. It is very hard to design architectures that mix and match data types (i.e. some continuous variables, some discrete variables, some time series). In applications beyond images, video, and language, this is often what is required. In contrast, ensemble models like random forests or gradient-boosted trees have no difficulty handling mixed data types.
    • +

    • Many problems are not about prediction. In natural science we are often interested in learning something about the underlying distribution that generates the data. In this case, it is often difficult to cast these ideas in a supervised learning setting. While the problems are related, it is possible to make good predictions with a wrong model. The model might or might not be useful for understanding the underlying science.
    • +
    +

    + +Some of these remarks are particular to DNNs, others are shared by all supervised learning methods. This motivates the use of unsupervised methods which in part circumvent these problems. +

    + + +
    +

    Convolutional Neural Networks (recognizing images)

    Convolutional neural networks (CNNs) were developed during the last @@ -198,7 +2171,7 @@ Another good read is the article here Regular NNs don’t scale well to full images +

    Regular NNs don’t scale well to full images

    As an example, consider @@ -226,7 +2199,7 @@ would quickly lead to possible overfitting.

    -

    3D volumes of neurons

    +

    3D volumes of neurons

    Convolutional Neural Networks take advantage of the fact that the @@ -266,7 +2239,7 @@ dimension.

    -

    Layers used to build CNNs

    +

    Layers used to build CNNs

    A simple CNN is a sequence of layers, and every layer of a CNN @@ -290,7 +2263,7 @@ A simple CNN for image classification could have the architecture:

    -

    Transforming images

    +

    Transforming images

    CNNs transform the original image layer by layer from the original @@ -309,7 +2282,7 @@ are consistent with the labels in the training set for each image.

    -

    CNNs in brief

    +

    CNNs in brief

    In summary: @@ -331,7 +2304,7 @@ and the slides of -

    CNNs in more detail, building convolutional neural networks in Tensorflow and Keras

    +

    CNNs in more detail, building convolutional neural networks in Tensorflow and Keras

    As discussed above, CNNs are neural networks built from the assumption that the inputs @@ -347,7 +2320,7 @@ matrices, typically 1 for each color dimension (Red, Green, Blue).

    -

    Setting it up

    +

    Setting it up

    It means that to represent the entire @@ -362,7 +2335,7 @@ $$

    -

    The MNIST dataset again

    +

    The MNIST dataset again

    The MNIST dataset consists of grayscale images with a pixel size of @@ -380,7 +2353,7 @@ single neuron in the first hidden layer.

    -

    Strong correlations

    +

    Strong correlations

    Images typically have strong local correlations, meaning that a small part of the image varies little from its neighboring regions. If for example we have an image of a blue car, we can roughly assume that a @@ -396,7 +2369,7 @@ fixed, and known as a
    -

    Layers of a CNN

    +

    Layers of a CNN

    The layers of a convolutional neural network arrange neurons in 3D: width, height and depth. The input image is typically a square matrix of depth 3. @@ -418,7 +2391,7 @@ layer.
    -

    Systematic reduction

    +

    Systematic reduction

    By systematically reducing the size of the input volume, through @@ -433,7 +2406,7 @@ classification.

    -

    Prerequisites: Collect and pre-process data

    +

    Prerequisites: Collect and pre-process data

    @@ -462,8 +2435,8 @@ labels = digits.target # our images are grayscale so they should have a depth of 1 inputs = inputs[:,:,:,np.newaxis] -print("inputs = (n_inputs, pixel_width, pixel_height, depth) = " + str(inputs.shape)) -print("labels = (n_inputs) = " + str(labels.shape)) +print("inputs = (n_inputs, pixel_width, pixel_height, depth) = " + str(inputs.shape)) +print("labels = (n_inputs) = " + str(labels.shape)) # choose some random images to display @@ -482,7 +2455,7 @@ plt.show()

    -

    Importing Keras and Tensorflow

    +

    Importing Keras and Tensorflow

    @@ -503,7 +2476,7 @@ X_train, X_test, Y_train, Y_test = train_test_split(inputs, labels, train_size=t

    -

    Using TensorFlow backend

    +

    Using TensorFlow backend

    We need to define model and architecture and choose cost function and optmizer. @@ -652,7 +2625,7 @@ class ConvolutionalNeuralNetworkTensorflow:

    -

    Train the model

    +

    Train the model

    We need now to train the model, evaluate it and test its performance on test data, and eventually include hyperparameters. @@ -677,10 +2650,10 @@ CNN_tf = np.zeros((len(eta_vals), print("Learning rate = ", eta) - print("Lambda = ", lmbd) - print("Test accuracy: %.3f" % CNN.test_accuracy) - print() + print("Learning rate = ", eta) + print("Lambda = ", lmbd) + print("Test accuracy: %.3f" % CNN.test_accuracy) + print() CNN_tf[i][j] = CNN

    @@ -688,7 +2661,7 @@ CNN_tf = np.zeros((len(eta_vals), -

    Visualizing the results

    +

    Visualizing the results

    @@ -711,14 +2684,14 @@ test_accuracy = np.zeros((len(eta_vals), 10, 10)) -sns.heatmap(train_accuracy, annot=True, ax=ax, cmap="viridis") +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") +sns.heatmap(test_accuracy, annot=True, ax=ax, cmap="viridis") ax.set_title("Test Accuracy") ax.set_ylabel("$\eta$") ax.set_xlabel("$\lambda$") @@ -728,7 +2701,7 @@ plt.show()

    -

    Running with Keras

    +

    Running with Keras

    @@ -772,7 +2745,7 @@ lmbd_vals = np.logspace(-5, Final part +

    Final part

    @@ -789,16 +2762,16 @@ lmbd_vals = np.logspace(-5, print("Learning rate = ", eta) - print("Lambda = ", lmbd) - print("Test accuracy: %.3f" % scores[1]) - print() + print("Learning rate = ", eta) + print("Lambda = ", lmbd) + print("Test accuracy: %.3f" % scores[1]) + print()

    -

    Final visualization

    +

    Final visualization

    @@ -838,7 +2811,7 @@ plt.show()

    -

    Fun links

    +

    Fun links

    1. Self-Driving cars using a convolutional neural network
    2. diff --git a/doc/pub/week41/html/week41-solarized.html b/doc/pub/week41/html/week41-solarized.html index 1a169875d..164fa7351 100644 --- a/doc/pub/week41/html/week41-solarized.html +++ b/doc/pub/week41/html/week41-solarized.html @@ -26,6 +26,32 @@ pre { border: 0pt solid #93a1a1; box-shadow: none; } +.alert-text-small { font-size: 80%; } +.alert-text-large { font-size: 130%; } +.alert-text-normal { font-size: 90%; } +.alert { + padding:8px 35px 8px 14px; margin-bottom:18px; + text-shadow:0 1px 0 rgba(255,255,255,0.5); + border:1px solid #93a1a1; + border-radius: 4px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + color: #555; + background-color: #eee8d5; + background-position: 10px 5px; + background-repeat: no-repeat; + background-size: 38px; + padding-left: 55px; + width: 75%; + } +.alert-block {padding-top:14px; padding-bottom:14px} +.alert-block > p, .alert-block > ul {margin-bottom:1em} +.alert li {margin-top: 1em} +.alert-block p+p {margin-top:5px} +.alert-notice { background-image: url(https://cdn.rawgit.com/hplgit/doconce/master/bundled/html_images/small_yellow_notice.png); } +.alert-summary { background-image:url(https://cdn.rawgit.com/hplgit/doconce/master/bundled/html_images/small_yellow_summary.png); } +.alert-warning { background-image: url(https://cdn.rawgit.com/hplgit/doconce/master/bundled/html_images/small_yellow_warning.png); } +.alert-question {background-image:url(https://cdn.rawgit.com/hplgit/doconce/master/bundled/html_images/small_yellow_question.png); } div { text-align: justify; text-justify: inter-word; } @@ -35,40 +61,98 @@ div { text-align: justify; text-justify: inter-word; } @@ -110,12 +194,1860 @@ MathJax.Hub.Config({
      [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

      -

      Sep 16, 2020

      +

      Oct 5, 2020












      -

      Convolutional Neural Networks (recognizing images)

      +

      Plan for week 40

      + +
        +
      • Thursday: Building our own Feed-forward Neural Network
      • +
      • Friday: Playing around with our own Feed-forward Neural Network and introduction to TensorFlow. Start convolutional Neural Networks.
      • +
      + +Reading suggestions for both days: Aurelien Geron's chapters 10-11 and Hastie et al chapter 11. + +

      +









      + +

      Overview video for week 41

      + +

      +"Overview Video, from Stochastic Gradient methods to Neural Networks":"https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h20\ +/forelesningsvideoer/OverviewWeek41.mp4?vrtx=view-as-webpage" + +

      +









      + +

      Setting up the Back propagation algorithm

      + +

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

      +

      + +

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

      + + +

      Setting up a Multi-layer perceptron model for classification

      + +

      +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 +$$ +P(y = 0 \mid \hat{x}, \hat{\theta}) = \frac{1}{1 + \exp{(- \hat{x}})} , +$$ + +and +$$ +P(y = 1 \mid \hat{x}, \hat{\theta}) = 1 - P(y = 0 \mid \hat{x}, \hat{\theta}) , +$$ + +

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

      +









      + +

      Defining the cost function

      + +

      +Our cost function is given as (see the Logistic regression lectures) +$$ +\mathcal{C}(\hat{\theta}) = - \ln P(\mathcal{D} \mid \hat{\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(\hat{\theta}) . +$$ + +

      +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(\hat{\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. + +

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

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

      +\( y = 1 \quad \rightarrow \quad \hat{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 \( \hat{x}_i \) is the \( i \)-th input (image), \( y_{ic} \) refers to the \( c \)-th component of the \( i \)-th +output vector \( \hat{y}_i \). +The probability of \( \hat{x}_i \) being in class \( c \) will be given by the softmax function: + +$$ +P(y_{ic} = 1 \mid \hat{x}_i, \hat{\theta}) = \frac{\exp{((\hat{a}_i^{hidden})^T \hat{w}_c)}} +{\sum_{c'=0}^{C-1} \exp{((\hat{a}_i^{hidden})^T \hat{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 \hat{\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}(\hat{\theta}) = - \log{P(\mathcal{D} \mid \hat{\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! + +

      +









      + +

      Example: binary classification problem

      + +

      +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 +$$ +\mathcal{C}(\hat{\beta}) = - \sum_{i=1}^n \left(y_i\log{p(y_i \vert x_i,\hat{\beta})}+(1-y_i)\log{1-p(y_i \vert x_i,\hat{\beta})}\right), +$$ + +where we had defined the logistic (sigmoid) function +$$ +p(y_i =1\vert x_i,\hat{\beta})=\frac{\exp{(\beta_0+\beta_1 x_i)}}{1+\exp{(\beta_0+\beta_1 x_i)}}, +$$ + +and +$$ +p(y_i =0\vert x_i,\hat{\beta})=1-p(y_i =1\vert x_i,\hat{\beta}). +$$ + +The parameters \( \hat{\beta} \) were defined using a minimization method like gradient descent or Newton-Raphson's method. + +

      +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}(\hat{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}(\hat{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. + +

      +









      + +

      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 +$$ +\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}. +$$ + +For the Softmax function we have +$$ +f(z_i^l) = \frac{\exp{(z_i^l)}}{\sum_{m=1}^K\exp{(z_m^l)}}. +$$ + +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 \). + +

      + + +

      Developing a code for doing neural networks with back propagation

      + +

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

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









      + +

      Collect and pre-process data

      + +

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

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

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

      +









      + +

      Train and test datasets

      + +

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

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

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

      + + +

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

      +









      + +

      Define model and architecture

      + +

      +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} +$$ + +

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

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

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

      + + +

      Layers

      + +
        +
      • 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. + +
        +
      • 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 \( \hat{a} \)}) = \frac{\exp{(\hat{a}^T \hat{w}_j)}} +{\sum_{c=0}^{9} \exp{(\hat{a}^T \hat{w}_c)}} ,$$ + +

      +i.e. each neuron \( j \) outputs the probability of being in class \( j \) given an input from the hidden layer \( \hat{a} \), with \( \hat{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. + +

      + + +

      Weights and biases

      + +

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

      +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 \): + +$$ z_j = \sum_{i=1}^n w_ {ij} a_i + b_j.$$ + +

      +The bias weights \( \hat{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
      +
      +

      +









      + +

      Feed-forward pass

      + +

      +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 \): + +$$ z_{j}^{l} = \sum_{i=1}^{F} w_{ij}^{l} x_i + b_{j}^{l},$$ + +

      +this is then passed through our activation function + +$$ a_{j}^{l} = f(z_{j}^{l}) .$$ + +

      +We calculate a weighted sum of inputs (activations in the hidden layer) to each neuron \( j \) in the output layer: + +$$ z_{j}^{L} = \sum_{i=1}^{H} w_{ij}^{L} a_{i}^{l} + b_{j}^{L}.$$ + +

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

      + + +

      Matrix multiplications

      + +

      +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 + +$$ X W^{h} = (n_{inputs}, n_{hidden}),$$ + +

      +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} \): + +$$ \hat{z}^{l} = \hat{X} \hat{W}^{l} + \hat{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: + +$$ \hat{a}^{l} = f(\hat{z}^l) .$$ + +

      +This is fed to the output layer: + +$$ \hat{z}^{L} = \hat{a}^{L} \hat{W}^{L} + \hat{b}^{L} .$$ + +

      +Finally we receive our output values for each image and each category by passing it through the softmax function: + +$$ output = softmax (\hat{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]))
      +
      +

      +









      + +

      Choose cost function and optimizer

      + +

      +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 multiclass classification it is common to treat each integer label as a so called one-hot vector: + +$$ y = 5 \quad \rightarrow \quad \hat{y} = (0, 0, 0, 0, 0, 1, 0, 0, 0, 0) ,$$ + +$$ y = 1 \quad \rightarrow \quad \hat{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 \( \hat{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 \( \hat{\theta} \) represents the parameters of our network, i.e. all the weights and biases. + +

      +









      + +

      Optimizing the cost function

      + +

      +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 + +$$ \theta_{i+1} = \theta_i - \eta \nabla \mathcal{C}(\theta_i) ,$$ + +

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

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

      + + +

      Regularization

      + +

      +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 will measure the size of the weights using the so called L2-norm, meaning our cost function becomes: + +$$ \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 \hat{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. + +

      +









      + +

      Matrix multiplication

      + +

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

      +The gradient for the output weights is calculated as + +$$ \nabla W_{L} = \hat{a}^T \delta_L = (n_{hidden}, n_{categories}) ,$$ + +

      +where \( \hat{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. + +

      +The gradient with respect to the output bias is then + +$$ \nabla \hat{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)))
      +
      +

      +









      + +

      Improving performance

      + +

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

      +









      + +

      Full object-oriented implementation

      + +

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

      + + +

      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):
      +
      +        self.X_data_full = X_data
      +        self.Y_data_full = Y_data
      +
      +        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()
      +
      +

      +









      + +

      Evaluate model performance on test data

      + +

      +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 \). + +$$ \text{Accuracy} = \frac{\sum_{i=1}^n I(\hat{y}_i = y_i)}{n} ,$$ + +

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

      + + +

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

      +









      + +

      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()
      +
      +

      +









      + +

      Visualization

      + +

      + + +

      # visual representation of grid search
      +# uses seaborn heatmap, you can also do this with matplotlib imshow
      +import seaborn as sns
      +
      +sns.set()
      +
      +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
      +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_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()
      +
      +

      +









      + +

      scikit-learn implementation

      + +

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

      +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()
      +
      +

      +









      + +

      Visualization

      +

      + + +

      # optional
      +# visual representation of grid search
      +# uses seaborn heatmap, could probably do this in matplotlib
      +import seaborn as sns
      +
      +sns.set()
      +
      +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
      +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]
      +        
      +        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()
      +
      +

      +









      + +

      Building neural networks in Tensorflow and Keras

      + +

      +Now we want to build on the experience gained from our neural network implementation in NumPy and scikit-learn +and use it to construct a neural network in Tensorflow. Once we have constructed a neural network in NumPy +and Tensorflow, building one in Keras is really quite trivial, though the performance may suffer. + +

      +In our previous example we used only one hidden layer, and in this we will use two. From this it should be quite +clear how to build one using an arbitrary number of hidden layers, using data structures such as Python lists or +NumPy arrays. + +

      +









      + +

      Tensorflow

      + +

      +Tensorflow is an open source library machine learning library +developed by the Google Brain team for internal use. It was released +under the Apache 2.0 open source license in November 9, 2015. + +

      +Tensorflow is a computational framework that allows you to construct +machine learning models at different levels of abstraction, from +high-level, object-oriented APIs like Keras, down to the C++ kernels +that Tensorflow is built upon. The higher levels of abstraction are +simpler to use, but less flexible, and our choice of implementation +should reflect the problems we are trying to solve. + +

      +Tensorflow uses so-called graphs to represent your computation +in terms of the dependencies between individual operations, such that you first build a Tensorflow graph +to represent your model, and then create a Tensorflow session to run the graph. + +

      +In this guide we will analyze the same data as we did in our NumPy and +scikit-learn tutorial, gathered from the MNIST database of images. We +will give an introduction to the lower level Python Application +Program Interfaces (APIs), and see how we use them to build our graph. +Then we will build (effectively) the same graph in Keras, to see just +how simple solving a machine learning problem can be. + +

      +To install tensorflow on Unix/Linux systems, use pip as +

      + + +

      pip3 install tensorflow
      +
      +

      +and/or if you use anaconda, just write (or install from the graphical user interface) +

      + + +

      conda install tensorflow
      +
      +

      +









      + +

      Collect and pre-process data

      + +

      + + +

      # 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()
      +
      +

      + + +

      from keras.utils import to_categorical
      +from sklearn.model_selection import train_test_split
      +
      +# one-hot representation of labels
      +labels = to_categorical(labels)
      +
      +# split into train and test data
      +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)
      +
      +

      +









      + +

      Using TensorFlow backend

      + +
        +
      1. Define model and architecture
      2. +
      3. Choose cost function and optimizer
      4. +
      + +

      + + +

      import tensorflow as tf
      +
      +class NeuralNetworkTensorflow:
      +    def __init__(
      +            self,
      +            X_train,
      +            Y_train,
      +            X_test,
      +            Y_test,
      +            n_neurons_layer1=100,
      +            n_neurons_layer2=50,
      +            n_categories=2,
      +            epochs=10,
      +            batch_size=100,
      +            eta=0.1,
      +            lmbd=0.0):
      +        
      +        # keep track of number of steps
      +        self.global_step = tf.Variable(0, dtype=tf.int32, trainable=False, name='global_step')
      +        
      +        self.X_train = X_train
      +        self.Y_train = Y_train
      +        self.X_test = X_test
      +        self.Y_test = Y_test
      +        
      +        self.n_inputs = X_train.shape[0]
      +        self.n_features = X_train.shape[1]
      +        self.n_neurons_layer1 = n_neurons_layer1
      +        self.n_neurons_layer2 = n_neurons_layer2
      +        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
      +        
      +        # build network piece by piece
      +        # name scopes (with) are used to enforce creation of new variables
      +        # https://www.tensorflow.org/guide/variables
      +        self.create_placeholders()
      +        self.create_DNN()
      +        self.create_loss()
      +        self.create_optimiser()
      +        self.create_accuracy()
      +    
      +    def create_placeholders(self):
      +        # placeholders are fine here, but "Datasets" are the preferred method
      +        # of streaming data into a model
      +        with tf.name_scope('data'):
      +            self.X = tf.placeholder(tf.float32, shape=(None, self.n_features), name='X_data')
      +            self.Y = tf.placeholder(tf.float32, shape=(None, self.n_categories), name='Y_data')
      +    
      +    def create_DNN(self):
      +        with tf.name_scope('DNN'):
      +            # the weights are stored to calculate regularization loss later
      +            
      +            # Fully connected layer 1
      +            self.W_fc1 = self.weight_variable([self.n_features, self.n_neurons_layer1], name='fc1', dtype=tf.float32)
      +            b_fc1 = self.bias_variable([self.n_neurons_layer1], name='fc1', dtype=tf.float32)
      +            a_fc1 = tf.nn.sigmoid(tf.matmul(self.X, self.W_fc1) + b_fc1)
      +            
      +            # Fully connected layer 2
      +            self.W_fc2 = self.weight_variable([self.n_neurons_layer1, self.n_neurons_layer2], name='fc2', dtype=tf.float32)
      +            b_fc2 = self.bias_variable([self.n_neurons_layer2], name='fc2', dtype=tf.float32)
      +            a_fc2 = tf.nn.sigmoid(tf.matmul(a_fc1, self.W_fc2) + b_fc2)
      +            
      +            # Output layer
      +            self.W_out = self.weight_variable([self.n_neurons_layer2, self.n_categories], name='out', dtype=tf.float32)
      +            b_out = self.bias_variable([self.n_categories], name='out', dtype=tf.float32)
      +            self.z_out = tf.matmul(a_fc2, self.W_out) + b_out
      +    
      +    def create_loss(self):
      +        with tf.name_scope('loss'):
      +            softmax_loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits_v2(labels=self.Y, logits=self.z_out))
      +            
      +            regularizer_loss_fc1 = tf.nn.l2_loss(self.W_fc1)
      +            regularizer_loss_fc2 = tf.nn.l2_loss(self.W_fc2)
      +            regularizer_loss_out = tf.nn.l2_loss(self.W_out)
      +            regularizer_loss = self.lmbd*(regularizer_loss_fc1 + regularizer_loss_fc2 + regularizer_loss_out)
      +            
      +            self.loss = softmax_loss + regularizer_loss
      +
      +    def create_accuracy(self):
      +        with tf.name_scope('accuracy'):
      +            probabilities = tf.nn.softmax(self.z_out)
      +            predictions = tf.argmax(probabilities, axis=1)
      +            labels = tf.argmax(self.Y, axis=1)
      +            
      +            correct_predictions = tf.equal(predictions, labels)
      +            correct_predictions = tf.cast(correct_predictions, tf.float32)
      +            self.accuracy = tf.reduce_mean(correct_predictions)
      +    
      +    def create_optimiser(self):
      +        with tf.name_scope('optimizer'):
      +            self.optimizer = tf.train.GradientDescentOptimizer(learning_rate=self.eta).minimize(self.loss, global_step=self.global_step)
      +            
      +    def weight_variable(self, shape, name='', dtype=tf.float32):
      +        initial = tf.truncated_normal(shape, stddev=0.1)
      +        return tf.Variable(initial, name=name, dtype=dtype)
      +    
      +    def bias_variable(self, shape, name='', dtype=tf.float32):
      +        initial = tf.constant(0.1, shape=shape)
      +        return tf.Variable(initial, name=name, dtype=dtype)
      +    
      +    def fit(self):
      +        data_indices = np.arange(self.n_inputs)
      +
      +        with tf.Session() as sess:
      +            sess.run(tf.global_variables_initializer())
      +            for i in range(self.epochs):
      +                for j in range(self.iterations):
      +                    chosen_datapoints = np.random.choice(data_indices, size=self.batch_size, replace=False)
      +                    batch_X, batch_Y = self.X_train[chosen_datapoints], self.Y_train[chosen_datapoints]
      +            
      +                    sess.run([DNN.loss, DNN.optimizer],
      +                        feed_dict={DNN.X: batch_X,
      +                                   DNN.Y: batch_Y})
      +                    accuracy = sess.run(DNN.accuracy,
      +                        feed_dict={DNN.X: batch_X,
      +                                   DNN.Y: batch_Y})
      +                    step = sess.run(DNN.global_step)
      +    
      +            self.train_loss, self.train_accuracy = sess.run([DNN.loss, DNN.accuracy],
      +                feed_dict={DNN.X: self.X_train,
      +                           DNN.Y: self.Y_train})
      +        
      +            self.test_loss, self.test_accuracy = sess.run([DNN.loss, DNN.accuracy],
      +                feed_dict={DNN.X: self.X_test,
      +                           DNN.Y: self.Y_test})
      +
      +

      +









      + +

      Optimizing and using gradient descent

      + +

      + + +

      epochs = 100
      +batch_size = 100
      +n_neurons_layer1 = 100
      +n_neurons_layer2 = 50
      +n_categories = 10
      +eta_vals = np.logspace(-5, 1, 7)
      +lmbd_vals = np.logspace(-5, 1, 7)
      +
      +

      + + +

      DNN_tf = 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 = NeuralNetworkTensorflow(X_train, Y_train, X_test, Y_test,
      +                                      n_neurons_layer1, n_neurons_layer2, n_categories,
      +                                      epochs=epochs, batch_size=batch_size, eta=eta, lmbd=lmbd)
      +        DNN.fit()
      +        
      +        DNN_tf[i][j] = DNN
      +        
      +        print("Learning rate = ", eta)
      +        print("Lambda = ", lmbd)
      +        print("Test accuracy: %.3f" % DNN.test_accuracy)
      +        print()
      +
      +

      + + +

      # optional
      +# visual representation of grid search
      +# uses seaborn heatmap, could probably do this in matplotlib
      +import seaborn as sns
      +
      +sns.set()
      +
      +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
      +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_tf[i][j]
      +
      +        train_accuracy[i][j] = DNN.train_accuracy
      +        test_accuracy[i][j] = DNN.test_accuracy
      +
      +        
      +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()
      +
      +

      + + +

      # optional
      +# we can use log files to visualize our graph in Tensorboard
      +writer = tf.summary.FileWriter('logs/')
      +writer.add_graph(tf.get_default_graph())
      +
      +

      +









      + +

      Using Keras

      + +

      +Keras is a high level neural network +that supports Tensorflow, CTNK and Theano as backends. +If you have Tensorflow installed Keras is available through the tf.keras module. +If you have Anaconda installed you may run the following command +

      + + +

      conda install keras
      +
      +

      +Alternatively, if you have Tensorflow or one of the other supported backends install you may use the pip package manager: + +

      + + +

      pip3 install keras
      +
      +

      +or look up the instructions here. + +

      + + +

      from keras.models import Sequential
      +from keras.layers import Dense
      +from keras.regularizers import l2
      +from keras.optimizers import SGD
      +
      +def create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories, eta, lmbd):
      +    model = Sequential()
      +    model.add(Dense(n_neurons_layer1, activation='sigmoid', kernel_regularizer=l2(lmbd)))
      +    model.add(Dense(n_neurons_layer2, activation='sigmoid', kernel_regularizer=l2(lmbd)))
      +    model.add(Dense(n_categories, activation='softmax'))
      +    
      +    sgd = SGD(lr=eta)
      +    model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])
      +    
      +    return model
      +
      +

      + + +

      DNN_keras = 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 = create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories,
      +                                         eta=eta, lmbd=lmbd)
      +        DNN.fit(X_train, Y_train, epochs=epochs, batch_size=batch_size, verbose=0)
      +        scores = DNN.evaluate(X_test, Y_test)
      +        
      +        DNN_keras[i][j] = DNN
      +        
      +        print("Learning rate = ", eta)
      +        print("Lambda = ", lmbd)
      +        print("Test accuracy: %.3f" % scores[1])
      +        print()
      +
      +

      + + +

      # optional
      +# visual representation of grid search
      +# uses seaborn heatmap, could probably do this in matplotlib
      +import seaborn as sns
      +
      +sns.set()
      +
      +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
      +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_keras[i][j]
      +
      +        train_accuracy[i][j] = DNN.evaluate(X_train, Y_train)[1]
      +        test_accuracy[i][j] = DNN.evaluate(X_test, Y_test)[1]
      +
      +        
      +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()
      +
      +

      + + +

      Which activation function should I use?

      + +

      +The Back propagation algorithm we derived above works by going from +the output layer to the input layer, propagating the error gradient on +the way. Once the algorithm has computed the gradient of the cost +function with regards to each parameter in the network, it uses these +gradients to update each parameter with a Gradient Descent (GD) step. + +

      +Unfortunately for us, the gradients often get smaller and smaller as the +algorithm progresses down to the first hidden layers. As a result, the +GD update leaves the lower layer connection weights +virtually unchanged, and training never converges to a good +solution. This is known in the literature as +the vanishing gradients problem. + +

      +In other cases, the opposite can happen, namely the the gradients can grow bigger and +bigger. The result is that many of the layers get large updates of the +weights the +algorithm diverges. This is the exploding gradients problem, which is +mostly encountered in recurrent neural networks. More generally, deep +neural networks suffer from unstable gradients, different layers may +learn at widely different speeds + +

      + + +

      Is the Logistic activation function (Sigmoid) our choice?

      + +

      +Although this unfortunate behavior has been empirically observed for +quite a while (it was one of the reasons why deep neural networks were +mostly abandoned for a long time), it is only around 2010 that +significant progress was made in understanding it. + +

      +A paper titled Understanding the Difficulty of Training Deep +Feedforward Neural Networks by Xavier Glorot and Yoshua Bengio found that +the problems with the popular logistic +sigmoid activation function and the weight initialization technique +that was most popular at the time, namely random initialization using +a normal distribution with a mean of 0 and a standard deviation of +1. + +

      +They showed that with this activation function and this +initialization scheme, the variance of the outputs of each layer is +much greater than the variance of its inputs. Going forward in the +network, the variance keeps increasing after each layer until the +activation function saturates at the top layers. This is actually made +worse by the fact that the logistic function has a mean of 0.5, not 0 +(the hyperbolic tangent function has a mean of 0 and behaves slightly +better than the logistic function in deep networks). + +

      +









      + +

      The derivative of the Logistic funtion

      + +

      +Looking at the logistic activation function, when inputs become large +(negative or positive), the function saturates at 0 or 1, with a +derivative extremely close to 0. Thus when backpropagation kicks in, +it has virtually no gradient to propagate back through the network, +and what little gradient exists keeps getting diluted as +backpropagation progresses down through the top layers, so there is +really nothing left for the lower layers. + +

      +In their paper, Glorot and Bengio propose a way to significantly +alleviate this problem. We need the signal to flow properly in both +directions: in the forward direction when making predictions, and in +the reverse direction when backpropagating gradients. We don’t want +the signal to die out, nor do we want it to explode and saturate. For +the signal to flow properly, the authors argue that we need the +variance of the outputs of each layer to be equal to the variance of +its inputs, and we also need the gradients to have equal variance +before and after flowing through a layer in the reverse direction. + +

      +One of the insights in the 2010 paper by Glorot and Bengio was that +the vanishing/exploding gradients problems were in part due to a poor +choice of activation function. Until then most people had assumed that +if Nature had chosen to use roughly sigmoid activation functions in +biological neurons, they must be an excellent choice. But it turns out +that other activation functions behave much better in deep neural +networks, in particular the ReLU activation function, mostly because +it does not saturate for positive values (and also because it is quite +fast to compute). + +

      +









      + +

      The RELU function family

      + +

      +The ReLU activation function suffers from a problem known as the dying +ReLUs: during training, some neurons effectively die, meaning they +stop outputting anything other than 0. + +

      +In some cases, you may find that half of your network’s neurons are +dead, especially if you used a large learning rate. During training, +if a neuron’s weights get updated such that the weighted sum of the +neuron’s inputs is negative, it will start outputting 0. When this +happen, the neuron is unlikely to come back to life since the gradient +of the ReLU function is 0 when its input is negative. + +

      +To solve this problem, nowadays practitioners use a variant of the ReLU +function, such as the leaky ReLU discussed above or the so-called +exponential linear unit (ELU) function + +$$ +ELU(z) = \left\{\begin{array}{cc} \alpha\left( \exp{(z)}-1\right) & z < 0,\\ z & z \ge 0.\end{array}\right. +$$ + +

      +









      + +

      Which activation function should we use?

      + +

      +In general it seems that the ELU activation function is better than +the leaky ReLU function (and its variants), which is better than +ReLU. ReLU performs better than \( \tanh \) which in turn performs better +than the logistic function. + +

      +If runtime +performance is an issue, then you may opt for the leaky ReLU function over the +ELU function If you don’t +want to tweak yet another hyperparameter, you may just use the default +\( \alpha \) of \( 0.01 \) for the leaky ReLU, and \( 1 \) for ELU. If you have +spare time and computing power, you can use cross-validation or +bootstrap to evaluate other activation functions. + +

      + + +

      A top-down perspective on Neural networks

      + +

      +The first thing we would like to do is divide the data into two or three +parts. A training set, a validation or dev (development) set, and a +test set. The test set is the data on which we want to make +predictions. The dev set is a subset of the training data we use to +check how well we are doing out-of-sample, after training the model on +the training dataset. We use the validation error as a proxy for the +test error in order to make tweaks to our model. It is crucial that we +do not use any of the test data to train the algorithm. This is a +cardinal sin in ML. Then: + +

        +
      • Estimate optimal error rate
      • +
      • Minimize underfitting (bias) on training data set.
      • +
      • Make sure you are not overfitting.
      • +
      + +If the validation and test sets are drawn from the same distributions, +then a good performance on the validation set should lead to similarly +good performance on the test set. + +

      +However, sometimes +the training data and test data differ in subtle ways because, for +example, they are collected using slightly different methods, or +because it is cheaper to collect data in one way versus another. In +this case, there can be a mismatch between the training and test +data. This can lead to the neural network overfitting these small +differences between the test and training sets, and a poor performance +on the test set despite having a good performance on the validation +set. To rectify this, Andrew Ng suggests making two validation or dev +sets, one constructed from the training data and one constructed from +the test data. The difference between the performance of the algorithm +on these two validation sets quantifies the train-test mismatch. This +can serve as another important diagnostic when using DNNs for +supervised learning. + +

      +









      + +

      Limitations of supervised learning with deep networks

      + +

      +Like all statistical methods, supervised learning using neural +networks has important limitations. This is especially important when +one seeks to apply these methods, especially to physics problems. Like +all tools, DNNs are not a universal solution. Often, the same or +better performance on a task can be achieved by using a few +hand-engineered features (or even a collection of random +features). + +

      +Here we list some of the important limitations of supervised neural network based models. + +

        +
      • Need labeled data. All supervised learning methods, DNNs for supervised learning require labeled data. Often, labeled data is harder to acquire than unlabeled data (e.g. one must pay for human experts to label images).
      • +
      • Supervised neural networks are extremely data intensive. DNNs are data hungry. They perform best when data is plentiful. This is doubly so for supervised methods where the data must also be labeled. The utility of DNNs is extremely limited if data is hard to acquire or the datasets are small (hundreds to a few thousand samples). In this case, the performance of other methods that utilize hand-engineered features can exceed that of DNNs.
      • +
      • Homogeneous data. Almost all DNNs deal with homogeneous data of one type. It is very hard to design architectures that mix and match data types (i.e. some continuous variables, some discrete variables, some time series). In applications beyond images, video, and language, this is often what is required. In contrast, ensemble models like random forests or gradient-boosted trees have no difficulty handling mixed data types.
      • +
      • Many problems are not about prediction. In natural science we are often interested in learning something about the underlying distribution that generates the data. In this case, it is often difficult to cast these ideas in a supervised learning setting. While the problems are related, it is possible to make good predictions with a wrong model. The model might or might not be useful for understanding the underlying science.
      • +
      + +Some of these remarks are particular to DNNs, others are shared by all supervised learning methods. This motivates the use of unsupervised methods which in part circumvent these problems. + +

      +









      + +

      Convolutional Neural Networks (recognizing images)

      Convolutional neural networks (CNNs) were developed during the last @@ -154,7 +2086,7 @@ Another good read is the article here Regular NNs don’t scale well to full images +

      Regular NNs don’t scale well to full images

      As an example, consider @@ -182,7 +2114,7 @@ would quickly lead to possible overfitting.











      -

      3D volumes of neurons

      +

      3D volumes of neurons

      Convolutional Neural Networks take advantage of the fact that the @@ -222,7 +2154,7 @@ dimension.

      -

      Layers used to build CNNs

      +

      Layers used to build CNNs

      A simple CNN is a sequence of layers, and every layer of a CNN @@ -245,7 +2177,7 @@ A simple CNN for image classification could have the architecture:









      -

      Transforming images

      +

      Transforming images

      CNNs transform the original image layer by layer from the original @@ -264,7 +2196,7 @@ are consistent with the labels in the training set for each image.











      -

      CNNs in brief

      +

      CNNs in brief

      In summary: @@ -285,7 +2217,7 @@ and the slides of









      -

      CNNs in more detail, building convolutional neural networks in Tensorflow and Keras

      +

      CNNs in more detail, building convolutional neural networks in Tensorflow and Keras

      As discussed above, CNNs are neural networks built from the assumption that the inputs @@ -301,7 +2233,7 @@ matrices, typically 1 for each color dimension (Red, Green, Blue).











      -

      Setting it up

      +

      Setting it up

      It means that to represent the entire @@ -313,7 +2245,7 @@ $$











      -

      The MNIST dataset again

      +

      The MNIST dataset again

      The MNIST dataset consists of grayscale images with a pixel size of @@ -331,7 +2263,7 @@ single neuron in the first hidden layer.











      -

      Strong correlations

      +

      Strong correlations

      Images typically have strong local correlations, meaning that a small part of the image varies little from its neighboring regions. If for example we have an image of a blue car, we can roughly assume that a @@ -347,7 +2279,7 @@ fixed, and known as a
      -

      Layers of a CNN

      +

      Layers of a CNN

      The layers of a convolutional neural network arrange neurons in 3D: width, height and depth. The input image is typically a square matrix of depth 3. @@ -369,7 +2301,7 @@ layer.











      -

      Systematic reduction

      +

      Systematic reduction

      By systematically reducing the size of the input volume, through @@ -384,7 +2316,7 @@ classification.











      -

      Prerequisites: Collect and pre-process data

      +

      Prerequisites: Collect and pre-process data

      @@ -413,8 +2345,8 @@ labels = digits.target # our images are grayscale so they should have a depth of 1 inputs = inputs[:,:,:,np.newaxis] -print("inputs = (n_inputs, pixel_width, pixel_height, depth) = " + str(inputs.shape)) -print("labels = (n_inputs) = " + str(labels.shape)) +print("inputs = (n_inputs, pixel_width, pixel_height, depth) = " + str(inputs.shape)) +print("labels = (n_inputs) = " + str(labels.shape)) # choose some random images to display @@ -432,7 +2364,7 @@ plt.show()











      -

      Importing Keras and Tensorflow

      +

      Importing Keras and Tensorflow

      @@ -452,7 +2384,7 @@ X_train, X_test, Y_train, Y_test = train_test_split(inputs, labels, train_size=t











      -

      Using TensorFlow backend

      +

      Using TensorFlow backend

      We need to define model and architecture and choose cost function and optmizer. @@ -600,7 +2532,7 @@ class ConvolutionalNeuralNetworkTensorflow:











      -

      Train the model

      +

      Train the model

      We need now to train the model, evaluate it and test its performance on test data, and eventually include hyperparameters. @@ -625,17 +2557,17 @@ CNN_tf = np.zeros((len(eta_vals), print("Learning rate = ", eta) - print("Lambda = ", lmbd) - print("Test accuracy: %.3f" % CNN.test_accuracy) - print() + print("Learning rate = ", eta) + print("Lambda = ", lmbd) + print("Test accuracy: %.3f" % CNN.test_accuracy) + print() CNN_tf[i][j] = CNN











    -

    Visualizing the results

    +

    Visualizing the results

    @@ -658,14 +2590,14 @@ test_accuracy = np.zeros((len(eta_vals), 10, 10)) -sns.heatmap(train_accuracy, annot=True, ax=ax, cmap="viridis") +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") +sns.heatmap(test_accuracy, annot=True, ax=ax, cmap="viridis") ax.set_title("Test Accuracy") ax.set_ylabel("$\eta$") ax.set_xlabel("$\lambda$") @@ -674,7 +2606,7 @@ plt.show()

    -

    Running with Keras

    +

    Running with Keras

    @@ -717,7 +2649,7 @@ lmbd_vals = np.logspace(-5, Final part +

    Final part

    @@ -734,15 +2666,15 @@ lmbd_vals = np.logspace(-5, print("Learning rate = ", eta) - print("Lambda = ", lmbd) - print("Test accuracy: %.3f" % scores[1]) - print() + print("Learning rate = ", eta) + print("Lambda = ", lmbd) + print("Test accuracy: %.3f" % scores[1]) + print()











    -

    Final visualization

    +

    Final visualization

    @@ -781,7 +2713,7 @@ plt.show()











    -

    Fun links

    +

    Fun links

    1. Self-Driving cars using a convolutional neural network
    2. diff --git a/doc/pub/week41/html/week41.html b/doc/pub/week41/html/week41.html index 96486431c..13a71098e 100644 --- a/doc/pub/week41/html/week41.html +++ b/doc/pub/week41/html/week41.html @@ -31,6 +31,32 @@ p { text-indent: 0px; } hr { border: 0; width: 80%; border-bottom: 1px solid #aaa} p.caption { width: 80%; font-style: normal; text-align: left; } hr.figure { border: 0; width: 80%; border-bottom: 1px solid #aaa} +.alert-text-small { font-size: 80%; } +.alert-text-large { font-size: 130%; } +.alert-text-normal { font-size: 90%; } +.alert { + padding:8px 35px 8px 14px; margin-bottom:18px; + text-shadow:0 1px 0 rgba(255,255,255,0.5); + border:1px solid #bababa; + border-radius: 4px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + color: #555; + background-color: #f8f8f8; + background-position: 10px 5px; + background-repeat: no-repeat; + background-size: 38px; + padding-left: 55px; + width: 75%; + } +.alert-block {padding-top:14px; padding-bottom:14px} +.alert-block > p, .alert-block > ul {margin-bottom:1em} +.alert li {margin-top: 1em} +.alert-block p+p {margin-top:5px} +.alert-notice { background-image: url(https://cdn.rawgit.com/hplgit/doconce/master/bundled/html_images/small_gray_notice.png); } +.alert-summary { background-image:url(https://cdn.rawgit.com/hplgit/doconce/master/bundled/html_images/small_gray_summary.png); } +.alert-warning { background-image: url(https://cdn.rawgit.com/hplgit/doconce/master/bundled/html_images/small_gray_warning.png); } +.alert-question {background-image:url(https://cdn.rawgit.com/hplgit/doconce/master/bundled/html_images/small_gray_question.png); } div { text-align: justify; text-justify: inter-word; } @@ -40,40 +66,98 @@ div { text-align: justify; text-justify: inter-word; } @@ -115,12 +199,1860 @@ MathJax.Hub.Config({
      [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

      -

      Sep 16, 2020

      +

      Oct 5, 2020












      -

      Convolutional Neural Networks (recognizing images)

      +

      Plan for week 40

      + + + +Reading suggestions for both days: Aurelien Geron's chapters 10-11 and Hastie et al chapter 11. + +

      +









      + +

      Overview video for week 41

      + +

      +"Overview Video, from Stochastic Gradient methods to Neural Networks":"https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h20\ +/forelesningsvideoer/OverviewWeek41.mp4?vrtx=view-as-webpage" + +

      +









      + +

      Setting up the Back propagation algorithm

      + +

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

      +

      + +

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

      + + +

      Setting up a Multi-layer perceptron model for classification

      + +

      +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 +$$ +P(y = 0 \mid \hat{x}, \hat{\theta}) = \frac{1}{1 + \exp{(- \hat{x}})} , +$$ + +and +$$ +P(y = 1 \mid \hat{x}, \hat{\theta}) = 1 - P(y = 0 \mid \hat{x}, \hat{\theta}) , +$$ + +

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

      +









      + +

      Defining the cost function

      + +

      +Our cost function is given as (see the Logistic regression lectures) +$$ +\mathcal{C}(\hat{\theta}) = - \ln P(\mathcal{D} \mid \hat{\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(\hat{\theta}) . +$$ + +

      +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(\hat{\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. + +

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

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

      +\( y = 1 \quad \rightarrow \quad \hat{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 \( \hat{x}_i \) is the \( i \)-th input (image), \( y_{ic} \) refers to the \( c \)-th component of the \( i \)-th +output vector \( \hat{y}_i \). +The probability of \( \hat{x}_i \) being in class \( c \) will be given by the softmax function: + +$$ +P(y_{ic} = 1 \mid \hat{x}_i, \hat{\theta}) = \frac{\exp{((\hat{a}_i^{hidden})^T \hat{w}_c)}} +{\sum_{c'=0}^{C-1} \exp{((\hat{a}_i^{hidden})^T \hat{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 \hat{\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}(\hat{\theta}) = - \log{P(\mathcal{D} \mid \hat{\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! + +

      +









      + +

      Example: binary classification problem

      + +

      +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 +$$ +\mathcal{C}(\hat{\beta}) = - \sum_{i=1}^n \left(y_i\log{p(y_i \vert x_i,\hat{\beta})}+(1-y_i)\log{1-p(y_i \vert x_i,\hat{\beta})}\right), +$$ + +where we had defined the logistic (sigmoid) function +$$ +p(y_i =1\vert x_i,\hat{\beta})=\frac{\exp{(\beta_0+\beta_1 x_i)}}{1+\exp{(\beta_0+\beta_1 x_i)}}, +$$ + +and +$$ +p(y_i =0\vert x_i,\hat{\beta})=1-p(y_i =1\vert x_i,\hat{\beta}). +$$ + +The parameters \( \hat{\beta} \) were defined using a minimization method like gradient descent or Newton-Raphson's method. + +

      +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}(\hat{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}(\hat{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. + +

      +









      + +

      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 +$$ +\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}. +$$ + +For the Softmax function we have +$$ +f(z_i^l) = \frac{\exp{(z_i^l)}}{\sum_{m=1}^K\exp{(z_m^l)}}. +$$ + +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 \). + +

      + + +

      Developing a code for doing neural networks with back propagation

      + +

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

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









      + +

      Collect and pre-process data

      + +

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

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

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

      +









      + +

      Train and test datasets

      + +

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

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

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

      + + +

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

      +









      + +

      Define model and architecture

      + +

      +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} +$$ + +

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

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

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

      + + +

      Layers

      + + + +Since each input image has 8x8 = 64 pixels or features, we have an input layer of 64 neurons. + + + +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. + + + +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 \( \hat{a} \)}) = \frac{\exp{(\hat{a}^T \hat{w}_j)}} +{\sum_{c=0}^{9} \exp{(\hat{a}^T \hat{w}_c)}} ,$$ + +

      +i.e. each neuron \( j \) outputs the probability of being in class \( j \) given an input from the hidden layer \( \hat{a} \), with \( \hat{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. + +

      + + +

      Weights and biases

      + +

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

      +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 \): + +$$ z_j = \sum_{i=1}^n w_ {ij} a_i + b_j.$$ + +

      +The bias weights \( \hat{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
      +
      +

      +









      + +

      Feed-forward pass

      + +

      +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 \): + +$$ z_{j}^{l} = \sum_{i=1}^{F} w_{ij}^{l} x_i + b_{j}^{l},$$ + +

      +this is then passed through our activation function + +$$ a_{j}^{l} = f(z_{j}^{l}) .$$ + +

      +We calculate a weighted sum of inputs (activations in the hidden layer) to each neuron \( j \) in the output layer: + +$$ z_{j}^{L} = \sum_{i=1}^{H} w_{ij}^{L} a_{i}^{l} + b_{j}^{L}.$$ + +

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

      + + +

      Matrix multiplications

      + +

      +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 + +$$ X W^{h} = (n_{inputs}, n_{hidden}),$$ + +

      +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} \): + +$$ \hat{z}^{l} = \hat{X} \hat{W}^{l} + \hat{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: + +$$ \hat{a}^{l} = f(\hat{z}^l) .$$ + +

      +This is fed to the output layer: + +$$ \hat{z}^{L} = \hat{a}^{L} \hat{W}^{L} + \hat{b}^{L} .$$ + +

      +Finally we receive our output values for each image and each category by passing it through the softmax function: + +$$ output = softmax (\hat{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]))
      +
      +

      +









      + +

      Choose cost function and optimizer

      + +

      +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 multiclass classification it is common to treat each integer label as a so called one-hot vector: + +$$ y = 5 \quad \rightarrow \quad \hat{y} = (0, 0, 0, 0, 0, 1, 0, 0, 0, 0) ,$$ + +$$ y = 1 \quad \rightarrow \quad \hat{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 \( \hat{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 \( \hat{\theta} \) represents the parameters of our network, i.e. all the weights and biases. + +

      +









      + +

      Optimizing the cost function

      + +

      +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 + +$$ \theta_{i+1} = \theta_i - \eta \nabla \mathcal{C}(\theta_i) ,$$ + +

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

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

      + + +

      Regularization

      + +

      +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 will measure the size of the weights using the so called L2-norm, meaning our cost function becomes: + +$$ \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 \hat{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. + +

      +









      + +

      Matrix multiplication

      + +

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

      +The gradient for the output weights is calculated as + +$$ \nabla W_{L} = \hat{a}^T \delta_L = (n_{hidden}, n_{categories}) ,$$ + +

      +where \( \hat{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. + +

      +The gradient with respect to the output bias is then + +$$ \nabla \hat{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)))
      +
      +

      +









      + +

      Improving performance

      + +

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

      +









      + +

      Full object-oriented implementation

      + +

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

      + + +

      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):
      +
      +        self.X_data_full = X_data
      +        self.Y_data_full = Y_data
      +
      +        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()
      +
      +

      +









      + +

      Evaluate model performance on test data

      + +

      +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 \). + +$$ \text{Accuracy} = \frac{\sum_{i=1}^n I(\hat{y}_i = y_i)}{n} ,$$ + +

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

      + + +

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

      +









      + +

      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()
      +
      +

      +









      + +

      Visualization

      + +

      + + +

      # visual representation of grid search
      +# uses seaborn heatmap, you can also do this with matplotlib imshow
      +import seaborn as sns
      +
      +sns.set()
      +
      +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
      +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_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()
      +
      +

      +









      + +

      scikit-learn implementation

      + +

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

      +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()
      +
      +

      +









      + +

      Visualization

      +

      + + +

      # optional
      +# visual representation of grid search
      +# uses seaborn heatmap, could probably do this in matplotlib
      +import seaborn as sns
      +
      +sns.set()
      +
      +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
      +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]
      +        
      +        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()
      +
      +

      +









      + +

      Building neural networks in Tensorflow and Keras

      + +

      +Now we want to build on the experience gained from our neural network implementation in NumPy and scikit-learn +and use it to construct a neural network in Tensorflow. Once we have constructed a neural network in NumPy +and Tensorflow, building one in Keras is really quite trivial, though the performance may suffer. + +

      +In our previous example we used only one hidden layer, and in this we will use two. From this it should be quite +clear how to build one using an arbitrary number of hidden layers, using data structures such as Python lists or +NumPy arrays. + +

      +









      + +

      Tensorflow

      + +

      +Tensorflow is an open source library machine learning library +developed by the Google Brain team for internal use. It was released +under the Apache 2.0 open source license in November 9, 2015. + +

      +Tensorflow is a computational framework that allows you to construct +machine learning models at different levels of abstraction, from +high-level, object-oriented APIs like Keras, down to the C++ kernels +that Tensorflow is built upon. The higher levels of abstraction are +simpler to use, but less flexible, and our choice of implementation +should reflect the problems we are trying to solve. + +

      +Tensorflow uses so-called graphs to represent your computation +in terms of the dependencies between individual operations, such that you first build a Tensorflow graph +to represent your model, and then create a Tensorflow session to run the graph. + +

      +In this guide we will analyze the same data as we did in our NumPy and +scikit-learn tutorial, gathered from the MNIST database of images. We +will give an introduction to the lower level Python Application +Program Interfaces (APIs), and see how we use them to build our graph. +Then we will build (effectively) the same graph in Keras, to see just +how simple solving a machine learning problem can be. + +

      +To install tensorflow on Unix/Linux systems, use pip as +

      + + +

      pip3 install tensorflow
      +
      +

      +and/or if you use anaconda, just write (or install from the graphical user interface) +

      + + +

      conda install tensorflow
      +
      +

      +









      + +

      Collect and pre-process data

      + +

      + + +

      # 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()
      +
      +

      + + +

      from keras.utils import to_categorical
      +from sklearn.model_selection import train_test_split
      +
      +# one-hot representation of labels
      +labels = to_categorical(labels)
      +
      +# split into train and test data
      +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)
      +
      +

      +









      + +

      Using TensorFlow backend

      + +
        +
      1. Define model and architecture
      2. +
      3. Choose cost function and optimizer
      4. +
      + +

      + + +

      import tensorflow as tf
      +
      +class NeuralNetworkTensorflow:
      +    def __init__(
      +            self,
      +            X_train,
      +            Y_train,
      +            X_test,
      +            Y_test,
      +            n_neurons_layer1=100,
      +            n_neurons_layer2=50,
      +            n_categories=2,
      +            epochs=10,
      +            batch_size=100,
      +            eta=0.1,
      +            lmbd=0.0):
      +        
      +        # keep track of number of steps
      +        self.global_step = tf.Variable(0, dtype=tf.int32, trainable=False, name='global_step')
      +        
      +        self.X_train = X_train
      +        self.Y_train = Y_train
      +        self.X_test = X_test
      +        self.Y_test = Y_test
      +        
      +        self.n_inputs = X_train.shape[0]
      +        self.n_features = X_train.shape[1]
      +        self.n_neurons_layer1 = n_neurons_layer1
      +        self.n_neurons_layer2 = n_neurons_layer2
      +        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
      +        
      +        # build network piece by piece
      +        # name scopes (with) are used to enforce creation of new variables
      +        # https://www.tensorflow.org/guide/variables
      +        self.create_placeholders()
      +        self.create_DNN()
      +        self.create_loss()
      +        self.create_optimiser()
      +        self.create_accuracy()
      +    
      +    def create_placeholders(self):
      +        # placeholders are fine here, but "Datasets" are the preferred method
      +        # of streaming data into a model
      +        with tf.name_scope('data'):
      +            self.X = tf.placeholder(tf.float32, shape=(None, self.n_features), name='X_data')
      +            self.Y = tf.placeholder(tf.float32, shape=(None, self.n_categories), name='Y_data')
      +    
      +    def create_DNN(self):
      +        with tf.name_scope('DNN'):
      +            # the weights are stored to calculate regularization loss later
      +            
      +            # Fully connected layer 1
      +            self.W_fc1 = self.weight_variable([self.n_features, self.n_neurons_layer1], name='fc1', dtype=tf.float32)
      +            b_fc1 = self.bias_variable([self.n_neurons_layer1], name='fc1', dtype=tf.float32)
      +            a_fc1 = tf.nn.sigmoid(tf.matmul(self.X, self.W_fc1) + b_fc1)
      +            
      +            # Fully connected layer 2
      +            self.W_fc2 = self.weight_variable([self.n_neurons_layer1, self.n_neurons_layer2], name='fc2', dtype=tf.float32)
      +            b_fc2 = self.bias_variable([self.n_neurons_layer2], name='fc2', dtype=tf.float32)
      +            a_fc2 = tf.nn.sigmoid(tf.matmul(a_fc1, self.W_fc2) + b_fc2)
      +            
      +            # Output layer
      +            self.W_out = self.weight_variable([self.n_neurons_layer2, self.n_categories], name='out', dtype=tf.float32)
      +            b_out = self.bias_variable([self.n_categories], name='out', dtype=tf.float32)
      +            self.z_out = tf.matmul(a_fc2, self.W_out) + b_out
      +    
      +    def create_loss(self):
      +        with tf.name_scope('loss'):
      +            softmax_loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits_v2(labels=self.Y, logits=self.z_out))
      +            
      +            regularizer_loss_fc1 = tf.nn.l2_loss(self.W_fc1)
      +            regularizer_loss_fc2 = tf.nn.l2_loss(self.W_fc2)
      +            regularizer_loss_out = tf.nn.l2_loss(self.W_out)
      +            regularizer_loss = self.lmbd*(regularizer_loss_fc1 + regularizer_loss_fc2 + regularizer_loss_out)
      +            
      +            self.loss = softmax_loss + regularizer_loss
      +
      +    def create_accuracy(self):
      +        with tf.name_scope('accuracy'):
      +            probabilities = tf.nn.softmax(self.z_out)
      +            predictions = tf.argmax(probabilities, axis=1)
      +            labels = tf.argmax(self.Y, axis=1)
      +            
      +            correct_predictions = tf.equal(predictions, labels)
      +            correct_predictions = tf.cast(correct_predictions, tf.float32)
      +            self.accuracy = tf.reduce_mean(correct_predictions)
      +    
      +    def create_optimiser(self):
      +        with tf.name_scope('optimizer'):
      +            self.optimizer = tf.train.GradientDescentOptimizer(learning_rate=self.eta).minimize(self.loss, global_step=self.global_step)
      +            
      +    def weight_variable(self, shape, name='', dtype=tf.float32):
      +        initial = tf.truncated_normal(shape, stddev=0.1)
      +        return tf.Variable(initial, name=name, dtype=dtype)
      +    
      +    def bias_variable(self, shape, name='', dtype=tf.float32):
      +        initial = tf.constant(0.1, shape=shape)
      +        return tf.Variable(initial, name=name, dtype=dtype)
      +    
      +    def fit(self):
      +        data_indices = np.arange(self.n_inputs)
      +
      +        with tf.Session() as sess:
      +            sess.run(tf.global_variables_initializer())
      +            for i in range(self.epochs):
      +                for j in range(self.iterations):
      +                    chosen_datapoints = np.random.choice(data_indices, size=self.batch_size, replace=False)
      +                    batch_X, batch_Y = self.X_train[chosen_datapoints], self.Y_train[chosen_datapoints]
      +            
      +                    sess.run([DNN.loss, DNN.optimizer],
      +                        feed_dict={DNN.X: batch_X,
      +                                   DNN.Y: batch_Y})
      +                    accuracy = sess.run(DNN.accuracy,
      +                        feed_dict={DNN.X: batch_X,
      +                                   DNN.Y: batch_Y})
      +                    step = sess.run(DNN.global_step)
      +    
      +            self.train_loss, self.train_accuracy = sess.run([DNN.loss, DNN.accuracy],
      +                feed_dict={DNN.X: self.X_train,
      +                           DNN.Y: self.Y_train})
      +        
      +            self.test_loss, self.test_accuracy = sess.run([DNN.loss, DNN.accuracy],
      +                feed_dict={DNN.X: self.X_test,
      +                           DNN.Y: self.Y_test})
      +
      +

      +









      + +

      Optimizing and using gradient descent

      + +

      + + +

      epochs = 100
      +batch_size = 100
      +n_neurons_layer1 = 100
      +n_neurons_layer2 = 50
      +n_categories = 10
      +eta_vals = np.logspace(-5, 1, 7)
      +lmbd_vals = np.logspace(-5, 1, 7)
      +
      +

      + + +

      DNN_tf = 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 = NeuralNetworkTensorflow(X_train, Y_train, X_test, Y_test,
      +                                      n_neurons_layer1, n_neurons_layer2, n_categories,
      +                                      epochs=epochs, batch_size=batch_size, eta=eta, lmbd=lmbd)
      +        DNN.fit()
      +        
      +        DNN_tf[i][j] = DNN
      +        
      +        print("Learning rate = ", eta)
      +        print("Lambda = ", lmbd)
      +        print("Test accuracy: %.3f" % DNN.test_accuracy)
      +        print()
      +
      +

      + + +

      # optional
      +# visual representation of grid search
      +# uses seaborn heatmap, could probably do this in matplotlib
      +import seaborn as sns
      +
      +sns.set()
      +
      +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
      +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_tf[i][j]
      +
      +        train_accuracy[i][j] = DNN.train_accuracy
      +        test_accuracy[i][j] = DNN.test_accuracy
      +
      +        
      +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()
      +
      +

      + + +

      # optional
      +# we can use log files to visualize our graph in Tensorboard
      +writer = tf.summary.FileWriter('logs/')
      +writer.add_graph(tf.get_default_graph())
      +
      +

      +









      + +

      Using Keras

      + +

      +Keras is a high level neural network +that supports Tensorflow, CTNK and Theano as backends. +If you have Tensorflow installed Keras is available through the tf.keras module. +If you have Anaconda installed you may run the following command +

      + + +

      conda install keras
      +
      +

      +Alternatively, if you have Tensorflow or one of the other supported backends install you may use the pip package manager: + +

      + + +

      pip3 install keras
      +
      +

      +or look up the instructions here. + +

      + + +

      from keras.models import Sequential
      +from keras.layers import Dense
      +from keras.regularizers import l2
      +from keras.optimizers import SGD
      +
      +def create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories, eta, lmbd):
      +    model = Sequential()
      +    model.add(Dense(n_neurons_layer1, activation='sigmoid', kernel_regularizer=l2(lmbd)))
      +    model.add(Dense(n_neurons_layer2, activation='sigmoid', kernel_regularizer=l2(lmbd)))
      +    model.add(Dense(n_categories, activation='softmax'))
      +    
      +    sgd = SGD(lr=eta)
      +    model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])
      +    
      +    return model
      +
      +

      + + +

      DNN_keras = 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 = create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories,
      +                                         eta=eta, lmbd=lmbd)
      +        DNN.fit(X_train, Y_train, epochs=epochs, batch_size=batch_size, verbose=0)
      +        scores = DNN.evaluate(X_test, Y_test)
      +        
      +        DNN_keras[i][j] = DNN
      +        
      +        print("Learning rate = ", eta)
      +        print("Lambda = ", lmbd)
      +        print("Test accuracy: %.3f" % scores[1])
      +        print()
      +
      +

      + + +

      # optional
      +# visual representation of grid search
      +# uses seaborn heatmap, could probably do this in matplotlib
      +import seaborn as sns
      +
      +sns.set()
      +
      +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
      +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_keras[i][j]
      +
      +        train_accuracy[i][j] = DNN.evaluate(X_train, Y_train)[1]
      +        test_accuracy[i][j] = DNN.evaluate(X_test, Y_test)[1]
      +
      +        
      +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()
      +
      +

      + + +

      Which activation function should I use?

      + +

      +The Back propagation algorithm we derived above works by going from +the output layer to the input layer, propagating the error gradient on +the way. Once the algorithm has computed the gradient of the cost +function with regards to each parameter in the network, it uses these +gradients to update each parameter with a Gradient Descent (GD) step. + +

      +Unfortunately for us, the gradients often get smaller and smaller as the +algorithm progresses down to the first hidden layers. As a result, the +GD update leaves the lower layer connection weights +virtually unchanged, and training never converges to a good +solution. This is known in the literature as +the vanishing gradients problem. + +

      +In other cases, the opposite can happen, namely the the gradients can grow bigger and +bigger. The result is that many of the layers get large updates of the +weights the +algorithm diverges. This is the exploding gradients problem, which is +mostly encountered in recurrent neural networks. More generally, deep +neural networks suffer from unstable gradients, different layers may +learn at widely different speeds + +

      + + +

      Is the Logistic activation function (Sigmoid) our choice?

      + +

      +Although this unfortunate behavior has been empirically observed for +quite a while (it was one of the reasons why deep neural networks were +mostly abandoned for a long time), it is only around 2010 that +significant progress was made in understanding it. + +

      +A paper titled Understanding the Difficulty of Training Deep +Feedforward Neural Networks by Xavier Glorot and Yoshua Bengio found that +the problems with the popular logistic +sigmoid activation function and the weight initialization technique +that was most popular at the time, namely random initialization using +a normal distribution with a mean of 0 and a standard deviation of +1. + +

      +They showed that with this activation function and this +initialization scheme, the variance of the outputs of each layer is +much greater than the variance of its inputs. Going forward in the +network, the variance keeps increasing after each layer until the +activation function saturates at the top layers. This is actually made +worse by the fact that the logistic function has a mean of 0.5, not 0 +(the hyperbolic tangent function has a mean of 0 and behaves slightly +better than the logistic function in deep networks). + +

      +









      + +

      The derivative of the Logistic funtion

      + +

      +Looking at the logistic activation function, when inputs become large +(negative or positive), the function saturates at 0 or 1, with a +derivative extremely close to 0. Thus when backpropagation kicks in, +it has virtually no gradient to propagate back through the network, +and what little gradient exists keeps getting diluted as +backpropagation progresses down through the top layers, so there is +really nothing left for the lower layers. + +

      +In their paper, Glorot and Bengio propose a way to significantly +alleviate this problem. We need the signal to flow properly in both +directions: in the forward direction when making predictions, and in +the reverse direction when backpropagating gradients. We don’t want +the signal to die out, nor do we want it to explode and saturate. For +the signal to flow properly, the authors argue that we need the +variance of the outputs of each layer to be equal to the variance of +its inputs, and we also need the gradients to have equal variance +before and after flowing through a layer in the reverse direction. + +

      +One of the insights in the 2010 paper by Glorot and Bengio was that +the vanishing/exploding gradients problems were in part due to a poor +choice of activation function. Until then most people had assumed that +if Nature had chosen to use roughly sigmoid activation functions in +biological neurons, they must be an excellent choice. But it turns out +that other activation functions behave much better in deep neural +networks, in particular the ReLU activation function, mostly because +it does not saturate for positive values (and also because it is quite +fast to compute). + +

      +









      + +

      The RELU function family

      + +

      +The ReLU activation function suffers from a problem known as the dying +ReLUs: during training, some neurons effectively die, meaning they +stop outputting anything other than 0. + +

      +In some cases, you may find that half of your network’s neurons are +dead, especially if you used a large learning rate. During training, +if a neuron’s weights get updated such that the weighted sum of the +neuron’s inputs is negative, it will start outputting 0. When this +happen, the neuron is unlikely to come back to life since the gradient +of the ReLU function is 0 when its input is negative. + +

      +To solve this problem, nowadays practitioners use a variant of the ReLU +function, such as the leaky ReLU discussed above or the so-called +exponential linear unit (ELU) function + +$$ +ELU(z) = \left\{\begin{array}{cc} \alpha\left( \exp{(z)}-1\right) & z < 0,\\ z & z \ge 0.\end{array}\right. +$$ + +

      +









      + +

      Which activation function should we use?

      + +

      +In general it seems that the ELU activation function is better than +the leaky ReLU function (and its variants), which is better than +ReLU. ReLU performs better than \( \tanh \) which in turn performs better +than the logistic function. + +

      +If runtime +performance is an issue, then you may opt for the leaky ReLU function over the +ELU function If you don’t +want to tweak yet another hyperparameter, you may just use the default +\( \alpha \) of \( 0.01 \) for the leaky ReLU, and \( 1 \) for ELU. If you have +spare time and computing power, you can use cross-validation or +bootstrap to evaluate other activation functions. + +

      + + +

      A top-down perspective on Neural networks

      + +

      +The first thing we would like to do is divide the data into two or three +parts. A training set, a validation or dev (development) set, and a +test set. The test set is the data on which we want to make +predictions. The dev set is a subset of the training data we use to +check how well we are doing out-of-sample, after training the model on +the training dataset. We use the validation error as a proxy for the +test error in order to make tweaks to our model. It is crucial that we +do not use any of the test data to train the algorithm. This is a +cardinal sin in ML. Then: + +

      + +If the validation and test sets are drawn from the same distributions, +then a good performance on the validation set should lead to similarly +good performance on the test set. + +

      +However, sometimes +the training data and test data differ in subtle ways because, for +example, they are collected using slightly different methods, or +because it is cheaper to collect data in one way versus another. In +this case, there can be a mismatch between the training and test +data. This can lead to the neural network overfitting these small +differences between the test and training sets, and a poor performance +on the test set despite having a good performance on the validation +set. To rectify this, Andrew Ng suggests making two validation or dev +sets, one constructed from the training data and one constructed from +the test data. The difference between the performance of the algorithm +on these two validation sets quantifies the train-test mismatch. This +can serve as another important diagnostic when using DNNs for +supervised learning. + +

      +









      + +

      Limitations of supervised learning with deep networks

      + +

      +Like all statistical methods, supervised learning using neural +networks has important limitations. This is especially important when +one seeks to apply these methods, especially to physics problems. Like +all tools, DNNs are not a universal solution. Often, the same or +better performance on a task can be achieved by using a few +hand-engineered features (or even a collection of random +features). + +

      +Here we list some of the important limitations of supervised neural network based models. + +

      + +Some of these remarks are particular to DNNs, others are shared by all supervised learning methods. This motivates the use of unsupervised methods which in part circumvent these problems. + +

      +









      + +

      Convolutional Neural Networks (recognizing images)

      Convolutional neural networks (CNNs) were developed during the last @@ -159,7 +2091,7 @@ Another good read is the article here Regular NNs don’t scale well to full images +

      Regular NNs don’t scale well to full images

      As an example, consider @@ -187,7 +2119,7 @@ would quickly lead to possible overfitting.











      -

      3D volumes of neurons

      +

      3D volumes of neurons

      Convolutional Neural Networks take advantage of the fact that the @@ -227,7 +2159,7 @@ dimension.

      -

      Layers used to build CNNs

      +

      Layers used to build CNNs

      A simple CNN is a sequence of layers, and every layer of a CNN @@ -250,7 +2182,7 @@ A simple CNN for image classification could have the architecture:









      -

      Transforming images

      +

      Transforming images

      CNNs transform the original image layer by layer from the original @@ -269,7 +2201,7 @@ are consistent with the labels in the training set for each image.











      -

      CNNs in brief

      +

      CNNs in brief

      In summary: @@ -290,7 +2222,7 @@ and the slides of









      -

      CNNs in more detail, building convolutional neural networks in Tensorflow and Keras

      +

      CNNs in more detail, building convolutional neural networks in Tensorflow and Keras

      As discussed above, CNNs are neural networks built from the assumption that the inputs @@ -306,7 +2238,7 @@ matrices, typically 1 for each color dimension (Red, Green, Blue).











      -

      Setting it up

      +

      Setting it up

      It means that to represent the entire @@ -318,7 +2250,7 @@ $$











      -

      The MNIST dataset again

      +

      The MNIST dataset again

      The MNIST dataset consists of grayscale images with a pixel size of @@ -336,7 +2268,7 @@ single neuron in the first hidden layer.











      -

      Strong correlations

      +

      Strong correlations

      Images typically have strong local correlations, meaning that a small part of the image varies little from its neighboring regions. If for example we have an image of a blue car, we can roughly assume that a @@ -352,7 +2284,7 @@ fixed, and known as a
      -

      Layers of a CNN

      +

      Layers of a CNN

      The layers of a convolutional neural network arrange neurons in 3D: width, height and depth. The input image is typically a square matrix of depth 3. @@ -374,7 +2306,7 @@ layer.











      -

      Systematic reduction

      +

      Systematic reduction

      By systematically reducing the size of the input volume, through @@ -389,7 +2321,7 @@ classification.











      -

      Prerequisites: Collect and pre-process data

      +

      Prerequisites: Collect and pre-process data

      @@ -418,8 +2350,8 @@ labels = digits # our images are grayscale so they should have a depth of 1 inputs = inputs[:,:,:,np.newaxis] -print("inputs = (n_inputs, pixel_width, pixel_height, depth) = " + str(inputs.shape)) -print("labels = (n_inputs) = " + str(labels.shape)) +print("inputs = (n_inputs, pixel_width, pixel_height, depth) = " + str(inputs.shape)) +print("labels = (n_inputs) = " + str(labels.shape)) # choose some random images to display @@ -437,7 +2369,7 @@ plt.show()











      -

      Importing Keras and Tensorflow

      +

      Importing Keras and Tensorflow

      @@ -457,7 +2389,7 @@ X_train, X_test, Y_train, Y_test = train_tes











      -

      Using TensorFlow backend

      +

      Using TensorFlow backend

      We need to define model and architecture and choose cost function and optmizer. @@ -605,7 +2537,7 @@ class ConvolutionalNeuralNetworkTensorflow:











      -

      Train the model

      +

      Train the model

      We need now to train the model, evaluate it and test its performance on test data, and eventually include hyperparameters. @@ -630,17 +2562,17 @@ CNN_tf = np.=eta, lmbd=lmbd) CNN.fit() - print("Learning rate = ", eta) - print("Lambda = ", lmbd) - print("Test accuracy: %.3f" % CNN.test_accuracy) - print() + print("Learning rate = ", eta) + print("Lambda = ", lmbd) + print("Test accuracy: %.3f" % CNN.test_accuracy) + print() CNN_tf[i][j] = CNN











      -

      Visualizing the results

      +

      Visualizing the results

      @@ -663,14 +2595,14 @@ test_accuracy = np= plt.subplots(figsize = (10, 10)) -sns.heatmap(train_accuracy, annot=True, ax=ax, cmap="viridis") +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") +sns.heatmap(test_accuracy, annot=True, ax=ax, cmap="viridis") ax.set_title("Test Accuracy") ax.set_ylabel("$\eta$") ax.set_xlabel("$\lambda$") @@ -679,7 +2611,7 @@ plt.show()

      -

      Running with Keras

      +

      Running with Keras

      @@ -722,7 +2654,7 @@ lmbd_vals = np.











      -

      Final part

      +

      Final part

      @@ -739,15 +2671,15 @@ lmbd_vals = np. CNN_keras[i][j] = CNN - print("Learning rate = ", eta) - print("Lambda = ", lmbd) - print("Test accuracy: %.3f" % scores[1]) - print() + print("Learning rate = ", eta) + print("Lambda = ", lmbd) + print("Test accuracy: %.3f" % scores[1]) + print()











      -

      Final visualization

      +

      Final visualization

      @@ -786,7 +2718,7 @@ plt.show()











      -

      Fun links

      +

      Fun links

      1. Self-Driving cars using a convolutional neural network
      2. diff --git a/doc/pub/week41/ipynb/ipynb-week41-src.tar.gz b/doc/pub/week41/ipynb/ipynb-week41-src.tar.gz index c6f20f9c738dca7304ca13c092f8dc528fd4c0a2..6b1ffac99524e3618d35e9ee23363c86ea5c16e9 100644 GIT binary patch literal 87344 zcmV(pK=8jGiwFSqfqP#71Jt_*SX0frFS?KtI?_8qK|zsTr6i&PA_Ag95Rj;#Gy&-W z0ztY|6_HOAP(W!y1StX`NDW0nihv*`0i;7h4Ulr;x6j`D|G($#bI;lL-1FQ!$vkV; zvu3?(-Zk&M@9#IW=DvqpzylB0djYCGJ}RCM@3{g0`;(fQnvRy1?4P5qj`rV2HI08c zXA~IM)YWCxHFY)BwY0U>)OBUm)V0+$)Bstv{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CZeq4;BLVVi=rHb;8c-dU~12HkNj>E3hV?T+@XC(%>FOyl+o z6C}sBV1C?%e7hnS6!W{{`5!j|bxQ_rFQ?7Eq~n@>dF}a$UV&t*hYyc$3qb`O<2(C< zM@{U1mDTx81;LKq9ce~Ym!3c{rx#eP72wfj+X?v%>MP&o12j>mR&I0Kr8tekl=GdK z0#HxiITqAxZuxk-ijN8?4IbnLeQ@(iG+)a2{;60)bkd5ezs3TRp*J7oS39-y=#Rmx z{+9;-pN}&N|2;9jxBbuaN)49YuqFykA33V~)~M6i!SW6RX=9S3g>8HQ8A}59ZZ!Ri zEEj9lTXNbp&eh1% z<{cLUYCq>fhgxY|(Zlc^xjQW1Weww8dOk*%@E98hB_RHHy~o0eK73>0rA4*d-2d97 z`@i!zQF*05KJnwoOU5s^81`g-u^fvKuO&|phq>OhORaqoLIhxE_A{>0_QBDwRoJLw zmE}qSUQ++S_3!1d5CZkE1qsl+wF`!8M?RmQMWRlkiWJC#nJET>DSA#L|C1$&|JNO$ z|KIL4@fUyb7k}{=fAJT8@fUyb7k}{=fAJT8@fUyb7k}{=fAJT8@fUyb7k}{=|LgF7 M0K=Q!3jmM-02yDoJ^%m! diff --git a/doc/pub/week41/ipynb/week41.ipynb b/doc/pub/week41/ipynb/week41.ipynb index 8230ccc2a..335842002 100644 --- a/doc/pub/week41/ipynb/week41.ipynb +++ b/doc/pub/week41/ipynb/week41.ipynb @@ -10,13 +10,2115 @@ " \n", "**Morten Hjorth-Jensen**, Department of Physics, University of Oslo and Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University\n", "\n", - "Date: **Sep 16, 2020**\n", + "Date: **Oct 5, 2020**\n", "\n", "Copyright 1999-2020, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license\n", "\n", "\n", "\n", "\n", + "## Plan for week 40\n", + "\n", + "* Thursday: Building our own Feed-forward Neural Network\n", + "\n", + "* Friday: Playing around with our own Feed-forward Neural Network and introduction to TensorFlow. Start convolutional Neural Networks.\n", + "\n", + "Reading suggestions for both days: [Aurelien Geron's chapters 10-11](https://github.com/CompPhysics/MachineLearning/blob/master/doc/T\\\n", + "extbooks/TensorflowML.pdf) and Hastie et al chapter 11.\n", + "\n", + "## Overview video for week 41\n", + "\n", + "\"Overview Video, from Stochastic Gradient methods to Neural Networks\":\"https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h20\\\n", + "/forelesningsvideoer/OverviewWeek41.mp4?vrtx=view-as-webpage\"\n", + "\n", + "\n", + "## Setting up the Back propagation algorithm\n", + "\n", + "\n", + "\n", + "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.\n", + "\n", + "First, we set up the input data $\\hat{x}$ and the activations\n", + "$\\hat{z}_1$ of the input layer and compute the activation function and\n", + "the pertinent outputs $\\hat{a}^1$.\n", + "\n", + "\n", + "\n", + "Secondly, we perform then the feed forward till we reach the output\n", + "layer and compute all $\\hat{z}_l$ of the input layer and compute the\n", + "activation function and the pertinent outputs $\\hat{a}^l$ for\n", + "$l=2,3,\\dots,L$.\n", + "\n", + "\n", + "\n", + "Thereafter we compute the ouput error $\\hat{\\delta}^L$ by computing all" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\delta_j^L = f'(z_j^L)\\frac{\\partial {\\cal C}}{\\partial (a_j^L)}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Then we compute the back propagate error for each $l=L-1,L-2,\\dots,2$ as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\delta_j^l = \\sum_k \\delta_k^{l+1}w_{kj}^{l+1}f'(z_j^l).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "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" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "w_{jk}^l\\leftarrow = w_{jk}^l- \\eta \\delta_j^la_k^{l-1},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "b_j^l \\leftarrow b_j^l-\\eta \\frac{\\partial {\\cal C}}{\\partial b_j^l}=b_j^l-\\eta \\delta_j^l,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The parameter $\\eta$ is the learning parameter discussed in connection with the gradient descent methods.\n", + "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.\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "## Setting up a Multi-layer perceptron model for classification\n", + "\n", + "We are now gong to develop an example based on the MNIST data\n", + "base. This is a classification problem and we need to use our\n", + "cross-entropy function we discussed in connection with logistic\n", + "regression. The cross-entropy defines our cost function for the\n", + "classificaton problems with neural networks.\n", + "\n", + "In binary classification with two classes $(0, 1)$ we define the\n", + "logistic/sigmoid function as the probability that a particular input\n", + "is in class $0$ or $1$. This is possible because the logistic\n", + "function takes any input from the real numbers and inputs a number\n", + "between 0 and 1, and can therefore be interpreted as a probability. It\n", + "also has other nice properties, such as a derivative that is simple to\n", + "calculate.\n", + "\n", + "For an input $\\boldsymbol{a}$ from the hidden layer, the probability that the input $\\boldsymbol{x}$\n", + "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$\n", + "represents our activation values $z$. We have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "P(y = 0 \\mid \\hat{x}, \\hat{\\theta}) = \\frac{1}{1 + \\exp{(- \\hat{x}})} ,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "P(y = 1 \\mid \\hat{x}, \\hat{\\theta}) = 1 - P(y = 0 \\mid \\hat{x}, \\hat{\\theta}) ,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $y \\in \\{0, 1\\}$ and $\\hat{\\theta}$ represents the weights and biases\n", + "of our network.\n", + "\n", + "\n", + "## Defining the cost function\n", + "\n", + "Our cost function is given as (see the Logistic regression lectures)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mathcal{C}(\\hat{\\theta}) = - \\ln P(\\mathcal{D} \\mid \\hat{\\theta}) = - \\sum_{i=1}^n\n", + "y_i \\ln[P(y_i = 0)] + (1 - y_i) \\ln [1 - P(y_i = 0)] = \\sum_{i=1}^n \\mathcal{L}_i(\\hat{\\theta}) .\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This last equality means that we can interpret our *cost* function as a sum over the *loss* function\n", + "for each point in the dataset $\\mathcal{L}_i(\\hat{\\theta})$. \n", + "The negative sign is just so that we can think about our algorithm as minimizing a positive number, rather\n", + "than maximizing a negative number. \n", + "\n", + "In *multiclass* classification it is common to treat each integer label as a so called *one-hot* vector: \n", + "\n", + "$y = 5 \\quad \\rightarrow \\quad \\hat{y} = (0, 0, 0, 0, 0, 1, 0, 0, 0, 0) ,$ and\n", + "\n", + "\n", + "$y = 1 \\quad \\rightarrow \\quad \\hat{y} = (0, 1, 0, 0, 0, 0, 0, 0, 0, 0) ,$ \n", + "\n", + "\n", + "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$).. \n", + "\n", + "If $\\hat{x}_i$ is the $i$-th input (image), $y_{ic}$ refers to the $c$-th component of the $i$-th\n", + "output vector $\\hat{y}_i$. \n", + "The probability of $\\hat{x}_i$ being in class $c$ will be given by the softmax function:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "P(y_{ic} = 1 \\mid \\hat{x}_i, \\hat{\\theta}) = \\frac{\\exp{((\\hat{a}_i^{hidden})^T \\hat{w}_c)}}\n", + "{\\sum_{c'=0}^{C-1} \\exp{((\\hat{a}_i^{hidden})^T \\hat{w}_{c'})}} ,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which reduces to the logistic function in the binary case. \n", + "The likelihood of this $C$-class classifier\n", + "is now given as:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "P(\\mathcal{D} \\mid \\hat{\\theta}) = \\prod_{i=1}^n \\prod_{c=0}^{C-1} [P(y_{ic} = 1)]^{y_{ic}} .\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Again we take the negative log-likelihood to define our cost function:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mathcal{C}(\\hat{\\theta}) = - \\log{P(\\mathcal{D} \\mid \\hat{\\theta})}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "See the logistic regression lectures for a full definition of the cost function.\n", + "\n", + "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!\n", + "\n", + "## Example: binary classification problem\n", + "\n", + "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" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mathcal{C}(\\hat{\\beta}) = - \\sum_{i=1}^n \\left(y_i\\log{p(y_i \\vert x_i,\\hat{\\beta})}+(1-y_i)\\log{1-p(y_i \\vert x_i,\\hat{\\beta})}\\right),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where we had defined the logistic (sigmoid) function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "p(y_i =1\\vert x_i,\\hat{\\beta})=\\frac{\\exp{(\\beta_0+\\beta_1 x_i)}}{1+\\exp{(\\beta_0+\\beta_1 x_i)}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "p(y_i =0\\vert x_i,\\hat{\\beta})=1-p(y_i =1\\vert x_i,\\hat{\\beta}).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The parameters $\\hat{\\beta}$ were defined using a minimization method like gradient descent or Newton-Raphson's method. \n", + "\n", + "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$. \n", + "We have then" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "a_i^l = y_i = \\frac{\\exp{(z_i^l)}}{1+\\exp{(z_i^l)}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "with" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "z_i^l = \\sum_{j}w_{ij}^l a_j^{l-1}+b_i^l,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where the superscript $l-1$ indicates that these are the outputs from layer $l-1$.\n", + "Our cost function at the final layer $l=L$ is now" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mathcal{C}(\\hat{W}) = - \\sum_{i=1}^n \\left(t_i\\log{a_i^L}+(1-t_i)\\log{(1-a_i^L)}\\right),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "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" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial \\mathcal{C}(\\hat{W})}{\\partial a_i^L} = \\frac{a_i^L-t_i}{a_i^L(1-a_i^L)}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In case we use another activation function than the logistic one, we need to evaluate other derivatives. \n", + "\n", + "\n", + "## The Softmax function\n", + "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" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial f(z_i^l)}{\\partial w_{jk}^l} =\n", + "\\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}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For the Softmax function we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "f(z_i^l) = \\frac{\\exp{(z_i^l)}}{\\sum_{m=1}^K\\exp{(z_m^l)}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Its derivative with respect to $z_j^l$ gives" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial f(z_i^l)}{\\partial z_j^l}= f(z_i^l)\\left(\\delta_{ij}-f(z_j^l)\\right),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which in case of the simply binary model reduces to having $i=j$. \n", + "\n", + "\n", + "## Developing a code for doing neural networks with back propagation\n", + "\n", + "\n", + "One can identify a set of key steps when using neural networks to solve supervised learning problems: \n", + "\n", + "1. Collect and pre-process data \n", + "\n", + "2. Define model and architecture \n", + "\n", + "3. Choose cost function and optimizer \n", + "\n", + "4. Train the model \n", + "\n", + "5. Evaluate model performance on test data \n", + "\n", + "6. Adjust hyperparameters (if necessary, network architecture)\n", + "\n", + "## Collect and pre-process data\n", + "\n", + "Here we will be using the MNIST dataset, which is readily available through the **scikit-learn**\n", + "package. You may also find it for example [here](http://yann.lecun.com/exdb/mnist/). \n", + "The *MNIST* (Modified National Institute of Standards and Technology) database is a large database\n", + "of handwritten digits that is commonly used for training various image processing systems. \n", + "The MNIST dataset consists of 70 000 images of size $28\\times 28$ pixels, each labeled from 0 to 9. \n", + "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. \n", + "\n", + "To feed data into a feed-forward neural network we need to represent\n", + "the inputs as a design/feature matrix $X = (n_{inputs}, n_{features})$. Each\n", + "row represents an *input*, in this case a handwritten digit, and\n", + "each column represents a *feature*, in this case a pixel. The\n", + "correct answers, also known as *labels* or *targets* are\n", + "represented as a 1D array of integers \n", + "$Y = (n_{inputs}) = (5, 3, 1, 8,...)$.\n", + "\n", + "As an example, say we want to build a neural network using supervised learning to predict Body-Mass Index (BMI) from\n", + "measurements of height (in m) \n", + "and weight (in kg). If we have measurements of 5 people the design/feature matrix could be for example: \n", + "\n", + "$$ X = \\begin{bmatrix}\n", + "1.85 & 81\\\\\n", + "1.71 & 65\\\\\n", + "1.95 & 103\\\\\n", + "1.55 & 42\\\\\n", + "1.63 & 56\n", + "\\end{bmatrix} ,$$ \n", + "\n", + "and the targets would be: \n", + "\n", + "$$ Y = (23.7, 22.2, 27.1, 17.5, 21.1) $$ \n", + "\n", + "Since each input image is a 2D matrix, we need to flatten the image\n", + "(i.e. \"unravel\" the 2D matrix into a 1D array) to turn the data into a\n", + "design/feature matrix. This means we lose all spatial information in the\n", + "image, such as locality and translational invariance. More complicated\n", + "architectures such as Convolutional Neural Networks can take advantage\n", + "of such information, and are most commonly applied when analyzing\n", + "images." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%matplotlib inline\n", + "\n", + "# import necessary packages\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from sklearn import datasets\n", + "\n", + "\n", + "# ensure the same random numbers appear every time\n", + "np.random.seed(0)\n", + "\n", + "# display images in notebook\n", + "%matplotlib inline\n", + "plt.rcParams['figure.figsize'] = (12,12)\n", + "\n", + "\n", + "# download MNIST dataset\n", + "digits = datasets.load_digits()\n", + "\n", + "# define inputs and labels\n", + "inputs = digits.images\n", + "labels = digits.target\n", + "\n", + "print(\"inputs = (n_inputs, pixel_width, pixel_height) = \" + str(inputs.shape))\n", + "print(\"labels = (n_inputs) = \" + str(labels.shape))\n", + "\n", + "\n", + "# flatten the image\n", + "# the value -1 means dimension is inferred from the remaining dimensions: 8x8 = 64\n", + "n_inputs = len(inputs)\n", + "inputs = inputs.reshape(n_inputs, -1)\n", + "print(\"X = (n_inputs, n_features) = \" + str(inputs.shape))\n", + "\n", + "\n", + "# choose some random images to display\n", + "indices = np.arange(n_inputs)\n", + "random_indices = np.random.choice(indices, size=5)\n", + "\n", + "for i, image in enumerate(digits.images[random_indices]):\n", + " plt.subplot(1, 5, i+1)\n", + " plt.axis('off')\n", + " plt.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest')\n", + " plt.title(\"Label: %d\" % digits.target[random_indices[i]])\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train and test datasets\n", + "\n", + "Performing analysis before partitioning the dataset is a major error, that can lead to incorrect conclusions. \n", + "\n", + "We will reserve $80 \\%$ of our dataset for training and $20 \\%$ for testing. \n", + "\n", + "It is important that the train and test datasets are drawn randomly from our dataset, to ensure\n", + "no bias in the sampling. \n", + "Say you are taking measurements of weather data to predict the weather in the coming 5 days.\n", + "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\n", + "collected from 12.00 to 24.00." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from sklearn.model_selection import train_test_split\n", + "\n", + "# one-liner from scikit-learn library\n", + "train_size = 0.8\n", + "test_size = 1 - train_size\n", + "X_train, X_test, Y_train, Y_test = train_test_split(inputs, labels, train_size=train_size,\n", + " test_size=test_size)\n", + "\n", + "# equivalently in numpy\n", + "def train_test_split_numpy(inputs, labels, train_size, test_size):\n", + " n_inputs = len(inputs)\n", + " inputs_shuffled = inputs.copy()\n", + " labels_shuffled = labels.copy()\n", + " \n", + " np.random.shuffle(inputs_shuffled)\n", + " np.random.shuffle(labels_shuffled)\n", + " \n", + " train_end = int(n_inputs*train_size)\n", + " X_train, X_test = inputs_shuffled[:train_end], inputs_shuffled[train_end:]\n", + " Y_train, Y_test = labels_shuffled[:train_end], labels_shuffled[train_end:]\n", + " \n", + " return X_train, X_test, Y_train, Y_test\n", + "\n", + "#X_train, X_test, Y_train, Y_test = train_test_split_numpy(inputs, labels, train_size, test_size)\n", + "\n", + "print(\"Number of training images: \" + str(len(X_train)))\n", + "print(\"Number of test images: \" + str(len(X_test)))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Define model and architecture\n", + "\n", + "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 \n", + "\n", + "$$ z = \\sum_{i=1}^n w_i a_i ,$$\n", + "\n", + "$$ y = f(z) ,$$\n", + "\n", + "where $f$ is the activation function, $a_i$ represents input from neuron $i$ in the preceding layer\n", + "and $w_i$ is the weight to input $i$. \n", + "The activation of the neurons in the input layer is just the features (e.g. a pixel value). \n", + "\n", + "The simplest activation function for a neuron is the *Heaviside* function:\n", + "\n", + "$$ f(z) = \n", + "\\begin{cases}\n", + "1, & z > 0\\\\\n", + "0, & \\text{otherwise}\n", + "\\end{cases}\n", + "$$\n", + "\n", + "A feed-forward neural network with this activation is known as a *perceptron*. \n", + "For a binary classifier (i.e. two classes, 0 or 1, dog or not-dog) we can also use this in our output layer. \n", + "This activation can be generalized to $k$ classes (using e.g. the *one-against-all* strategy), \n", + "and we call these architectures *multiclass perceptrons*. \n", + "\n", + "However, it is now common to use the terms Single Layer Perceptron (SLP) (1 hidden layer) and \n", + "Multilayer Perceptron (MLP) (2 or more hidden layers) to refer to feed-forward neural networks with any activation function. \n", + "\n", + "Typical choices for activation functions include the sigmoid function, hyperbolic tangent, and Rectified Linear Unit (ReLU). \n", + "We will be using the sigmoid function $\\sigma(x)$: \n", + "\n", + "$$ f(x) = \\sigma(x) = \\frac{1}{1 + e^{-x}} ,$$\n", + "\n", + "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.\n", + "\n", + "\n", + "## Layers\n", + "\n", + "* Input \n", + "\n", + "Since each input image has 8x8 = 64 pixels or features, we have an input layer of 64 neurons. \n", + "\n", + "* Hidden layer\n", + "\n", + "We will use 50 neurons in the hidden layer receiving input from the neurons in the input layer. \n", + "Since each neuron in the hidden layer is connected to the 64 inputs we have 64x50 = 3200 weights to the hidden layer. \n", + "\n", + "* Output\n", + "\n", + "If we were building a binary classifier, it would be sufficient with a single neuron in the output layer,\n", + "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. \n", + "\n", + "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. \n", + "\n", + "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: \n", + "\n", + "$$ P(\\text{class $j$} \\mid \\text{input $\\hat{a}$}) = \\frac{\\exp{(\\hat{a}^T \\hat{w}_j)}}\n", + "{\\sum_{c=0}^{9} \\exp{(\\hat{a}^T \\hat{w}_c)}} ,$$ \n", + "\n", + "i.e. each neuron $j$ outputs the probability of being in class $j$ given an input from the hidden layer $\\hat{a}$, with $\\hat{w}_j$ the weights of neuron $j$ to the inputs. \n", + "The denominator is a normalization factor to ensure the outputs (probabilities) sum up to 1. \n", + "The exponent is just the weighted sum of inputs as before: \n", + "\n", + "$$ z_j = \\sum_{i=1}^n w_ {ij} a_i+b_j.$$ \n", + "\n", + "Since each neuron in the output layer is connected to the 50 inputs from the hidden layer we have 50x10 = 500\n", + "weights to the output layer.\n", + "\n", + "\n", + "## Weights and biases\n", + "\n", + "Typically weights are initialized with small values distributed around zero, drawn from a uniform\n", + "or normal distribution. Setting all weights to zero means all neurons give the same output, making the network useless. \n", + "\n", + "Adding a bias value to the weighted sum of inputs allows the neural network to represent a greater range\n", + "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$: \n", + "\n", + "$$ z_j = \\sum_{i=1}^n w_ {ij} a_i + b_j.$$ \n", + "\n", + "The bias weights $\\hat{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." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# building our neural network\n", + "\n", + "n_inputs, n_features = X_train.shape\n", + "n_hidden_neurons = 50\n", + "n_categories = 10\n", + "\n", + "# we make the weights normally distributed using numpy.random.randn\n", + "\n", + "# weights and bias in the hidden layer\n", + "hidden_weights = np.random.randn(n_features, n_hidden_neurons)\n", + "hidden_bias = np.zeros(n_hidden_neurons) + 0.01\n", + "\n", + "# weights and bias in the output layer\n", + "output_weights = np.random.randn(n_hidden_neurons, n_categories)\n", + "output_bias = np.zeros(n_categories) + 0.01" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Feed-forward pass\n", + "\n", + "Denote $F$ the number of features, $H$ the number of hidden neurons and $C$ the number of categories. \n", + "For each input image we calculate a weighted sum of input features (pixel values) to each neuron $j$ in the hidden layer $l$: \n", + "\n", + "$$ z_{j}^{l} = \\sum_{i=1}^{F} w_{ij}^{l} x_i + b_{j}^{l},$$\n", + "\n", + "this is then passed through our activation function \n", + "\n", + "$$ a_{j}^{l} = f(z_{j}^{l}) .$$ \n", + "\n", + "We calculate a weighted sum of inputs (activations in the hidden layer) to each neuron $j$ in the output layer: \n", + "\n", + "$$ z_{j}^{L} = \\sum_{i=1}^{H} w_{ij}^{L} a_{i}^{l} + b_{j}^{L}.$$ \n", + "\n", + "Finally we calculate the output of neuron $j$ in the output layer using the softmax function: \n", + "\n", + "$$ a_{j}^{L} = \\frac{\\exp{(z_j^{L})}}\n", + "{\\sum_{c=0}^{C-1} \\exp{(z_c^{L})}} .$$ \n", + "\n", + "\n", + "## Matrix multiplications\n", + "\n", + "Since our data has the dimensions $X = (n_{inputs}, n_{features})$ and our weights to the hidden\n", + "layer have the dimensions \n", + "$W_{hidden} = (n_{features}, n_{hidden})$,\n", + "we can easily feed the network all our training data in one go by taking the matrix product \n", + "\n", + "$$ X W^{h} = (n_{inputs}, n_{hidden}),$$ \n", + "\n", + "and obtain a matrix that holds the weighted sum of inputs to the hidden layer\n", + "for each input image and each hidden neuron. \n", + "We also add the bias to obtain a matrix of weighted sums to the hidden layer $Z^{h}$: \n", + "\n", + "$$ \\hat{z}^{l} = \\hat{X} \\hat{W}^{l} + \\hat{b}^{l} ,$$\n", + "\n", + "meaning the same bias (1D array with size equal number of hidden neurons) is added to each input image. \n", + "This is then passed through the activation: \n", + "\n", + "$$ \\hat{a}^{l} = f(\\hat{z}^l) .$$ \n", + "\n", + "This is fed to the output layer: \n", + "\n", + "$$ \\hat{z}^{L} = \\hat{a}^{L} \\hat{W}^{L} + \\hat{b}^{L} .$$\n", + "\n", + "Finally we receive our output values for each image and each category by passing it through the softmax function: \n", + "\n", + "$$ output = softmax (\\hat{z}^{L}) = (n_{inputs}, n_{categories}) .$$" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# setup the feed-forward pass, subscript h = hidden layer\n", + "\n", + "def sigmoid(x):\n", + " return 1/(1 + np.exp(-x))\n", + "\n", + "def feed_forward(X):\n", + " # weighted sum of inputs to the hidden layer\n", + " z_h = np.matmul(X, hidden_weights) + hidden_bias\n", + " # activation in the hidden layer\n", + " a_h = sigmoid(z_h)\n", + " \n", + " # weighted sum of inputs to the output layer\n", + " z_o = np.matmul(a_h, output_weights) + output_bias\n", + " # softmax output\n", + " # axis 0 holds each input and axis 1 the probabilities of each category\n", + " exp_term = np.exp(z_o)\n", + " probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)\n", + " \n", + " return probabilities\n", + "\n", + "probabilities = feed_forward(X_train)\n", + "print(\"probabilities = (n_inputs, n_categories) = \" + str(probabilities.shape))\n", + "print(\"probability that image 0 is in category 0,1,2,...,9 = \\n\" + str(probabilities[0]))\n", + "print(\"probabilities sum up to: \" + str(probabilities[0].sum()))\n", + "print()\n", + "\n", + "# we obtain a prediction by taking the class with the highest likelihood\n", + "def predict(X):\n", + " probabilities = feed_forward(X)\n", + " return np.argmax(probabilities, axis=1)\n", + "\n", + "predictions = predict(X_train)\n", + "print(\"predictions = (n_inputs) = \" + str(predictions.shape))\n", + "print(\"prediction for image 0: \" + str(predictions[0]))\n", + "print(\"correct label for image 0: \" + str(Y_train[0]))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Choose cost function and optimizer\n", + "\n", + "To measure how well our neural network is doing we need to introduce a cost function. \n", + "We will call the function that gives the error of a single sample output the *loss* function, and the function\n", + "that gives the total error of our network across all samples the *cost* function.\n", + "A typical choice for multiclass classification is the *cross-entropy* loss, also known as the negative log likelihood. \n", + "\n", + "In *multiclass* classification it is common to treat each integer label as a so called *one-hot* vector: \n", + "\n", + "$$ y = 5 \\quad \\rightarrow \\quad \\hat{y} = (0, 0, 0, 0, 0, 1, 0, 0, 0, 0) ,$$ \n", + "\n", + "\n", + "$$ y = 1 \\quad \\rightarrow \\quad \\hat{y} = (0, 1, 0, 0, 0, 0, 0, 0, 0, 0) ,$$ \n", + "\n", + "\n", + "i.e. a binary bit string of length $C$, where $C = 10$ is the number of classes in the MNIST dataset. \n", + "\n", + "Let $y_{ic}$ denote the $c$-th component of the $i$-th one-hot vector. \n", + "We define the cost function $\\mathcal{C}$ as a sum over the cross-entropy loss for each point $\\hat{x}_i$ in the dataset.\n", + "\n", + "In the one-hot representation only one of the terms in the loss function is non-zero, namely the\n", + "probability of the correct category $c'$ \n", + "(i.e. the category $c'$ such that $y_{ic'} = 1$). This means that the cross entropy loss only punishes you for how wrong\n", + "you got the correct label. The probability of category $c$ is given by the softmax function. The vector $\\hat{\\theta}$ represents the parameters of our network, i.e. all the weights and biases. \n", + "\n", + "\n", + "## Optimizing the cost function\n", + "\n", + "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\n", + "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. \n", + "Each parameter $\\theta$ is iteratively adjusted according to the rule \n", + "\n", + "$$ \\theta_{i+1} = \\theta_i - \\eta \\nabla \\mathcal{C}(\\theta_i) ,$$\n", + "\n", + "where $\\eta$ is known as the *learning rate*, which controls how big a step we take towards the minimum. \n", + "This update can be repeated for any number of iterations, or until we are satisfied with the result. \n", + "\n", + "A simple and effective improvement is a variant called *Batch Gradient Descent*. \n", + "Instead of calculating the gradient on the whole dataset, we calculate an approximation of the gradient\n", + "on a subset of the data called a *minibatch*. \n", + "If there are $N$ data points and we have a minibatch size of $M$, the total number of batches\n", + "is $N/M$. \n", + "We denote each minibatch $B_k$, with $k = 1, 2,...,N/M$. The gradient then becomes: \n", + "\n", + "$$ \\nabla \\mathcal{C}(\\theta) = \\frac{1}{N} \\sum_{i=1}^N \\nabla \\mathcal{L}_i(\\theta) \\quad \\rightarrow \\quad\n", + "\\frac{1}{M} \\sum_{i \\in B_k} \\nabla \\mathcal{L}_i(\\theta) ,$$\n", + "\n", + "i.e. instead of averaging the loss over the entire dataset, we average over a minibatch. \n", + "\n", + "This has two important benefits: \n", + "1. Introducing stochasticity decreases the chance that the algorithm becomes stuck in a local minima. \n", + "\n", + "2. It significantly speeds up the calculation, since we do not have to use the entire dataset to calculate the gradient. \n", + "\n", + "The various optmization methods, with codes and algorithms, are discussed in our lectures on [Gradient descent approaches](https://compphysics.github.io/MachineLearning/doc/pub/Splines/html/Splines-bs.html).\n", + "\n", + "\n", + "## Regularization\n", + "\n", + "It is common to add an extra term to the cost function, proportional\n", + "to the size of the weights. This is equivalent to constraining the\n", + "size of the weights, so that they do not grow out of control.\n", + "Constraining the size of the weights means that the weights cannot\n", + "grow arbitrarily large to fit the training data, and in this way\n", + "reduces *overfitting*.\n", + "\n", + "We will measure the size of the weights using the so called *L2-norm*, meaning our cost function becomes: \n", + "\n", + "$$ \\mathcal{C}(\\theta) = \\frac{1}{N} \\sum_{i=1}^N \\mathcal{L}_i(\\theta) \\quad \\rightarrow \\quad\n", + "\\frac{1}{N} \\sum_{i=1}^N \\mathcal{L}_i(\\theta) + \\lambda \\lvert \\lvert \\hat{w} \\rvert \\rvert_2^2 \n", + "= \\frac{1}{N} \\sum_{i=1}^N \\mathcal{L}(\\theta) + \\lambda \\sum_{ij} w_{ij}^2,$$ \n", + "\n", + "i.e. we sum up all the weights squared. The factor $\\lambda$ is known as a regularization parameter.\n", + "\n", + "\n", + "In order to train the model, we need to calculate the derivative of\n", + "the cost function with respect to every bias and weight in the\n", + "network. In total our network has $(64 + 1)\\times 50=3250$ weights in\n", + "the hidden layer and $(50 + 1)\\times 10=510$ weights to the output\n", + "layer ($+1$ for the bias), and the gradient must be calculated for\n", + "every parameter. We use the *backpropagation* algorithm discussed\n", + "above. This is a clever use of the chain rule that allows us to\n", + "calculate the gradient efficently. \n", + "\n", + "\n", + "## Matrix multiplication\n", + "\n", + "To more efficently train our network these equations are implemented using matrix operations. \n", + "The error in the output layer is calculated simply as, with $\\hat{t}$ being our targets, \n", + "\n", + "$$ \\delta_L = \\hat{t} - \\hat{y} = (n_{inputs}, n_{categories}) .$$ \n", + "\n", + "The gradient for the output weights is calculated as \n", + "\n", + "$$ \\nabla W_{L} = \\hat{a}^T \\delta_L = (n_{hidden}, n_{categories}) ,$$\n", + "\n", + "where $\\hat{a} = (n_{inputs}, n_{hidden})$. This simply means that we are summing up the gradients for each input. \n", + "Since we are going backwards we have to transpose the activation matrix. \n", + "\n", + "The gradient with respect to the output bias is then \n", + "\n", + "$$ \\nabla \\hat{b}_{L} = \\sum_{i=1}^{n_{inputs}} \\delta_L = (n_{categories}) .$$ \n", + "\n", + "The error in the hidden layer is \n", + "\n", + "$$ \\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}) ,$$ \n", + "\n", + "where $f'(a_{h})$ is the derivative of the activation in the hidden layer. The matrix products mean\n", + "that we are summing up the products for each neuron in the output layer. The symbol $\\circ$ denotes\n", + "the *Hadamard product*, meaning element-wise multiplication. \n", + "\n", + "This again gives us the gradients in the hidden layer: \n", + "\n", + "$$ \\nabla W_{h} = X^T \\delta_h = (n_{features}, n_{hidden}) ,$$ \n", + "\n", + "$$ \\nabla b_{h} = \\sum_{i=1}^{n_{inputs}} \\delta_h = (n_{hidden}) .$$" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# to categorical turns our integer vector into a onehot representation\n", + "from sklearn.metrics import accuracy_score\n", + "\n", + "# one-hot in numpy\n", + "def to_categorical_numpy(integer_vector):\n", + " n_inputs = len(integer_vector)\n", + " n_categories = np.max(integer_vector) + 1\n", + " onehot_vector = np.zeros((n_inputs, n_categories))\n", + " onehot_vector[range(n_inputs), integer_vector] = 1\n", + " \n", + " return onehot_vector\n", + "\n", + "#Y_train_onehot, Y_test_onehot = to_categorical(Y_train), to_categorical(Y_test)\n", + "Y_train_onehot, Y_test_onehot = to_categorical_numpy(Y_train), to_categorical_numpy(Y_test)\n", + "\n", + "def feed_forward_train(X):\n", + " # weighted sum of inputs to the hidden layer\n", + " z_h = np.matmul(X, hidden_weights) + hidden_bias\n", + " # activation in the hidden layer\n", + " a_h = sigmoid(z_h)\n", + " \n", + " # weighted sum of inputs to the output layer\n", + " z_o = np.matmul(a_h, output_weights) + output_bias\n", + " # softmax output\n", + " # axis 0 holds each input and axis 1 the probabilities of each category\n", + " exp_term = np.exp(z_o)\n", + " probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)\n", + " \n", + " # for backpropagation need activations in hidden and output layers\n", + " return a_h, probabilities\n", + "\n", + "def backpropagation(X, Y):\n", + " a_h, probabilities = feed_forward_train(X)\n", + " \n", + " # error in the output layer\n", + " error_output = probabilities - Y\n", + " # error in the hidden layer\n", + " error_hidden = np.matmul(error_output, output_weights.T) * a_h * (1 - a_h)\n", + " \n", + " # gradients for the output layer\n", + " output_weights_gradient = np.matmul(a_h.T, error_output)\n", + " output_bias_gradient = np.sum(error_output, axis=0)\n", + " \n", + " # gradient for the hidden layer\n", + " hidden_weights_gradient = np.matmul(X.T, error_hidden)\n", + " hidden_bias_gradient = np.sum(error_hidden, axis=0)\n", + "\n", + " return output_weights_gradient, output_bias_gradient, hidden_weights_gradient, hidden_bias_gradient\n", + "\n", + "print(\"Old accuracy on training data: \" + str(accuracy_score(predict(X_train), Y_train)))\n", + "\n", + "eta = 0.01\n", + "lmbd = 0.01\n", + "for i in range(1000):\n", + " # calculate gradients\n", + " dWo, dBo, dWh, dBh = backpropagation(X_train, Y_train_onehot)\n", + " \n", + " # regularization term gradients\n", + " dWo += lmbd * output_weights\n", + " dWh += lmbd * hidden_weights\n", + " \n", + " # update weights and biases\n", + " output_weights -= eta * dWo\n", + " output_bias -= eta * dBo\n", + " hidden_weights -= eta * dWh\n", + " hidden_bias -= eta * dBh\n", + "\n", + "print(\"New accuracy on training data: \" + str(accuracy_score(predict(X_train), Y_train)))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Improving performance\n", + "\n", + "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. \n", + "In order to obtain a network that does something useful, we will have to do a bit more work. \n", + "\n", + "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}$. \n", + "\n", + "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\n", + "going through the entire dataset ($n/M$ batches) an *epoch*.\n", + "\n", + "If this does not improve network performance, you may want to consider altering the network architecture, adding more neurons or hidden layers. \n", + "Andrew Ng goes through some of these considerations in this [video](https://youtu.be/F1ka6a13S9I). You can find a summary of the video [here](https://kevinzakka.github.io/2016/09/26/applying-deep-learning/). \n", + "\n", + "## Full object-oriented implementation\n", + "\n", + "It is very natural to think of the network as an object, with specific instances of the network\n", + "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." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class NeuralNetwork:\n", + " def __init__(\n", + " self,\n", + " X_data,\n", + " Y_data,\n", + " n_hidden_neurons=50,\n", + " n_categories=10,\n", + " epochs=10,\n", + " batch_size=100,\n", + " eta=0.1,\n", + " lmbd=0.0):\n", + "\n", + " self.X_data_full = X_data\n", + " self.Y_data_full = Y_data\n", + "\n", + " self.n_inputs = X_data.shape[0]\n", + " self.n_features = X_data.shape[1]\n", + " self.n_hidden_neurons = n_hidden_neurons\n", + " self.n_categories = n_categories\n", + "\n", + " self.epochs = epochs\n", + " self.batch_size = batch_size\n", + " self.iterations = self.n_inputs // self.batch_size\n", + " self.eta = eta\n", + " self.lmbd = lmbd\n", + "\n", + " self.create_biases_and_weights()\n", + "\n", + " def create_biases_and_weights(self):\n", + " self.hidden_weights = np.random.randn(self.n_features, self.n_hidden_neurons)\n", + " self.hidden_bias = np.zeros(self.n_hidden_neurons) + 0.01\n", + "\n", + " self.output_weights = np.random.randn(self.n_hidden_neurons, self.n_categories)\n", + " self.output_bias = np.zeros(self.n_categories) + 0.01\n", + "\n", + " def feed_forward(self):\n", + " # feed-forward for training\n", + " self.z_h = np.matmul(self.X_data, self.hidden_weights) + self.hidden_bias\n", + " self.a_h = sigmoid(self.z_h)\n", + "\n", + " self.z_o = np.matmul(self.a_h, self.output_weights) + self.output_bias\n", + "\n", + " exp_term = np.exp(self.z_o)\n", + " self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)\n", + "\n", + " def feed_forward_out(self, X):\n", + " # feed-forward for output\n", + " z_h = np.matmul(X, self.hidden_weights) + self.hidden_bias\n", + " a_h = sigmoid(z_h)\n", + "\n", + " z_o = np.matmul(a_h, self.output_weights) + self.output_bias\n", + " \n", + " exp_term = np.exp(z_o)\n", + " probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)\n", + " return probabilities\n", + "\n", + " def backpropagation(self):\n", + " error_output = self.probabilities - self.Y_data\n", + " error_hidden = np.matmul(error_output, self.output_weights.T) * self.a_h * (1 - self.a_h)\n", + "\n", + " self.output_weights_gradient = np.matmul(self.a_h.T, error_output)\n", + " self.output_bias_gradient = np.sum(error_output, axis=0)\n", + "\n", + " self.hidden_weights_gradient = np.matmul(self.X_data.T, error_hidden)\n", + " self.hidden_bias_gradient = np.sum(error_hidden, axis=0)\n", + "\n", + " if self.lmbd > 0.0:\n", + " self.output_weights_gradient += self.lmbd * self.output_weights\n", + " self.hidden_weights_gradient += self.lmbd * self.hidden_weights\n", + "\n", + " self.output_weights -= self.eta * self.output_weights_gradient\n", + " self.output_bias -= self.eta * self.output_bias_gradient\n", + " self.hidden_weights -= self.eta * self.hidden_weights_gradient\n", + " self.hidden_bias -= self.eta * self.hidden_bias_gradient\n", + "\n", + " def predict(self, X):\n", + " probabilities = self.feed_forward_out(X)\n", + " return np.argmax(probabilities, axis=1)\n", + "\n", + " def predict_probabilities(self, X):\n", + " probabilities = self.feed_forward_out(X)\n", + " return probabilities\n", + "\n", + " def train(self):\n", + " data_indices = np.arange(self.n_inputs)\n", + "\n", + " for i in range(self.epochs):\n", + " for j in range(self.iterations):\n", + " # pick datapoints with replacement\n", + " chosen_datapoints = np.random.choice(\n", + " data_indices, size=self.batch_size, replace=False\n", + " )\n", + "\n", + " # minibatch training data\n", + " self.X_data = self.X_data_full[chosen_datapoints]\n", + " self.Y_data = self.Y_data_full[chosen_datapoints]\n", + "\n", + " self.feed_forward()\n", + " self.backpropagation()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Evaluate model performance on test data\n", + "\n", + "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. \n", + "We measure the performance of the network using the *accuracy* score. \n", + "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$. \n", + "\n", + "$$ \\text{Accuracy} = \\frac{\\sum_{i=1}^n I(\\hat{y}_i = y_i)}{n} ,$$ \n", + "\n", + "where $I$ is the indicator function, $1$ if $\\hat{y}_i = y_i$ and $0$ otherwise." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "epochs = 100\n", + "batch_size = 100\n", + "\n", + "dnn = NeuralNetwork(X_train, Y_train_onehot, eta=eta, lmbd=lmbd, epochs=epochs, batch_size=batch_size,\n", + " n_hidden_neurons=n_hidden_neurons, n_categories=n_categories)\n", + "dnn.train()\n", + "test_predict = dnn.predict(X_test)\n", + "\n", + "# accuracy score from scikit library\n", + "print(\"Accuracy score on test set: \", accuracy_score(Y_test, test_predict))\n", + "\n", + "# equivalent in numpy\n", + "def accuracy_score_numpy(Y_test, Y_pred):\n", + " return np.sum(Y_test == Y_pred) / len(Y_test)\n", + "\n", + "#print(\"Accuracy score on test set: \", accuracy_score_numpy(Y_test, test_predict))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Adjust hyperparameters\n", + "\n", + "We now perform a grid search to find the optimal hyperparameters for the network. \n", + "Note that we are only using 1 layer with 50 neurons, and human performance is estimated to be around $98\\%$ ($2\\%$ error rate)." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "eta_vals = np.logspace(-5, 1, 7)\n", + "lmbd_vals = np.logspace(-5, 1, 7)\n", + "# store the models for later use\n", + "DNN_numpy = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object)\n", + "\n", + "# grid search\n", + "for i, eta in enumerate(eta_vals):\n", + " for j, lmbd in enumerate(lmbd_vals):\n", + " dnn = NeuralNetwork(X_train, Y_train_onehot, eta=eta, lmbd=lmbd, epochs=epochs, batch_size=batch_size,\n", + " n_hidden_neurons=n_hidden_neurons, n_categories=n_categories)\n", + " dnn.train()\n", + " \n", + " DNN_numpy[i][j] = dnn\n", + " \n", + " test_predict = dnn.predict(X_test)\n", + " \n", + " print(\"Learning rate = \", eta)\n", + " print(\"Lambda = \", lmbd)\n", + " print(\"Accuracy score on test set: \", accuracy_score(Y_test, test_predict))\n", + " print()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Visualization" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# visual representation of grid search\n", + "# uses seaborn heatmap, you can also do this with matplotlib imshow\n", + "import seaborn as sns\n", + "\n", + "sns.set()\n", + "\n", + "train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n", + "test_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n", + "\n", + "for i in range(len(eta_vals)):\n", + " for j in range(len(lmbd_vals)):\n", + " dnn = DNN_numpy[i][j]\n", + " \n", + " train_pred = dnn.predict(X_train) \n", + " test_pred = dnn.predict(X_test)\n", + "\n", + " train_accuracy[i][j] = accuracy_score(Y_train, train_pred)\n", + " test_accuracy[i][j] = accuracy_score(Y_test, test_pred)\n", + "\n", + " \n", + "fig, ax = plt.subplots(figsize = (10, 10))\n", + "sns.heatmap(train_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n", + "ax.set_title(\"Training Accuracy\")\n", + "ax.set_ylabel(\"$\\eta$\")\n", + "ax.set_xlabel(\"$\\lambda$\")\n", + "plt.show()\n", + "\n", + "fig, ax = plt.subplots(figsize = (10, 10))\n", + "sns.heatmap(test_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n", + "ax.set_title(\"Test Accuracy\")\n", + "ax.set_ylabel(\"$\\eta$\")\n", + "ax.set_xlabel(\"$\\lambda$\")\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## scikit-learn implementation\n", + "\n", + "**scikit-learn** focuses more\n", + "on traditional machine learning methods, such as regression,\n", + "clustering, decision trees, etc. As such, it has only two types of\n", + "neural networks: Multi Layer Perceptron outputting continuous values,\n", + "*MPLRegressor*, and Multi Layer Perceptron outputting labels,\n", + "*MLPClassifier*. We will see how simple it is to use these classes.\n", + "\n", + "**scikit-learn** implements a few improvements from our neural network,\n", + "such as early stopping, a varying learning rate, different\n", + "optimization methods, etc. We would therefore expect a better\n", + "performance overall." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from sklearn.neural_network import MLPClassifier\n", + "# store models for later use\n", + "DNN_scikit = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object)\n", + "\n", + "for i, eta in enumerate(eta_vals):\n", + " for j, lmbd in enumerate(lmbd_vals):\n", + " dnn = MLPClassifier(hidden_layer_sizes=(n_hidden_neurons), activation='logistic',\n", + " alpha=lmbd, learning_rate_init=eta, max_iter=epochs)\n", + " dnn.fit(X_train, Y_train)\n", + " \n", + " DNN_scikit[i][j] = dnn\n", + " \n", + " print(\"Learning rate = \", eta)\n", + " print(\"Lambda = \", lmbd)\n", + " print(\"Accuracy score on test set: \", dnn.score(X_test, Y_test))\n", + " print()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Visualization" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# optional\n", + "# visual representation of grid search\n", + "# uses seaborn heatmap, could probably do this in matplotlib\n", + "import seaborn as sns\n", + "\n", + "sns.set()\n", + "\n", + "train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n", + "test_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n", + "\n", + "for i in range(len(eta_vals)):\n", + " for j in range(len(lmbd_vals)):\n", + " dnn = DNN_scikit[i][j]\n", + " \n", + " train_pred = dnn.predict(X_train) \n", + " test_pred = dnn.predict(X_test)\n", + "\n", + " train_accuracy[i][j] = accuracy_score(Y_train, train_pred)\n", + " test_accuracy[i][j] = accuracy_score(Y_test, test_pred)\n", + "\n", + " \n", + "fig, ax = plt.subplots(figsize = (10, 10))\n", + "sns.heatmap(train_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n", + "ax.set_title(\"Training Accuracy\")\n", + "ax.set_ylabel(\"$\\eta$\")\n", + "ax.set_xlabel(\"$\\lambda$\")\n", + "plt.show()\n", + "\n", + "fig, ax = plt.subplots(figsize = (10, 10))\n", + "sns.heatmap(test_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n", + "ax.set_title(\"Test Accuracy\")\n", + "ax.set_ylabel(\"$\\eta$\")\n", + "ax.set_xlabel(\"$\\lambda$\")\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Building neural networks in Tensorflow and Keras\n", + "\n", + "Now we want to build on the experience gained from our neural network implementation in NumPy and scikit-learn\n", + "and use it to construct a neural network in Tensorflow. Once we have constructed a neural network in NumPy\n", + "and Tensorflow, building one in Keras is really quite trivial, though the performance may suffer. \n", + "\n", + "In our previous example we used only one hidden layer, and in this we will use two. From this it should be quite\n", + "clear how to build one using an arbitrary number of hidden layers, using data structures such as Python lists or\n", + "NumPy arrays.\n", + "\n", + "## Tensorflow\n", + "\n", + "Tensorflow is an open source library machine learning library\n", + "developed by the Google Brain team for internal use. It was released\n", + "under the Apache 2.0 open source license in November 9, 2015.\n", + "\n", + "Tensorflow is a computational framework that allows you to construct\n", + "machine learning models at different levels of abstraction, from\n", + "high-level, object-oriented APIs like Keras, down to the C++ kernels\n", + "that Tensorflow is built upon. The higher levels of abstraction are\n", + "simpler to use, but less flexible, and our choice of implementation\n", + "should reflect the problems we are trying to solve.\n", + "\n", + "[Tensorflow uses](https://www.tensorflow.org/guide/graphs) so-called graphs to represent your computation\n", + "in terms of the dependencies between individual operations, such that you first build a Tensorflow *graph*\n", + "to represent your model, and then create a Tensorflow *session* to run the graph.\n", + "\n", + "In this guide we will analyze the same data as we did in our NumPy and\n", + "scikit-learn tutorial, gathered from the MNIST database of images. We\n", + "will give an introduction to the lower level Python Application\n", + "Program Interfaces (APIs), and see how we use them to build our graph.\n", + "Then we will build (effectively) the same graph in Keras, to see just\n", + "how simple solving a machine learning problem can be.\n", + "\n", + "To install tensorflow on Unix/Linux systems, use pip as" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "pip3 install tensorflow" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and/or if you use **anaconda**, just write (or install from the graphical user interface)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "conda install tensorflow" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Collect and pre-process data" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# import necessary packages\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from sklearn import datasets\n", + "\n", + "\n", + "# ensure the same random numbers appear every time\n", + "np.random.seed(0)\n", + "\n", + "# display images in notebook\n", + "%matplotlib inline\n", + "plt.rcParams['figure.figsize'] = (12,12)\n", + "\n", + "\n", + "# download MNIST dataset\n", + "digits = datasets.load_digits()\n", + "\n", + "# define inputs and labels\n", + "inputs = digits.images\n", + "labels = digits.target\n", + "\n", + "print(\"inputs = (n_inputs, pixel_width, pixel_height) = \" + str(inputs.shape))\n", + "print(\"labels = (n_inputs) = \" + str(labels.shape))\n", + "\n", + "\n", + "# flatten the image\n", + "# the value -1 means dimension is inferred from the remaining dimensions: 8x8 = 64\n", + "n_inputs = len(inputs)\n", + "inputs = inputs.reshape(n_inputs, -1)\n", + "print(\"X = (n_inputs, n_features) = \" + str(inputs.shape))\n", + "\n", + "\n", + "# choose some random images to display\n", + "indices = np.arange(n_inputs)\n", + "random_indices = np.random.choice(indices, size=5)\n", + "\n", + "for i, image in enumerate(digits.images[random_indices]):\n", + " plt.subplot(1, 5, i+1)\n", + " plt.axis('off')\n", + " plt.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest')\n", + " plt.title(\"Label: %d\" % digits.target[random_indices[i]])\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from keras.utils import to_categorical\n", + "from sklearn.model_selection import train_test_split\n", + "\n", + "# one-hot representation of labels\n", + "labels = to_categorical(labels)\n", + "\n", + "# split into train and test data\n", + "train_size = 0.8\n", + "test_size = 1 - train_size\n", + "X_train, X_test, Y_train, Y_test = train_test_split(inputs, labels, train_size=train_size,\n", + " test_size=test_size)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Using TensorFlow backend\n", + "\n", + "1. Define model and architecture\n", + "\n", + "2. Choose cost function and optimizer" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import tensorflow as tf\n", + "\n", + "class NeuralNetworkTensorflow:\n", + " def __init__(\n", + " self,\n", + " X_train,\n", + " Y_train,\n", + " X_test,\n", + " Y_test,\n", + " n_neurons_layer1=100,\n", + " n_neurons_layer2=50,\n", + " n_categories=2,\n", + " epochs=10,\n", + " batch_size=100,\n", + " eta=0.1,\n", + " lmbd=0.0):\n", + " \n", + " # keep track of number of steps\n", + " self.global_step = tf.Variable(0, dtype=tf.int32, trainable=False, name='global_step')\n", + " \n", + " self.X_train = X_train\n", + " self.Y_train = Y_train\n", + " self.X_test = X_test\n", + " self.Y_test = Y_test\n", + " \n", + " self.n_inputs = X_train.shape[0]\n", + " self.n_features = X_train.shape[1]\n", + " self.n_neurons_layer1 = n_neurons_layer1\n", + " self.n_neurons_layer2 = n_neurons_layer2\n", + " self.n_categories = n_categories\n", + " \n", + " self.epochs = epochs\n", + " self.batch_size = batch_size\n", + " self.iterations = self.n_inputs // self.batch_size\n", + " self.eta = eta\n", + " self.lmbd = lmbd\n", + " \n", + " # build network piece by piece\n", + " # name scopes (with) are used to enforce creation of new variables\n", + " # https://www.tensorflow.org/guide/variables\n", + " self.create_placeholders()\n", + " self.create_DNN()\n", + " self.create_loss()\n", + " self.create_optimiser()\n", + " self.create_accuracy()\n", + " \n", + " def create_placeholders(self):\n", + " # placeholders are fine here, but \"Datasets\" are the preferred method\n", + " # of streaming data into a model\n", + " with tf.name_scope('data'):\n", + " self.X = tf.placeholder(tf.float32, shape=(None, self.n_features), name='X_data')\n", + " self.Y = tf.placeholder(tf.float32, shape=(None, self.n_categories), name='Y_data')\n", + " \n", + " def create_DNN(self):\n", + " with tf.name_scope('DNN'):\n", + " # the weights are stored to calculate regularization loss later\n", + " \n", + " # Fully connected layer 1\n", + " self.W_fc1 = self.weight_variable([self.n_features, self.n_neurons_layer1], name='fc1', dtype=tf.float32)\n", + " b_fc1 = self.bias_variable([self.n_neurons_layer1], name='fc1', dtype=tf.float32)\n", + " a_fc1 = tf.nn.sigmoid(tf.matmul(self.X, self.W_fc1) + b_fc1)\n", + " \n", + " # Fully connected layer 2\n", + " self.W_fc2 = self.weight_variable([self.n_neurons_layer1, self.n_neurons_layer2], name='fc2', dtype=tf.float32)\n", + " b_fc2 = self.bias_variable([self.n_neurons_layer2], name='fc2', dtype=tf.float32)\n", + " a_fc2 = tf.nn.sigmoid(tf.matmul(a_fc1, self.W_fc2) + b_fc2)\n", + " \n", + " # Output layer\n", + " self.W_out = self.weight_variable([self.n_neurons_layer2, self.n_categories], name='out', dtype=tf.float32)\n", + " b_out = self.bias_variable([self.n_categories], name='out', dtype=tf.float32)\n", + " self.z_out = tf.matmul(a_fc2, self.W_out) + b_out\n", + " \n", + " def create_loss(self):\n", + " with tf.name_scope('loss'):\n", + " softmax_loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits_v2(labels=self.Y, logits=self.z_out))\n", + " \n", + " regularizer_loss_fc1 = tf.nn.l2_loss(self.W_fc1)\n", + " regularizer_loss_fc2 = tf.nn.l2_loss(self.W_fc2)\n", + " regularizer_loss_out = tf.nn.l2_loss(self.W_out)\n", + " regularizer_loss = self.lmbd*(regularizer_loss_fc1 + regularizer_loss_fc2 + regularizer_loss_out)\n", + " \n", + " self.loss = softmax_loss + regularizer_loss\n", + "\n", + " def create_accuracy(self):\n", + " with tf.name_scope('accuracy'):\n", + " probabilities = tf.nn.softmax(self.z_out)\n", + " predictions = tf.argmax(probabilities, axis=1)\n", + " labels = tf.argmax(self.Y, axis=1)\n", + " \n", + " correct_predictions = tf.equal(predictions, labels)\n", + " correct_predictions = tf.cast(correct_predictions, tf.float32)\n", + " self.accuracy = tf.reduce_mean(correct_predictions)\n", + " \n", + " def create_optimiser(self):\n", + " with tf.name_scope('optimizer'):\n", + " self.optimizer = tf.train.GradientDescentOptimizer(learning_rate=self.eta).minimize(self.loss, global_step=self.global_step)\n", + " \n", + " def weight_variable(self, shape, name='', dtype=tf.float32):\n", + " initial = tf.truncated_normal(shape, stddev=0.1)\n", + " return tf.Variable(initial, name=name, dtype=dtype)\n", + " \n", + " def bias_variable(self, shape, name='', dtype=tf.float32):\n", + " initial = tf.constant(0.1, shape=shape)\n", + " return tf.Variable(initial, name=name, dtype=dtype)\n", + " \n", + " def fit(self):\n", + " data_indices = np.arange(self.n_inputs)\n", + "\n", + " with tf.Session() as sess:\n", + " sess.run(tf.global_variables_initializer())\n", + " for i in range(self.epochs):\n", + " for j in range(self.iterations):\n", + " chosen_datapoints = np.random.choice(data_indices, size=self.batch_size, replace=False)\n", + " batch_X, batch_Y = self.X_train[chosen_datapoints], self.Y_train[chosen_datapoints]\n", + " \n", + " sess.run([DNN.loss, DNN.optimizer],\n", + " feed_dict={DNN.X: batch_X,\n", + " DNN.Y: batch_Y})\n", + " accuracy = sess.run(DNN.accuracy,\n", + " feed_dict={DNN.X: batch_X,\n", + " DNN.Y: batch_Y})\n", + " step = sess.run(DNN.global_step)\n", + " \n", + " self.train_loss, self.train_accuracy = sess.run([DNN.loss, DNN.accuracy],\n", + " feed_dict={DNN.X: self.X_train,\n", + " DNN.Y: self.Y_train})\n", + " \n", + " self.test_loss, self.test_accuracy = sess.run([DNN.loss, DNN.accuracy],\n", + " feed_dict={DNN.X: self.X_test,\n", + " DNN.Y: self.Y_test})" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Optimizing and using gradient descent" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "epochs = 100\n", + "batch_size = 100\n", + "n_neurons_layer1 = 100\n", + "n_neurons_layer2 = 50\n", + "n_categories = 10\n", + "eta_vals = np.logspace(-5, 1, 7)\n", + "lmbd_vals = np.logspace(-5, 1, 7)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "DNN_tf = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object)\n", + " \n", + "for i, eta in enumerate(eta_vals):\n", + " for j, lmbd in enumerate(lmbd_vals):\n", + " DNN = NeuralNetworkTensorflow(X_train, Y_train, X_test, Y_test,\n", + " n_neurons_layer1, n_neurons_layer2, n_categories,\n", + " epochs=epochs, batch_size=batch_size, eta=eta, lmbd=lmbd)\n", + " DNN.fit()\n", + " \n", + " DNN_tf[i][j] = DNN\n", + " \n", + " print(\"Learning rate = \", eta)\n", + " print(\"Lambda = \", lmbd)\n", + " print(\"Test accuracy: %.3f\" % DNN.test_accuracy)\n", + " print()" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# optional\n", + "# visual representation of grid search\n", + "# uses seaborn heatmap, could probably do this in matplotlib\n", + "import seaborn as sns\n", + "\n", + "sns.set()\n", + "\n", + "train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n", + "test_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n", + "\n", + "for i in range(len(eta_vals)):\n", + " for j in range(len(lmbd_vals)):\n", + " DNN = DNN_tf[i][j]\n", + "\n", + " train_accuracy[i][j] = DNN.train_accuracy\n", + " test_accuracy[i][j] = DNN.test_accuracy\n", + "\n", + " \n", + "fig, ax = plt.subplots(figsize = (10, 10))\n", + "sns.heatmap(train_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n", + "ax.set_title(\"Training Accuracy\")\n", + "ax.set_ylabel(\"$\\eta$\")\n", + "ax.set_xlabel(\"$\\lambda$\")\n", + "plt.show()\n", + "\n", + "fig, ax = plt.subplots(figsize = (10, 10))\n", + "sns.heatmap(test_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n", + "ax.set_title(\"Test Accuracy\")\n", + "ax.set_ylabel(\"$\\eta$\")\n", + "ax.set_xlabel(\"$\\lambda$\")\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# optional\n", + "# we can use log files to visualize our graph in Tensorboard\n", + "writer = tf.summary.FileWriter('logs/')\n", + "writer.add_graph(tf.get_default_graph())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Using Keras\n", + "\n", + "Keras is a high level [neural network](https://en.wikipedia.org/wiki/Application_programming_interface)\n", + "that supports Tensorflow, CTNK and Theano as backends. \n", + "If you have Tensorflow installed Keras is available through the *tf.keras* module. \n", + "If you have Anaconda installed you may run the following command" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "conda install keras" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Alternatively, if you have Tensorflow or one of the other supported backends install you may use the pip package manager:" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "pip3 install keras" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "or look up the [instructions here](https://keras.io/)." + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from keras.models import Sequential\n", + "from keras.layers import Dense\n", + "from keras.regularizers import l2\n", + "from keras.optimizers import SGD\n", + "\n", + "def create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories, eta, lmbd):\n", + " model = Sequential()\n", + " model.add(Dense(n_neurons_layer1, activation='sigmoid', kernel_regularizer=l2(lmbd)))\n", + " model.add(Dense(n_neurons_layer2, activation='sigmoid', kernel_regularizer=l2(lmbd)))\n", + " model.add(Dense(n_categories, activation='softmax'))\n", + " \n", + " sgd = SGD(lr=eta)\n", + " model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])\n", + " \n", + " return model" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "DNN_keras = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object)\n", + " \n", + "for i, eta in enumerate(eta_vals):\n", + " for j, lmbd in enumerate(lmbd_vals):\n", + " DNN = create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories,\n", + " eta=eta, lmbd=lmbd)\n", + " DNN.fit(X_train, Y_train, epochs=epochs, batch_size=batch_size, verbose=0)\n", + " scores = DNN.evaluate(X_test, Y_test)\n", + " \n", + " DNN_keras[i][j] = DNN\n", + " \n", + " print(\"Learning rate = \", eta)\n", + " print(\"Lambda = \", lmbd)\n", + " print(\"Test accuracy: %.3f\" % scores[1])\n", + " print()" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# optional\n", + "# visual representation of grid search\n", + "# uses seaborn heatmap, could probably do this in matplotlib\n", + "import seaborn as sns\n", + "\n", + "sns.set()\n", + "\n", + "train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n", + "test_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n", + "\n", + "for i in range(len(eta_vals)):\n", + " for j in range(len(lmbd_vals)):\n", + " DNN = DNN_keras[i][j]\n", + "\n", + " train_accuracy[i][j] = DNN.evaluate(X_train, Y_train)[1]\n", + " test_accuracy[i][j] = DNN.evaluate(X_test, Y_test)[1]\n", + "\n", + " \n", + "fig, ax = plt.subplots(figsize = (10, 10))\n", + "sns.heatmap(train_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n", + "ax.set_title(\"Training Accuracy\")\n", + "ax.set_ylabel(\"$\\eta$\")\n", + "ax.set_xlabel(\"$\\lambda$\")\n", + "plt.show()\n", + "\n", + "fig, ax = plt.subplots(figsize = (10, 10))\n", + "sns.heatmap(test_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n", + "ax.set_title(\"Test Accuracy\")\n", + "ax.set_ylabel(\"$\\eta$\")\n", + "ax.set_xlabel(\"$\\lambda$\")\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## Which activation function should I use?\n", + "\n", + "The Back propagation algorithm we derived above works by going from\n", + "the output layer to the input layer, propagating the error gradient on\n", + "the way. Once the algorithm has computed the gradient of the cost\n", + "function with regards to each parameter in the network, it uses these\n", + "gradients to update each parameter with a Gradient Descent (GD) step.\n", + "\n", + "\n", + "Unfortunately for us, the gradients often get smaller and smaller as the\n", + "algorithm progresses down to the first hidden layers. As a result, the\n", + "GD update leaves the lower layer connection weights\n", + "virtually unchanged, and training never converges to a good\n", + "solution. This is known in the literature as \n", + "**the vanishing gradients problem**. \n", + "\n", + "In other cases, the opposite can happen, namely the the gradients can grow bigger and\n", + "bigger. The result is that many of the layers get large updates of the \n", + "weights the\n", + "algorithm diverges. This is the **exploding gradients problem**, which is\n", + "mostly encountered in recurrent neural networks. More generally, deep\n", + "neural networks suffer from unstable gradients, different layers may\n", + "learn at widely different speeds\n", + "\n", + "\n", + "## Is the Logistic activation function (Sigmoid) our choice?\n", + "\n", + "Although this unfortunate behavior has been empirically observed for\n", + "quite a while (it was one of the reasons why deep neural networks were\n", + "mostly abandoned for a long time), it is only around 2010 that\n", + "significant progress was made in understanding it.\n", + "\n", + "A paper titled [Understanding the Difficulty of Training Deep\n", + "Feedforward Neural Networks by Xavier Glorot and Yoshua Bengio](http://proceedings.mlr.press/v9/glorot10a.html) found that\n", + "the problems with the popular logistic\n", + "sigmoid activation function and the weight initialization technique\n", + "that was most popular at the time, namely random initialization using\n", + "a normal distribution with a mean of 0 and a standard deviation of\n", + "1. \n", + "\n", + "They showed that with this activation function and this\n", + "initialization scheme, the variance of the outputs of each layer is\n", + "much greater than the variance of its inputs. Going forward in the\n", + "network, the variance keeps increasing after each layer until the\n", + "activation function saturates at the top layers. This is actually made\n", + "worse by the fact that the logistic function has a mean of 0.5, not 0\n", + "(the hyperbolic tangent function has a mean of 0 and behaves slightly\n", + "better than the logistic function in deep networks).\n", + "\n", + "\n", + "## The derivative of the Logistic funtion\n", + "\n", + "Looking at the logistic activation function, when inputs become large\n", + "(negative or positive), the function saturates at 0 or 1, with a\n", + "derivative extremely close to 0. Thus when backpropagation kicks in,\n", + "it has virtually no gradient to propagate back through the network,\n", + "and what little gradient exists keeps getting diluted as\n", + "backpropagation progresses down through the top layers, so there is\n", + "really nothing left for the lower layers.\n", + "\n", + "In their paper, Glorot and Bengio propose a way to significantly\n", + "alleviate this problem. We need the signal to flow properly in both\n", + "directions: in the forward direction when making predictions, and in\n", + "the reverse direction when backpropagating gradients. We don’t want\n", + "the signal to die out, nor do we want it to explode and saturate. For\n", + "the signal to flow properly, the authors argue that we need the\n", + "variance of the outputs of each layer to be equal to the variance of\n", + "its inputs, and we also need the gradients to have equal variance\n", + "before and after flowing through a layer in the reverse direction.\n", + "\n", + "\n", + "\n", + "One of the insights in the 2010 paper by Glorot and Bengio was that\n", + "the vanishing/exploding gradients problems were in part due to a poor\n", + "choice of activation function. Until then most people had assumed that\n", + "if Nature had chosen to use roughly sigmoid activation functions in\n", + "biological neurons, they must be an excellent choice. But it turns out\n", + "that other activation functions behave much better in deep neural\n", + "networks, in particular the ReLU activation function, mostly because\n", + "it does not saturate for positive values (and also because it is quite\n", + "fast to compute).\n", + "\n", + "\n", + "## The RELU function family\n", + "\n", + "The ReLU activation function suffers from a problem known as the dying\n", + "ReLUs: during training, some neurons effectively die, meaning they\n", + "stop outputting anything other than 0.\n", + "\n", + "In some cases, you may find that half of your network’s neurons are\n", + "dead, especially if you used a large learning rate. During training,\n", + "if a neuron’s weights get updated such that the weighted sum of the\n", + "neuron’s inputs is negative, it will start outputting 0. When this\n", + "happen, the neuron is unlikely to come back to life since the gradient\n", + "of the ReLU function is 0 when its input is negative.\n", + "\n", + "To solve this problem, nowadays practitioners use a variant of the ReLU\n", + "function, such as the leaky ReLU discussed above or the so-called\n", + "exponential linear unit (ELU) function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "ELU(z) = \\left\\{\\begin{array}{cc} \\alpha\\left( \\exp{(z)}-1\\right) & z < 0,\\\\ z & z \\ge 0.\\end{array}\\right.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Which activation function should we use?\n", + "\n", + "In general it seems that the ELU activation function is better than\n", + "the leaky ReLU function (and its variants), which is better than\n", + "ReLU. ReLU performs better than $\\tanh$ which in turn performs better\n", + "than the logistic function. \n", + "\n", + "If runtime\n", + "performance is an issue, then you may opt for the leaky ReLU function over the \n", + "ELU function If you don’t\n", + "want to tweak yet another hyperparameter, you may just use the default\n", + "$\\alpha$ of $0.01$ for the leaky ReLU, and $1$ for ELU. If you have\n", + "spare time and computing power, you can use cross-validation or\n", + "bootstrap to evaluate other activation functions.\n", + "\n", + "\n", + "\n", + "## A top-down perspective on Neural networks\n", + "\n", + "\n", + "The first thing we would like to do is divide the data into two or three\n", + "parts. A training set, a validation or dev (development) set, and a\n", + "test set. The test set is the data on which we want to make\n", + "predictions. The dev set is a subset of the training data we use to\n", + "check how well we are doing out-of-sample, after training the model on\n", + "the training dataset. We use the validation error as a proxy for the\n", + "test error in order to make tweaks to our model. It is crucial that we\n", + "do not use any of the test data to train the algorithm. This is a\n", + "cardinal sin in ML. Then:\n", + "\n", + "\n", + "* Estimate optimal error rate\n", + "\n", + "* Minimize underfitting (bias) on training data set.\n", + "\n", + "* Make sure you are not overfitting.\n", + "\n", + "If the validation and test sets are drawn from the same distributions,\n", + "then a good performance on the validation set should lead to similarly\n", + "good performance on the test set. \n", + "\n", + "However, sometimes\n", + "the training data and test data differ in subtle ways because, for\n", + "example, they are collected using slightly different methods, or\n", + "because it is cheaper to collect data in one way versus another. In\n", + "this case, there can be a mismatch between the training and test\n", + "data. This can lead to the neural network overfitting these small\n", + "differences between the test and training sets, and a poor performance\n", + "on the test set despite having a good performance on the validation\n", + "set. To rectify this, Andrew Ng suggests making two validation or dev\n", + "sets, one constructed from the training data and one constructed from\n", + "the test data. The difference between the performance of the algorithm\n", + "on these two validation sets quantifies the train-test mismatch. This\n", + "can serve as another important diagnostic when using DNNs for\n", + "supervised learning.\n", + "\n", + "## Limitations of supervised learning with deep networks\n", + "\n", + "Like all statistical methods, supervised learning using neural\n", + "networks has important limitations. This is especially important when\n", + "one seeks to apply these methods, especially to physics problems. Like\n", + "all tools, DNNs are not a universal solution. Often, the same or\n", + "better performance on a task can be achieved by using a few\n", + "hand-engineered features (or even a collection of random\n", + "features). \n", + "\n", + "Here we list some of the important limitations of supervised neural network based models. \n", + "\n", + "\n", + "\n", + "* **Need labeled data**. All supervised learning methods, DNNs for supervised learning require labeled data. Often, labeled data is harder to acquire than unlabeled data (e.g. one must pay for human experts to label images).\n", + "\n", + "* **Supervised neural networks are extremely data intensive.** DNNs are data hungry. They perform best when data is plentiful. This is doubly so for supervised methods where the data must also be labeled. The utility of DNNs is extremely limited if data is hard to acquire or the datasets are small (hundreds to a few thousand samples). In this case, the performance of other methods that utilize hand-engineered features can exceed that of DNNs.\n", + "\n", + "* **Homogeneous data.** Almost all DNNs deal with homogeneous data of one type. It is very hard to design architectures that mix and match data types (i.e. some continuous variables, some discrete variables, some time series). In applications beyond images, video, and language, this is often what is required. In contrast, ensemble models like random forests or gradient-boosted trees have no difficulty handling mixed data types.\n", + "\n", + "* **Many problems are not about prediction.** In natural science we are often interested in learning something about the underlying distribution that generates the data. In this case, it is often difficult to cast these ideas in a supervised learning setting. While the problems are related, it is possible to make good predictions with a *wrong* model. The model might or might not be useful for understanding the underlying science.\n", + "\n", + "Some of these remarks are particular to DNNs, others are shared by all supervised learning methods. This motivates the use of unsupervised methods which in part circumvent these problems.\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "## Convolutional Neural Networks (recognizing images)\n", "\n", "\n", @@ -265,14 +2367,12 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 26, "metadata": { "collapsed": false }, "outputs": [], "source": [ - "%matplotlib inline\n", - "\n", "# import necessary packages\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", @@ -324,7 +2424,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 27, "metadata": { "collapsed": false }, @@ -355,7 +2455,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 28, "metadata": { "collapsed": false }, @@ -512,7 +2612,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 29, "metadata": { "collapsed": false }, @@ -553,7 +2653,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 30, "metadata": { "collapsed": false }, @@ -601,7 +2701,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 31, "metadata": { "collapsed": false }, @@ -652,7 +2752,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 32, "metadata": { "collapsed": false }, @@ -733,5 +2833,5 @@ ], "metadata": {}, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/doc/src/week41/week41.do.txt b/doc/src/week41/week41.do.txt index 77547edf1..ff44ae165 100644 --- a/doc/src/week41/week41.do.txt +++ b/doc/src/week41/week41.do.txt @@ -3,6 +3,1674 @@ AUTHOR: Morten Hjorth-Jensen {copyright, 1999-present|CC BY-NC} at Department of DATE: today +!split +===== Plan for week 40 ===== + +* Thursday: Building our own Feed-forward Neural Network +* Friday: Playing around with our own Feed-forward Neural Network and introduction to TensorFlow. Start convolutional Neural Networks. + +Reading suggestions for both days: "Aurelien Geron's chapters 10-11":"https://github.com/CompPhysics/MachineLearning/blob/master/doc/T\ +extbooks/TensorflowML.pdf" and Hastie et al chapter 11. + +!split +===== Overview video for week 41 ===== + +"Overview Video, from Stochastic Gradient methods to Neural Networks":"https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h20\ +/forelesningsvideoer/OverviewWeek41.mp4?vrtx=view-as-webpage" + + +!split +===== Setting up the Back propagation algorithm ===== + + + +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. + +!bblock +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$. +!eblock + +!bblock +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$. +!eblock + +!bblock +Thereafter we compute the ouput error $\hat{\delta}^L$ by computing all +!bt +\[ +\delta_j^L = f'(z_j^L)\frac{\partial {\cal C}}{\partial (a_j^L)}. +\] +!et +!eblock + +!bblock +Then we compute the back propagate error for each $l=L-1,L-2,\dots,2$ as +!bt +\[ +\delta_j^l = \sum_k \delta_k^{l+1}w_{kj}^{l+1}f'(z_j^l). +\] +!et +!eblock + +!bblock +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 +!bt +\[ +w_{jk}^l\leftarrow = w_{jk}^l- \eta \delta_j^la_k^{l-1}, +\] +!et + +!bt +\[ +b_j^l \leftarrow b_j^l-\eta \frac{\partial {\cal C}}{\partial b_j^l}=b_j^l-\eta \delta_j^l, +\] +!et +!eblock + +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. + + + + +!split +===== Setting up a Multi-layer perceptron model for classification ===== + +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 +!bt +\[ +P(y = 0 \mid \hat{x}, \hat{\theta}) = \frac{1}{1 + \exp{(- \hat{x}})} , +\] +!et +and +!bt +\[ +P(y = 1 \mid \hat{x}, \hat{\theta}) = 1 - P(y = 0 \mid \hat{x}, \hat{\theta}) , +\] +!et + +where $y \in \{0, 1\}$ and $\hat{\theta}$ represents the weights and biases +of our network. + + +!split +===== Defining the cost function ===== + +Our cost function is given as (see the Logistic regression lectures) +!bt +\[ +\mathcal{C}(\hat{\theta}) = - \ln P(\mathcal{D} \mid \hat{\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(\hat{\theta}) . +\] +!et + +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(\hat{\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. + +In *multiclass* classification it is common to treat each integer label as a so called *one-hot* vector: + +$y = 5 \quad \rightarrow \quad \hat{y} = (0, 0, 0, 0, 0, 1, 0, 0, 0, 0) ,$ and + + +$y = 1 \quad \rightarrow \quad \hat{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 $\hat{x}_i$ is the $i$-th input (image), $y_{ic}$ refers to the $c$-th component of the $i$-th +output vector $\hat{y}_i$. +The probability of $\hat{x}_i$ being in class $c$ will be given by the softmax function: + +!bt +\[ +P(y_{ic} = 1 \mid \hat{x}_i, \hat{\theta}) = \frac{\exp{((\hat{a}_i^{hidden})^T \hat{w}_c)}} +{\sum_{c'=0}^{C-1} \exp{((\hat{a}_i^{hidden})^T \hat{w}_{c'})}} , +\] +!et + +which reduces to the logistic function in the binary case. +The likelihood of this $C$-class classifier +is now given as: + +!bt +\[ +P(\mathcal{D} \mid \hat{\theta}) = \prod_{i=1}^n \prod_{c=0}^{C-1} [P(y_{ic} = 1)]^{y_{ic}} . +\] +!et +Again we take the negative log-likelihood to define our cost function: + +!bt +\[ +\mathcal{C}(\hat{\theta}) = - \log{P(\mathcal{D} \mid \hat{\theta})}. +\] +!et +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! + +!split +===== Example: binary classification problem ===== + +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 +!bt +\[ +\mathcal{C}(\hat{\beta}) = - \sum_{i=1}^n \left(y_i\log{p(y_i \vert x_i,\hat{\beta})}+(1-y_i)\log{1-p(y_i \vert x_i,\hat{\beta})}\right), +\] +!et +where we had defined the logistic (sigmoid) function +!bt +\[ +p(y_i =1\vert x_i,\hat{\beta})=\frac{\exp{(\beta_0+\beta_1 x_i)}}{1+\exp{(\beta_0+\beta_1 x_i)}}, +\] +!et +and +!bt +\[ +p(y_i =0\vert x_i,\hat{\beta})=1-p(y_i =1\vert x_i,\hat{\beta}). +\] +!et +The parameters $\hat{\beta}$ were defined using a minimization method like gradient descent or Newton-Raphson's method. + +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 +!bt +\[ +a_i^l = y_i = \frac{\exp{(z_i^l)}}{1+\exp{(z_i^l)}}, +\] +!et +with +!bt +\[ +z_i^l = \sum_{j}w_{ij}^l a_j^{l-1}+b_i^l, +\] +!et +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 +!bt +\[ +\mathcal{C}(\hat{W}) = - \sum_{i=1}^n \left(t_i\log{a_i^L}+(1-t_i)\log{(1-a_i^L)}\right), +\] +!et +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 +!bt +\[ +\frac{\partial \mathcal{C}(\hat{W})}{\partial a_i^L} = \frac{a_i^L-t_i}{a_i^L(1-a_i^L)}. +\] +!et +In case we use another activation function than the logistic one, we need to evaluate other derivatives. + + +!split +===== 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 +!bt +\[ +\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}. +\] +!et +For the Softmax function we have +!bt +\[ +f(z_i^l) = \frac{\exp{(z_i^l)}}{\sum_{m=1}^K\exp{(z_m^l)}}. +\] +!et +Its derivative with respect to $z_j^l$ gives +!bt +\[ +\frac{\partial f(z_i^l)}{\partial z_j^l}= f(z_i^l)\left(\delta_{ij}-f(z_j^l)\right), +\] +!et +which in case of the simply binary model reduces to having $i=j$. + +!split +===== Developing a code for doing neural networks with back propagation ===== + + +One can identify a set of key steps when using neural networks to solve supervised learning problems: + +o Collect and pre-process data +o Define model and architecture +o Choose cost function and optimizer +o Train the model +o Evaluate model performance on test data +o Adjust hyperparameters (if necessary, network architecture) + +!split +===== Collect and pre-process data ===== + +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":"http://yann.lecun.com/exdb/mnist/". +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. + +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,...)$. + +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: + +$$ 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. + + +!bc pycod +# 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() +!ec + +!split +===== Train and test datasets ===== + +Performing analysis before partitioning the dataset is a major error, that can lead to incorrect conclusions. + +We will reserve $80 \%$ of our dataset for training and $20 \%$ for testing. + +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. + + +!bc pycod +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))) +!ec + +!split +===== Define model and architecture ===== + +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} +$$ + +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*. + +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. + +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)$: + +$$ 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. + +!split +===== Layers ===== + +* 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. + +* 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 $\hat{a}$}) = \frac{\exp{(\hat{a}^T \hat{w}_j)}} +{\sum_{c=0}^{9} \exp{(\hat{a}^T \hat{w}_c)}} ,$$ + +i.e. each neuron $j$ outputs the probability of being in class $j$ given an input from the hidden layer $\hat{a}$, with $\hat{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. + +!split +===== Weights and biases ===== + +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. + +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$: + +$$ z_j = \sum_{i=1}^n w_ {ij} a_i + b_j.$$ + +The bias weights $\hat{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. +!bc pycod +# 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 +!ec + +!split +===== Feed-forward pass ===== + +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$: + +$$ z_{j}^{l} = \sum_{i=1}^{F} w_{ij}^{l} x_i + b_{j}^{l},$$ + +this is then passed through our activation function + +$$ a_{j}^{l} = f(z_{j}^{l}) .$$ + +We calculate a weighted sum of inputs (activations in the hidden layer) to each neuron $j$ in the output layer: + +$$ z_{j}^{L} = \sum_{i=1}^{H} w_{ij}^{L} a_{i}^{l} + b_{j}^{L}.$$ + +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})}} .$$ + +!split +===== Matrix multiplications ===== + +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 + +$$ X W^{h} = (n_{inputs}, n_{hidden}),$$ + +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}$: + +$$ \hat{z}^{l} = \hat{X} \hat{W}^{l} + \hat{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: + +$$ \hat{a}^{l} = f(\hat{z}^l) .$$ + +This is fed to the output layer: + +$$ \hat{z}^{L} = \hat{a}^{L} \hat{W}^{L} + \hat{b}^{L} .$$ + +Finally we receive our output values for each image and each category by passing it through the softmax function: + +$$ output = softmax (\hat{z}^{L}) = (n_{inputs}, n_{categories}) .$$ + + +!bc pycod +# 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])) +!ec + +!split +===== Choose cost function and optimizer ===== + +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 *multiclass* classification it is common to treat each integer label as a so called *one-hot* vector: + +$$ y = 5 \quad \rightarrow \quad \hat{y} = (0, 0, 0, 0, 0, 1, 0, 0, 0, 0) ,$$ + + +$$ y = 1 \quad \rightarrow \quad \hat{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 $\hat{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 $\hat{\theta}$ represents the parameters of our network, i.e. all the weights and biases. + + +!split +===== Optimizing the cost function ===== + +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 + +$$ \theta_{i+1} = \theta_i - \eta \nabla \mathcal{C}(\theta_i) ,$$ + +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. + +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: +o Introducing stochasticity decreases the chance that the algorithm becomes stuck in a local minima. +o It significantly speeds up the calculation, since we do not have to use the entire dataset to calculate the gradient. + +The various optmization methods, with codes and algorithms, are discussed in our lectures on "Gradient descent approaches":"https://compphysics.github.io/MachineLearning/doc/pub/Splines/html/Splines-bs.html". + +!split +===== Regularization ===== + +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 will measure the size of the weights using the so called *L2-norm*, meaning our cost function becomes: + +$$ \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 \hat{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. + + +!split +===== Matrix multiplication ===== + +To more efficently train our network these equations are implemented using matrix operations. +The error in the output layer is calculated simply as, with $\hat{t}$ being our targets, + +$$ \delta_L = \hat{t} - \hat{y} = (n_{inputs}, n_{categories}) .$$ + +The gradient for the output weights is calculated as + +$$ \nabla W_{L} = \hat{a}^T \delta_L = (n_{hidden}, n_{categories}) ,$$ + +where $\hat{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. + +The gradient with respect to the output bias is then + +$$ \nabla \hat{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}) .$$ + + +!bc pycod +# 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))) +!ec + +!split +===== Improving performance ===== + +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":"https://youtu.be/F1ka6a13S9I". You can find a summary of the video "here":"https://kevinzakka.github.io/2016/09/26/applying-deep-learning/". + +!split +===== Full object-oriented implementation ===== + +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. + + +!bc pycod +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): + + self.X_data_full = X_data + self.Y_data_full = Y_data + + 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() +!ec + +!split +===== Evaluate model performance on test data ===== + +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$. + +$$ \text{Accuracy} = \frac{\sum_{i=1}^n I(\hat{y}_i = y_i)}{n} ,$$ + +where $I$ is the indicator function, $1$ if $\hat{y}_i = y_i$ and $0$ otherwise. + + +!bc pycod +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)) +!ec + +!split +===== 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). + +!bc pycod +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() +!ec + +!split +===== Visualization ===== + +!bc pycod +# visual representation of grid search +# uses seaborn heatmap, you can also do this with matplotlib imshow +import seaborn as sns + +sns.set() + +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals))) +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_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() +!ec + +!split +===== scikit-learn implementation ===== + +_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. + +_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. + +!bc pycod +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() +!ec + + +!split +===== Visualization ===== +!bc pycod +# optional +# visual representation of grid search +# uses seaborn heatmap, could probably do this in matplotlib +import seaborn as sns + +sns.set() + +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals))) +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] + + 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() +!ec + + +!split +===== Building neural networks in Tensorflow and Keras ===== + +Now we want to build on the experience gained from our neural network implementation in NumPy and scikit-learn +and use it to construct a neural network in Tensorflow. Once we have constructed a neural network in NumPy +and Tensorflow, building one in Keras is really quite trivial, though the performance may suffer. + +In our previous example we used only one hidden layer, and in this we will use two. From this it should be quite +clear how to build one using an arbitrary number of hidden layers, using data structures such as Python lists or +NumPy arrays. + +!split +===== Tensorflow ===== + +Tensorflow is an open source library machine learning library +developed by the Google Brain team for internal use. It was released +under the Apache 2.0 open source license in November 9, 2015. + +Tensorflow is a computational framework that allows you to construct +machine learning models at different levels of abstraction, from +high-level, object-oriented APIs like Keras, down to the C++ kernels +that Tensorflow is built upon. The higher levels of abstraction are +simpler to use, but less flexible, and our choice of implementation +should reflect the problems we are trying to solve. + +"Tensorflow uses":"https://www.tensorflow.org/guide/graphs" so-called graphs to represent your computation +in terms of the dependencies between individual operations, such that you first build a Tensorflow *graph* +to represent your model, and then create a Tensorflow *session* to run the graph. + +In this guide we will analyze the same data as we did in our NumPy and +scikit-learn tutorial, gathered from the MNIST database of images. We +will give an introduction to the lower level Python Application +Program Interfaces (APIs), and see how we use them to build our graph. +Then we will build (effectively) the same graph in Keras, to see just +how simple solving a machine learning problem can be. + +To install tensorflow on Unix/Linux systems, use pip as +!bc pycod +pip3 install tensorflow +!ec +and/or if you use _anaconda_, just write (or install from the graphical user interface) +!bc pycod +conda install tensorflow +!ec + +!split +===== Collect and pre-process data ===== + +!bc pycod +# 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() +!ec + +!bc pycod +from keras.utils import to_categorical +from sklearn.model_selection import train_test_split + +# one-hot representation of labels +labels = to_categorical(labels) + +# split into train and test data +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) +!ec + +!split +===== Using TensorFlow backend ===== + +o Define model and architecture +o Choose cost function and optimizer + +!bc pycod +import tensorflow as tf + +class NeuralNetworkTensorflow: + def __init__( + self, + X_train, + Y_train, + X_test, + Y_test, + n_neurons_layer1=100, + n_neurons_layer2=50, + n_categories=2, + epochs=10, + batch_size=100, + eta=0.1, + lmbd=0.0): + + # keep track of number of steps + self.global_step = tf.Variable(0, dtype=tf.int32, trainable=False, name='global_step') + + self.X_train = X_train + self.Y_train = Y_train + self.X_test = X_test + self.Y_test = Y_test + + self.n_inputs = X_train.shape[0] + self.n_features = X_train.shape[1] + self.n_neurons_layer1 = n_neurons_layer1 + self.n_neurons_layer2 = n_neurons_layer2 + 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 + + # build network piece by piece + # name scopes (with) are used to enforce creation of new variables + # https://www.tensorflow.org/guide/variables + self.create_placeholders() + self.create_DNN() + self.create_loss() + self.create_optimiser() + self.create_accuracy() + + def create_placeholders(self): + # placeholders are fine here, but "Datasets" are the preferred method + # of streaming data into a model + with tf.name_scope('data'): + self.X = tf.placeholder(tf.float32, shape=(None, self.n_features), name='X_data') + self.Y = tf.placeholder(tf.float32, shape=(None, self.n_categories), name='Y_data') + + def create_DNN(self): + with tf.name_scope('DNN'): + # the weights are stored to calculate regularization loss later + + # Fully connected layer 1 + self.W_fc1 = self.weight_variable([self.n_features, self.n_neurons_layer1], name='fc1', dtype=tf.float32) + b_fc1 = self.bias_variable([self.n_neurons_layer1], name='fc1', dtype=tf.float32) + a_fc1 = tf.nn.sigmoid(tf.matmul(self.X, self.W_fc1) + b_fc1) + + # Fully connected layer 2 + self.W_fc2 = self.weight_variable([self.n_neurons_layer1, self.n_neurons_layer2], name='fc2', dtype=tf.float32) + b_fc2 = self.bias_variable([self.n_neurons_layer2], name='fc2', dtype=tf.float32) + a_fc2 = tf.nn.sigmoid(tf.matmul(a_fc1, self.W_fc2) + b_fc2) + + # Output layer + self.W_out = self.weight_variable([self.n_neurons_layer2, self.n_categories], name='out', dtype=tf.float32) + b_out = self.bias_variable([self.n_categories], name='out', dtype=tf.float32) + self.z_out = tf.matmul(a_fc2, self.W_out) + b_out + + def create_loss(self): + with tf.name_scope('loss'): + softmax_loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits_v2(labels=self.Y, logits=self.z_out)) + + regularizer_loss_fc1 = tf.nn.l2_loss(self.W_fc1) + regularizer_loss_fc2 = tf.nn.l2_loss(self.W_fc2) + regularizer_loss_out = tf.nn.l2_loss(self.W_out) + regularizer_loss = self.lmbd*(regularizer_loss_fc1 + regularizer_loss_fc2 + regularizer_loss_out) + + self.loss = softmax_loss + regularizer_loss + + def create_accuracy(self): + with tf.name_scope('accuracy'): + probabilities = tf.nn.softmax(self.z_out) + predictions = tf.argmax(probabilities, axis=1) + labels = tf.argmax(self.Y, axis=1) + + correct_predictions = tf.equal(predictions, labels) + correct_predictions = tf.cast(correct_predictions, tf.float32) + self.accuracy = tf.reduce_mean(correct_predictions) + + def create_optimiser(self): + with tf.name_scope('optimizer'): + self.optimizer = tf.train.GradientDescentOptimizer(learning_rate=self.eta).minimize(self.loss, global_step=self.global_step) + + def weight_variable(self, shape, name='', dtype=tf.float32): + initial = tf.truncated_normal(shape, stddev=0.1) + return tf.Variable(initial, name=name, dtype=dtype) + + def bias_variable(self, shape, name='', dtype=tf.float32): + initial = tf.constant(0.1, shape=shape) + return tf.Variable(initial, name=name, dtype=dtype) + + def fit(self): + data_indices = np.arange(self.n_inputs) + + with tf.Session() as sess: + sess.run(tf.global_variables_initializer()) + for i in range(self.epochs): + for j in range(self.iterations): + chosen_datapoints = np.random.choice(data_indices, size=self.batch_size, replace=False) + batch_X, batch_Y = self.X_train[chosen_datapoints], self.Y_train[chosen_datapoints] + + sess.run([DNN.loss, DNN.optimizer], + feed_dict={DNN.X: batch_X, + DNN.Y: batch_Y}) + accuracy = sess.run(DNN.accuracy, + feed_dict={DNN.X: batch_X, + DNN.Y: batch_Y}) + step = sess.run(DNN.global_step) + + self.train_loss, self.train_accuracy = sess.run([DNN.loss, DNN.accuracy], + feed_dict={DNN.X: self.X_train, + DNN.Y: self.Y_train}) + + self.test_loss, self.test_accuracy = sess.run([DNN.loss, DNN.accuracy], + feed_dict={DNN.X: self.X_test, + DNN.Y: self.Y_test}) +!ec + + +!split +===== Optimizing and using gradient descent ===== + +!bc pycod +epochs = 100 +batch_size = 100 +n_neurons_layer1 = 100 +n_neurons_layer2 = 50 +n_categories = 10 +eta_vals = np.logspace(-5, 1, 7) +lmbd_vals = np.logspace(-5, 1, 7) +!ec + + +!bc pycod +DNN_tf = 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 = NeuralNetworkTensorflow(X_train, Y_train, X_test, Y_test, + n_neurons_layer1, n_neurons_layer2, n_categories, + epochs=epochs, batch_size=batch_size, eta=eta, lmbd=lmbd) + DNN.fit() + + DNN_tf[i][j] = DNN + + print("Learning rate = ", eta) + print("Lambda = ", lmbd) + print("Test accuracy: %.3f" % DNN.test_accuracy) + print() +!ec + +!bc pycod +# optional +# visual representation of grid search +# uses seaborn heatmap, could probably do this in matplotlib +import seaborn as sns + +sns.set() + +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals))) +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_tf[i][j] + + train_accuracy[i][j] = DNN.train_accuracy + test_accuracy[i][j] = DNN.test_accuracy + + +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() +!ec + +!bc pycod +# optional +# we can use log files to visualize our graph in Tensorboard +writer = tf.summary.FileWriter('logs/') +writer.add_graph(tf.get_default_graph()) +!ec + + +!split +===== Using Keras ===== + +Keras is a high level "neural network":"https://en.wikipedia.org/wiki/Application_programming_interface" +that supports Tensorflow, CTNK and Theano as backends. +If you have Tensorflow installed Keras is available through the *tf.keras* module. +If you have Anaconda installed you may run the following command +!bc pycod +conda install keras +!ec + +Alternatively, if you have Tensorflow or one of the other supported backends install you may use the pip package manager: + +!bc pycod +pip3 install keras +!ec +or look up the "instructions here":"https://keras.io/". + +!bc pycod +from keras.models import Sequential +from keras.layers import Dense +from keras.regularizers import l2 +from keras.optimizers import SGD + +def create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories, eta, lmbd): + model = Sequential() + model.add(Dense(n_neurons_layer1, activation='sigmoid', kernel_regularizer=l2(lmbd))) + model.add(Dense(n_neurons_layer2, activation='sigmoid', kernel_regularizer=l2(lmbd))) + model.add(Dense(n_categories, activation='softmax')) + + sgd = SGD(lr=eta) + model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy']) + + return model +!ec + +!bc pycod +DNN_keras = 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 = create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories, + eta=eta, lmbd=lmbd) + DNN.fit(X_train, Y_train, epochs=epochs, batch_size=batch_size, verbose=0) + scores = DNN.evaluate(X_test, Y_test) + + DNN_keras[i][j] = DNN + + print("Learning rate = ", eta) + print("Lambda = ", lmbd) + print("Test accuracy: %.3f" % scores[1]) + print() +!ec + +!bc pycod +# optional +# visual representation of grid search +# uses seaborn heatmap, could probably do this in matplotlib +import seaborn as sns + +sns.set() + +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals))) +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_keras[i][j] + + train_accuracy[i][j] = DNN.evaluate(X_train, Y_train)[1] + test_accuracy[i][j] = DNN.evaluate(X_test, Y_test)[1] + + +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() +!ec + + + + +!split +===== Which activation function should I use? ===== + +The Back propagation algorithm we derived above works by going from +the output layer to the input layer, propagating the error gradient on +the way. Once the algorithm has computed the gradient of the cost +function with regards to each parameter in the network, it uses these +gradients to update each parameter with a Gradient Descent (GD) step. + + +Unfortunately for us, the gradients often get smaller and smaller as the +algorithm progresses down to the first hidden layers. As a result, the +GD update leaves the lower layer connection weights +virtually unchanged, and training never converges to a good +solution. This is known in the literature as +_the vanishing gradients problem_. + +In other cases, the opposite can happen, namely the the gradients can grow bigger and +bigger. The result is that many of the layers get large updates of the +weights the +algorithm diverges. This is the _exploding gradients problem_, which is +mostly encountered in recurrent neural networks. More generally, deep +neural networks suffer from unstable gradients, different layers may +learn at widely different speeds + +!split +===== Is the Logistic activation function (Sigmoid) our choice? ===== + +Although this unfortunate behavior has been empirically observed for +quite a while (it was one of the reasons why deep neural networks were +mostly abandoned for a long time), it is only around 2010 that +significant progress was made in understanding it. + +A paper titled "Understanding the Difficulty of Training Deep +Feedforward Neural Networks by Xavier Glorot and Yoshua Bengio":"http://proceedings.mlr.press/v9/glorot10a.html" found that +the problems with the popular logistic +sigmoid activation function and the weight initialization technique +that was most popular at the time, namely random initialization using +a normal distribution with a mean of 0 and a standard deviation of +1. + +They showed that with this activation function and this +initialization scheme, the variance of the outputs of each layer is +much greater than the variance of its inputs. Going forward in the +network, the variance keeps increasing after each layer until the +activation function saturates at the top layers. This is actually made +worse by the fact that the logistic function has a mean of 0.5, not 0 +(the hyperbolic tangent function has a mean of 0 and behaves slightly +better than the logistic function in deep networks). + + +!split +===== The derivative of the Logistic funtion ===== + +Looking at the logistic activation function, when inputs become large +(negative or positive), the function saturates at 0 or 1, with a +derivative extremely close to 0. Thus when backpropagation kicks in, +it has virtually no gradient to propagate back through the network, +and what little gradient exists keeps getting diluted as +backpropagation progresses down through the top layers, so there is +really nothing left for the lower layers. + +In their paper, Glorot and Bengio propose a way to significantly +alleviate this problem. We need the signal to flow properly in both +directions: in the forward direction when making predictions, and in +the reverse direction when backpropagating gradients. We don’t want +the signal to die out, nor do we want it to explode and saturate. For +the signal to flow properly, the authors argue that we need the +variance of the outputs of each layer to be equal to the variance of +its inputs, and we also need the gradients to have equal variance +before and after flowing through a layer in the reverse direction. + + + +One of the insights in the 2010 paper by Glorot and Bengio was that +the vanishing/exploding gradients problems were in part due to a poor +choice of activation function. Until then most people had assumed that +if Nature had chosen to use roughly sigmoid activation functions in +biological neurons, they must be an excellent choice. But it turns out +that other activation functions behave much better in deep neural +networks, in particular the ReLU activation function, mostly because +it does not saturate for positive values (and also because it is quite +fast to compute). + + +!split +===== The RELU function family ===== + +The ReLU activation function suffers from a problem known as the dying +ReLUs: during training, some neurons effectively die, meaning they +stop outputting anything other than 0. + +In some cases, you may find that half of your network’s neurons are +dead, especially if you used a large learning rate. During training, +if a neuron’s weights get updated such that the weighted sum of the +neuron’s inputs is negative, it will start outputting 0. When this +happen, the neuron is unlikely to come back to life since the gradient +of the ReLU function is 0 when its input is negative. + +To solve this problem, nowadays practitioners use a variant of the ReLU +function, such as the leaky ReLU discussed above or the so-called +exponential linear unit (ELU) function + + +!bt +\[ +ELU(z) = \left\{\begin{array}{cc} \alpha\left( \exp{(z)}-1\right) & z < 0,\\ z & z \ge 0.\end{array}\right. +\] +!et + +!split +===== Which activation function should we use? ===== + +In general it seems that the ELU activation function is better than +the leaky ReLU function (and its variants), which is better than +ReLU. ReLU performs better than $\tanh$ which in turn performs better +than the logistic function. + +If runtime +performance is an issue, then you may opt for the leaky ReLU function over the +ELU function If you don’t +want to tweak yet another hyperparameter, you may just use the default +$\alpha$ of $0.01$ for the leaky ReLU, and $1$ for ELU. If you have +spare time and computing power, you can use cross-validation or +bootstrap to evaluate other activation functions. + + +!split +===== A top-down perspective on Neural networks ===== + + +The first thing we would like to do is divide the data into two or three +parts. A training set, a validation or dev (development) set, and a +test set. The test set is the data on which we want to make +predictions. The dev set is a subset of the training data we use to +check how well we are doing out-of-sample, after training the model on +the training dataset. We use the validation error as a proxy for the +test error in order to make tweaks to our model. It is crucial that we +do not use any of the test data to train the algorithm. This is a +cardinal sin in ML. Then: + + +* Estimate optimal error rate + +* Minimize underfitting (bias) on training data set. + +* Make sure you are not overfitting. + +If the validation and test sets are drawn from the same distributions, +then a good performance on the validation set should lead to similarly +good performance on the test set. + +However, sometimes +the training data and test data differ in subtle ways because, for +example, they are collected using slightly different methods, or +because it is cheaper to collect data in one way versus another. In +this case, there can be a mismatch between the training and test +data. This can lead to the neural network overfitting these small +differences between the test and training sets, and a poor performance +on the test set despite having a good performance on the validation +set. To rectify this, Andrew Ng suggests making two validation or dev +sets, one constructed from the training data and one constructed from +the test data. The difference between the performance of the algorithm +on these two validation sets quantifies the train-test mismatch. This +can serve as another important diagnostic when using DNNs for +supervised learning. + +!split +===== Limitations of supervised learning with deep networks ===== + +Like all statistical methods, supervised learning using neural +networks has important limitations. This is especially important when +one seeks to apply these methods, especially to physics problems. Like +all tools, DNNs are not a universal solution. Often, the same or +better performance on a task can be achieved by using a few +hand-engineered features (or even a collection of random +features). + +Here we list some of the important limitations of supervised neural network based models. + + + +* _Need labeled data_. All supervised learning methods, DNNs for supervised learning require labeled data. Often, labeled data is harder to acquire than unlabeled data (e.g. one must pay for human experts to label images). +* _Supervised neural networks are extremely data intensive._ DNNs are data hungry. They perform best when data is plentiful. This is doubly so for supervised methods where the data must also be labeled. The utility of DNNs is extremely limited if data is hard to acquire or the datasets are small (hundreds to a few thousand samples). In this case, the performance of other methods that utilize hand-engineered features can exceed that of DNNs. +* _Homogeneous data._ Almost all DNNs deal with homogeneous data of one type. It is very hard to design architectures that mix and match data types (i.e.~some continuous variables, some discrete variables, some time series). In applications beyond images, video, and language, this is often what is required. In contrast, ensemble models like random forests or gradient-boosted trees have no difficulty handling mixed data types. +* _Many problems are not about prediction._ In natural science we are often interested in learning something about the underlying distribution that generates the data. In this case, it is often difficult to cast these ideas in a supervised learning setting. While the problems are related, it is possible to make good predictions with a *wrong* model. The model might or might not be useful for understanding the underlying science. + +Some of these remarks are particular to DNNs, others are shared by all supervised learning methods. This motivates the use of unsupervised methods which in part circumvent these problems. + + + + + + !split ===== Convolutional Neural Networks (recognizing images) =====