{ "cells": [ { "cell_type": "markdown", "id": "76bc35cd", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Neural Networks\n", "\n", "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/git/https%3A%2F%2Fgitlab.in2p3.fr%2Fenergy4climate%2Fpublic%2Feducation%2Fmachine_learning_for_climate_and_energy/master?filepath=book%2Fnotebooks%2F10_neural_networks.ipynb)" ] }, { "cell_type": "markdown", "id": "bf385f06", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "
\n", " Prerequisites\n", "
\n", " \n", "- Matrix calculus\n", "- Ordinary least squares\n", "- Classification\n", " \n", "
" ] }, { "cell_type": "markdown", "id": "14edfd21", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "
\n", " Learning Outcomes\n", "
\n", "\n", "- Understand the neural network formalism.\n", "- Program a gradient descent algorithm with backpropagation to optimize a neural network. \n", "- Train and test a neural network. \n", " \n", "
" ] }, { "cell_type": "markdown", "id": "2948ff71", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Introduction" ] }, { "cell_type": "markdown", "id": "53388962", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Objective\n", "\n", "- Review the architecture of neural networks.\n", "- Build a neural network from scratch in order to study each component. " ] }, { "cell_type": "markdown", "id": "cc44398f", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Case study\n", "\n", "- **Goal:** recognize hand-written digits from the [MNIST](http://yann.lecun.com/exdb/mnist/) dataset.\n", "- **Dataset:**\n", " - 70000 images of hand-written digits (from 0 to 9) collected in an American administration.\n", " - Small and clean with well identified categories (hence its popularity in machine learning).\n", " - Why? We have not yet found an equivalent dataset in climate/energy science that is small enough to quickly build and test our programs." ] }, { "cell_type": "markdown", "id": "d2a69532", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Here is an example of a sequence of numbers from this dataset:\n", "\n", "\"weather\"\n", "\n", "**Figure:** 28 x 28 pixels images of handwritten numbers from 0 to 9. Author: Suvanjanprasai. License: [CC BY-SA](https://creativecommons.org/licenses/by-sa/4.0/deed.en).\n", "\n" ] }, { "cell_type": "markdown", "id": "7e91f51b", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "In this figure:\n", "- One has no issue recognizing each digit: for each image, we immediately attach a label to our visual impression.\n", "- Yet, the task of writing a computer program that is able to identify each individual image seems complicated.\n", "- Each digit can indeed be written in many different ways and there are no clear logical instructions on how to proceed to identify the digit pattern.\n", "\n", "The following code cells read and plot the MNIST data." ] }, { "cell_type": "code", "execution_count": 1, "id": "575f3c1a", "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "import gzip\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from pathlib import Path\n", "\n", "# MNIST image size\n", "MNIST_IM_SIZE = 28\n", "\n", "# MNIST directory\n", "DIR_MNIST = Path('data', 'mnist')\n", "\n", "# MNIST training set configuration\n", "N_TRAIN = 60000\n", "FILE_TRAIN_IMAGES = 'train-images-idx3-ubyte.gz'\n", "FILE_TRAIN_LABELS = 'train-labels-idx1-ubyte.gz'\n", "\n", "# MNIST test set configuration\n", "N_TEST = 10000\n", "FILE_TEST_IMAGES = 't10k-images-idx3-ubyte.gz'\n", "FILE_TEST_LABELS = 't10k-labels-idx1-ubyte.gz'" ] }, { "cell_type": "code", "execution_count": 2, "id": "7235cb04", "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "def load_mnist_images(filename, num_images, mnist_im_size=MNIST_IM_SIZE):\n", " '''\n", " return flatten images\n", " '''\n", " f = gzip.open(filename,'r')\n", " f.read(16)\n", " buf = f.read(num_images * mnist_im_size**2)\n", " images = np.frombuffer(buf, dtype=np.uint8) / 255.\n", " images = images.reshape(num_images, mnist_im_size**2)\n", " f.close()\n", "\n", " return images\n", "\n", "def load_mnist_labels(filename, num_labels):\n", "\n", " f = gzip.open(filename, 'r')\n", " f.read(8)\n", " buf = f.read(num_labels)\n", " labels = np.frombuffer(buf, dtype=np.uint8).astype(np.int64)\n", " f.close()\n", " \n", " return labels\n", "\n", "def plot_mnist_image(image, cmap=plt.cm.gray_r):\n", " n_side = int(np.sqrt(len(image)))\n", " plt.figure()\n", " plt.imshow(image.reshape((n_side, n_side)), cmap=cmap)" ] }, { "cell_type": "code", "execution_count": 3, "id": "e8d041da", "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "# Read training set\n", "X_train = load_mnist_images(Path(DIR_MNIST, FILE_TRAIN_IMAGES), N_TRAIN)\n", "y_train = load_mnist_labels(Path(DIR_MNIST, FILE_TRAIN_LABELS), N_TRAIN)\n", "\n", "# Read test set\n", "X_test = load_mnist_images(Path(DIR_MNIST, FILE_TEST_IMAGES), N_TEST)\n", "y_test = load_mnist_labels(Path(DIR_MNIST, FILE_TEST_LABELS), N_TEST)" ] }, { "cell_type": "code", "execution_count": 4, "id": "7ef1c805", "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaEAAAGdCAYAAAC7EMwUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAatklEQVR4nO3dfWiV9/3/8dfR6qm1yWGZJudkpiGUyIaKmzf1ZlWjw2BGrdYWYktHZExsjW4SRWbdMKvFiKNiIav7rgynW1NlYK1Uqc3QxBbratO4BlesxTgzTBZ0NidGd4L18/tDPL8eE2+u4zm+c06eD7jAc53rneudyw/n5cfr5vicc04AABgYYN0AAKD/IoQAAGYIIQCAGUIIAGCGEAIAmCGEAABmCCEAgBlCCABg5gHrBm527do1nTt3ThkZGfL5fNbtAAA8cs6ps7NTubm5GjDg9nOdPhdC586dU15ennUbAIB71NLSohEjRtx2mz4XQhkZGZKuN5+ZmWncDQDAq3A4rLy8vOjn+e0kLYRef/11/fa3v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/68vv76a+Xk5MSsz8nJUVtbm1FX99+kSZO0Y8cOHThwQG+88Yba2to0depUXbhwwbo1Mzf+/vv72JCkkpISvfnmmzp48KBeffVVHTt2TLNmzVIkErFuLSmcc6qoqNDjjz+u0aNHS+qf46G34yClznjoc0/Rvp2bv9rBOddjXTorKSmJ/nnMmDGaMmWKHn30UW3fvl0VFRWGndnr72NDkkpLS6N/Hj16tCZMmKD8/Hzt27dPCxYsMOwsOZYtW6bPPvtMH374YY/3+tN4uNVxSJXxkBIzoWHDhmngwIE9/iXT3t7e4188/cnQoUM1ZswYnTp1yroVMzeuDmRs9BQKhZSfn5+W42P58uXau3evDh06FPPVL/1tPNzqOPSmr46HlAihwYMHa/z48aqtrY1ZX1tbq6lTpxp1ZS8Siejzzz9XKBSybsVMQUGBgsFgzNjo7u5WfX19vx4bknThwgW1tLSk1fhwzmnZsmXavXu3Dh48qIKCgpj3+8t4uNNx6E2fHQ+GF0V4snPnTjdo0CD3xz/+0f3zn/90K1ascEOHDnVnzpyxbu2+Wblypaurq3OnT592R48edU888YTLyMhI+2PQ2dnpGhsbXWNjo5PkNm/e7BobG92//vUv55xzGzdudIFAwO3evds1NTW5Z5991oVCIRcOh407T6zbHYfOzk63cuVKd+TIEdfc3OwOHTrkpkyZ4r7zne+k1XF48cUXXSAQcHV1da61tTW6XL58ObpNfxgPdzoOqTQeUiaEnHPud7/7ncvPz3eDBw9248aNi7kcsT8oLS11oVDIDRo0yOXm5roFCxa4EydOWLeVdIcOHXKSeixlZWXOueuX5a5bt84Fg0Hn9/vd9OnTXVNTk23TSXC743D58mVXXFzshg8f7gYNGuQeeeQRV1ZW5s6ePWvddkL19vtLctu2bYtu0x/Gw52OQyqNB77KAQBgJiXOCQEA0hMhBAAwQwgBAMwQQgAAM4QQAMAMIQQAMEMIAQDMEEIAADOEEADADCEEADBDCAEAzBBCAAAz/w/T1GfDQy2TBQAAAABJRU5ErkJggg==", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "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zcOdf7WO7GjRtdKBRyfr/fzZ0717W0tNg2nQL3G4cvv/zSlZSUuHHjxrlRo0a5xx9/3JWXl7tLly5Zt51U/X3/klxNTU3snOFwPzxoHNLpfuBXOQAAzKTFe0IAgKGJEAIAmCGEAABmCCEAgBlCCABghhACAJghhAAAZgghAIAZQggAYIYQAgCYIYQAAGYIIQCAmf8DCl7wkhoLFHUAAAAASUVORK5CYII=", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plot examples of 0 and 9\n", "plot_mnist_image(X_train[1])\n", "plot_mnist_image(X_train[4])" ] }, { "cell_type": "markdown", "id": "6050037d", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Supervised-learning approach\n", "\n", "- **Classification problem:** Learn the patterns from a training set made of couples of an image and a number between 0 and 9 ($K = 10$).\n", "- **Discriminative model:** Directly predict the probability $P(C = k | \\boldsymbol X = \\boldsymbol x)$ to observe a $k$th digit given the image $\\boldsymbol x$.\n", "\n", "The function to estimate is thus,\n", "\n", "\\begin{equation}\n", "\\boldsymbol y = f(\\boldsymbol x),\n", "\\end{equation}\n", "\n", "where $\\boldsymbol y$ is a $K$-dimensional vector such that its $k$th element corresponds to the probability $P(C = k | \\boldsymbol X = \\boldsymbol x)$ (see [Classification II: Discriminative models\n", "](07_classification_discriminative.ipynb))." ] }, { "cell_type": "markdown", "id": "54ae3c1f", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "In the example of handwritten digits:\n", "- $\\boldsymbol x$ is a multivariate vector that contains the grayscale value of each pixel of the image.\n", "- Each image of this dataset is 28 pixels by 28 pixels and so each vector of the input space has dimension $p =784$.\n", "- The convention that 0 is white and 1 is black is followed.\n", "- Any value between 0 and 1 corresponds to some level of gray." ] }, { "cell_type": "markdown", "id": "44b351fa", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "
\n", " Warning\n", " \n", "This dataset is interesting for teaching purposes but it may also convey the idea that neural networks are simple and always work.\n", " \n", "Dealing with more serious machine learning problems, one soon realizes that datasets tend to be more complex.\n", "
" ] }, { "cell_type": "markdown", "id": "143c0ec3", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Building blocks of Neural Networks" ] }, { "cell_type": "markdown", "id": "9a02f79c", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Neurons\n", "\n", "In neural network terminology:\n", "- $\\boldsymbol x$ is the the input layer;\n", "- each component of $\\boldsymbol x$ is a *neuron*;\n", "- the numerical value held by the neuron is a real number called the *activation*;\n", "- a neuron is *active* (resp. *inactive*) when it holds a positive (resp. non-positive) value.\n", "\n", "Here, the activation of the input layer corresponds to the grayscale value of the corresponding pixel on the image: white pixels have activation equal to zero and black pixels have activation equal to 1." ] }, { "cell_type": "markdown", "id": "950c0468", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "#### The MNIST input layer\n", "\n", "\"weather\"\n", "\n", "\\begin{align}\n", " \\boldsymbol{x} &=\n", " \\begin{pmatrix}\n", " x_0 \\\\\n", " x_1 \\\\\n", " x_2 \\\\\n", " \\vdots \\\\\n", " x_{p - 1} \\\\\n", " \\end{pmatrix}\n", "\\end{align}\n", "\n" ] }, { "cell_type": "markdown", "id": "5f439702", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "#### The MNIST output layer\n", "\n", "The values of the neurons of the output layer $\\boldsymbol y$ can be interpreted as the probabilities of each class given the input.\n", "\n", "In the MNIST example, the $k$th class corresponds to the digit $k - 1$). For instance, if\n", "$$\n", "\\boldsymbol y^\\top = \\left(0.01, 0.9, 0.2, 0.1, 0.05, 0.09, 0.05, 0.03, 0.25, 0.1\\right)\n", "$$\n", "the most probable digit is $k = 1$ (the second class).\n", "\n", "
\n", " Remark\n", " \n", "The output does not have to be between 0 and 1. In that case, one simply selects the neuron that is the most active.\n", "
\n", "\n" ] }, { "cell_type": "markdown", "id": "83b2d2f0", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "#### The simplest neural network for the MNIST example\n", "\n", "\"weather\"\n", "\n", "The simplest neural network that one can build for this problem is represented in the following figure (mind the differences in notations with this course).\n", "\n", "Each link represents a contribution of an input to an output.\n", "\n", "Here, each contribution is linear because no activation function has been applied yet.\n", "\n", "Thus, in this network, all outputs are linear combinations of all features." ] }, { "cell_type": "markdown", "id": "bc6b98f3", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### A two-layer linear network\n", "\n", "In the simplest construction, the outputs are linear functions of the inputs, so that\n", "\n", "\\begin{equation}\n", "\\hat y_k = \\sum_{j = 1}^{p} w_{kj} x_j + b_k,\n", "\\end{equation}\n", "\n", "for some matrix $\\boldsymbol W$ with elements $w_{kj}$, or *weights*, and some vector $\\boldsymbol b$ with elements $b_k$, or *biases*, for $0 \\le k \\le K -1 $ and $1 \\le j \\le p$.\n", "\n", "\n", "In matrix form,\n", "\n", "\\begin{equation}\n", "\\hat {\\boldsymbol y} = \\boldsymbol W \\boldsymbol x + \\boldsymbol b.\n", "\\end{equation}" ] }, { "cell_type": "markdown", "id": "3fbd5418", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "This is a linear regression model with multiple outputs applied to classification.\n", "\n", "If we use the Mean-Squared Error (MSE) as loss function, this is just an Ordinary Least Squares (OLS) problem.\n", "\n", "
\n", " Remark\n", " \n", "More layers could be added to this two-layer linear model.\n", "\n", "However, since a linear function of a linear function is itself linear, the resulting model would linearly link all outputs to all inputs and thus be equivalent to the two-layer linear model.\n", "
" ] }, { "cell_type": "markdown", "id": "76db83b5", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### From a linear model to a non-linear model\n", "\n", "- Non-linear functions are now applied to the linear combination of the features.\n", "- These functions are referred to as *activation function*, since their role is to turn on or off a neuron, and the value they return (the state of the neuron) as the *activation*.\n", "- Their role is crucial since their non-linearity is what distinguishes a linear model that is able to represent linear relationships only from a neural network that can capture nonlinear interactions between features and combinations of features.\n", "\n", "Let us introduce some possible activation functions (see [Table of activation functions on Wikipedia](https://en.wikipedia.org/wiki/Activation_function#Table_of_activation_functions) for other examples)." ] }, { "cell_type": "markdown", "id": "e22d2e30", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "#### Heaviside distribution\n", "\n", "The Heaviside distribution (or step function, or binary step) is defined as\n", "\n", "\\begin{equation}\n", "f(x)={\\begin{cases}1,&x>0\\\\0,&x\\leq 0\\end{cases}}\n", "\\end{equation}\n", "\n", "If we apply this function to the weighted sum, we then get a binary neuron: its activation state is either 0 or 1.\n", "\n", "In neural network terminology, the association of the weighted sum and Heaviside activation function is called a *perceptron*." ] }, { "cell_type": "markdown", "id": "e6bba5f8", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "---\n", "**Perceptron**\n", "\n", "A perceptron is a function that maps an input vector $\\boldsymbol x$ to a single binary value depending on the value of the affine transformation of $\\boldsymbol x$:\n", "\n", "\\begin{equation}\n", "f(\\boldsymbol x) =\n", "\\begin{cases}\n", " 1 & {\\text{if }}\\ \\boldsymbol w_k^\\top \\boldsymbol x + b_k > 0\\\\\n", " 0 & {\\text{otherwise}}.\n", "\\end{cases}\n", "\\end{equation}\n", "\n", "---\n", "\n", "In this case, the activation state of a neuron can only be 0 or 1." ] }, { "cell_type": "markdown", "id": "32b2a61c", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "For multiple classes, we can set the output of the perceptron to the class label for the largest $\\boldsymbol w_k \\boldsymbol x + b_k$.\n", "\n", "We then have a single output $\\hat{y}$ taking as many values as class labels.\n", "\n", "We are left with an optimization problem where we need to adjust these weights and biases to minimize the error in the image recognition." ] }, { "cell_type": "markdown", "id": "d50be2cf", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "> ***Question***\n", "> - For this simple network, do you have an intuition for how the weights should combine to recognize a \"0\"? a \"9\"? (again think of the perceptron as a weighted sum)\n", "\n", "Let's check it with scikit-learn. For now we will let scikit-learn handle all the heavy lifting (i.e. finding the best set of weights and biases)" ] }, { "cell_type": "code", "execution_count": 9, "id": "7b93f547", "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "from sklearn.linear_model import Perceptron\n", "\n", "clf = Perceptron(tol=1e-3, random_state=0)\n", "clf.fit(X_train, y_train)\n", "train_score = clf.score(X_train, y_train)" ] }, { "cell_type": "code", "execution_count": 6, "id": "c9342dde", "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Train score (% of correct classification): 89 %\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaEAAAGdCAYAAAC7EMwUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAjjklEQVR4nO3de2zV9f3H8dcB2mPBcqBCb1K6Oi4qZSgXQS4KXho7ZUOcAU0WSDaickkYGifjD8mSUeMmYRmTbcYx2GASIyALTKxCiw7rEEEZA4JQoEhroUIvXFrafn9/EPpb5fr+2NNPL89HchJ6zvfF99MvX/riyznnfUJBEAQCAMCDDr4XAABovyghAIA3lBAAwBtKCADgDSUEAPCGEgIAeEMJAQC8oYQAAN508r2Ab6qvr9exY8cUHx+vUCjkezkAAKMgCFRZWanU1FR16HD1a50WV0LHjh1TWlqa72UAAL6loqIi9erV66rbtLgSio+PlyRNnDhRMTExnlcDALA6f/68Vq9e3fDz/GqiVkKvvvqqfv3rX6u4uFgDBgzQokWLNGbMmGvmLv4XXExMjGJjY6O1PABAlF3PUypReWHCqlWrNHv2bM2bN087duzQmDFjlJ2drSNHjkRjdwCAVioqJbRw4UL95Cc/0U9/+lPddtttWrRokdLS0rRkyZJo7A4A0Eo1eQnV1NRo+/btysrKanR/VlaWtm7desn21dXVqqioaHQDALQPTV5CJ06cUF1dnZKSkhrdn5SUpJKSkku2z8nJUSQSabjxyjgAaD+i9mbVbz4hFQTBZZ+kmjt3rsrLyxtuRUVF0VoSAKC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b1pXOw6VlZXBs88+G2zdujUoLCwMNm/eHNx9993BzTff3KaOwzPPPBNEIpEgLy8vKC4ubridOXOmYZv2cD5c6zi0pvOh1ZRQEATB73//+yA9PT2IjY0NBg8e3OjliO3BpEmTgpSUlCAmJiZITU0NJk6cGOzevdv3sqJu8+bNgaRLblOmTAmC4MLLcl988cUgOTk5CIfDwT333BPs2rXL76Kj4GrH4cyZM0FWVlbQs2fPICYmJujdu3cwZcqU4MiRI76X3aQu9/1LCpYuXdqwTXs4H651HFrT+cBHOQAAvGkVzwkBANomSggA4A0lBADwhhICAHhDCQEAvKGEAADeUEIAAG8oIQCAN5QQAMAbSggA4A0lBADwhhICAHjzfzIaJpZ8qd69AAAAAElFTkSuQmCC", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaEAAAGdCAYAAAC7EMwUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAjzklEQVR4nO3dbXBU9f3+8SsJYQlpiISQbCIhRrlTglpuBFJAoJghCi1iW9QZCzPV0QrOUHQcqTOV6QPD0JEfD1Da2g6FVirTqVgqKIYioYooIgoKSNQoQRIjEbIBwgbI+T9gyL+RG/l8zeabm/drZmfI5lycb05OuDjZ3c/GBUEQCAAAD+J9LwAA0HlRQgAAbyghAIA3lBAAwBtKCADgDSUEAPCGEgIAeEMJAQC86eJ7Ad/U2NioQ4cOKSUlRXFxcb6XAwAwCoJAdXV1ys7OVnz8pa912lwJHTp0SDk5Ob6XAQD4jioqKtSnT59LbtPmSiglJUWS9Ktf/UqhUMjzagAAVtFoVP/3f//X9O/5pcSshJ555hn97ne/U2VlpQYPHqwlS5Zo7Nix35o79yu4UChECQFAO3Y5D6nE5IkJq1ev1ty5c/X4449r586dGjt2rIqKinTgwIFY7A4A0E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WUVERiyUBANqgFn2x6rkXSlZVVSkrK6vp/urq6vOujs4JhUIKhUItuQwAQDvRoldCeXl5CofDKikpabqvoaFBpaWlKigoaMldAQA6APOV0LFjx/Txxx83fVxeXq733ntPaWlp6tu3r+bOnasnn3xS/fv3V//+/fXkk0+qe/fuuvvuu1t04QCA9s9cQu+8844mTJjQ9PG8efMkSTNnztRf/vIXPfroo6qvr9eDDz6oI0eOaOTIkXr11Ved5ikBADq2uMAyaa4VRCIRpaam6rHHHjM9VuQylO+qq64yZySpW7du5sznn3/eKpmePXuaM2+99ZY5I7mtb+DAgeZMdna2OXP8+HFzRpJ69+7dZjOrV682ZwYMGGDOSNInn3xiztx0001O+7L6wx/+YM64DD2VpO7du5szP//5z82Zq6++2pyxDhU9Z//+/eaM9Xw4efKkFi5cqNraWvXo0eOS2zI7DgDgDSUEAPCGEgIAeEMJAQC8oYQAAN5QQgAAbyghAIA3lBAAwBtKCADgDSUEAPCGEgIAeEMJAQC8oYQAAN606DurtqT4+HglJCRc9vZJSUnmfbi+vcSVV15pzrz99tvmzAcffGDOXHHFFebM0KFDzRlJys/PN2dOnTplzrhMC7acO/9r8ODB5syuXbvMmX//+9/mzI033mjOHD582JyRzv78WZWXl5szdXV15sztt99uzvTq1cuckaTly5ebMzt27DBntm7das4cPXrUnJHOvlNBW8KVEADAG0oIAOANJQQA8IYSAgB4QwkBALyhhAAA3lBCAABvKCEAgDeUEADAG0oIAOANJQQA8IYSAgB402YHmDY2NurMmTOXvf1XX31l3sdVV11lzkjS3r17zZk333zTnHEZENqtWzdzxuXrcTVy5EhzpkePHuZMY2OjOSNJ+/btM2dchqW6DCMNhULmTNeuXc0ZSerZs6c54zJE+NixY+ZMfX29OfPGG2+YM5J05513mjMuQ3CTk5PNmZqaGnNGchsaGwSB074uB1dCAABvKCEAgDeUEADAG0oIAOANJQQA8IYSAgB4QwkBALyhhAAA3lBCAABvKCEAgDeUEADAG0oIAOBNmx1gmpCQoC5dLn95J0+eNO/jyJEj5owklZ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UpNze3Q54fDz30kNauXavXXnut2Vu/dLbz4WLH4ULa6vnQLkqoa9euGjZsmEpKSprdX1JSooKCAk+r8i8ajWrv3r3KysryvRRv8vLyFA6Hm50bDQ0NKi0t7dTnhiTV1NSooqKiQ50fQRBozpw5euGFF7Rp0ybl5eU1+3xnOR++7ThcSJs9Hzw+KcLk+eefDxITE4M///nPwZ49e4K5c+cGycnJwWeffeZ7aa3m4YcfDjZv3hx8+umnwbZt24IpU6YEKSkpHf4Y1NXVBTt37gx27twZSAoWL14c7Ny5M/j888+DIAiChQsXBqmpqcELL7wQ7N69O7jrrruCrKysIBKJeF55y7rUcairqwsefvjhYOvWrUF5eXnw2muvBaNHjw6uvPLKDnUcfvnLXwapqanB5s2bg8rKyqbbiRMnmrbpDOfDtx2H9nQ+tJsSCoIgePrpp4Pc3Nyga9euwdChQ5s9HbEzmDFjRpCVlRUkJiYG2dnZwfTp04MPP/zQ97Ji7rXXXgsknXebOXNmEARnn5b7xBNPBOFwOAiFQsG4ceOC3bt3+110DFzqOJw4cSIoLCwMevfuHSQmJgZ9+/YNZs6cGRw4cMD3slvUhb5+ScHy5cubtukM58O3HYf2dD7wVg4AAG/axWNCAICOiRICAHhDCQEAvKGEAADeUEIAAG8oIQCAN5QQAMAbSggA4A0lBADwhhICAHhDCQEAvKGEAADe/D+4pMujYYs0AgAAAABJRU5ErkJggg==", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "print('Train score (% of correct classification): {:.0f} %'.format(\n", " train_score * 100))\n", "plot_mnist_image(clf.coef_[0])\n", "plot_mnist_image(clf.coef_[9]) " ] }, { "cell_type": "markdown", "id": "65f5236d", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "In the figure above, we plotted the weights for the class \"0\" and the weights for the class \"9\". You can compare these pattern with the actual \"0\" and \"9\" that we plotted above.\n", "\n", "**Interpretation:**\n", "\n", "- It seems that the weights are trying to pick up the edges of the digit pattern.\n", "- However, the signal seems noisy.\n", "- We are actually moving away from linear methods (maximum interpretability), trading interpretability against performance." ] }, { "cell_type": "markdown", "id": "4e51f17a", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "**Perceptrons limitations:**\n", "\n", "- Perceptrons are highly nonlinear functions: when the weighted sum is close the threshold, a small modification of the input parameter will introduce a change of category.\n", "- Perceptrons are not continuous functions and so they are not differentiable (optimization perspective).\n", "\n", "In order to overcome these limitations, let us introduce two other popular activation functions: the sigmoid and the rectifier (ReLU for Rectified Linear Unit)." ] }, { "cell_type": "markdown", "id": "a732f84c", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "#### Sigmoid activation function\n", "\n", "The sigmoid function is a good alternative to the Heaviside because the function and its derivative are continuous. (cf. classification)\n", "\n", "\n", "> ***Question***\n", ">\n", "> - Can you recall the main properties of the sigmoid function? What is the role of the weights and biases?" ] }, { "cell_type": "code", "execution_count": 15, "id": "bbd5b25d", "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "def sigmoid(x): \n", " return 1 / (1 + np.exp(-x))" ] }, { "cell_type": "code", "execution_count": 8, "id": "602fb1a6", "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGdCAYAAADAAnMpAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA9iUlEQVR4nO3de1zUdd7//+fMwAwHBQQURBHJPCVliltB2UE3zE7bbgd3uy613eqXW9aqbbtZ127ltV1Wu9t27ZYdds22X225rdpVm1dKm8e0LkUq81weEAURVEDUgZl5f/8AJlFABoEPMzzut9vcYN7z/gyvDx/48OTz/nzeH5sxxggAAMAidqsLAAAAXRthBAAAWIowAgAALEUYAQAAliKMAAAASxFGAACApQgjAADAUoQRAABgqTCrC2gJn8+n/fv3q3v37rLZbFaX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iqS4cRl8ulxx57TC6Xy+pS2k2oryPrF/xCfR1Dff2k0F9H1q/9BcUJrAAAIHR16SMjAADAeoQRAABgKcIIAACwFGEEAABYKuTDyJNPPqns7GxFRUUpLi6u0T4FBQW64YYbFB0drcTERD3wwAOqrq5u9n3dbrfuv/9+JSYmKjo6WjfeeKMKCwvbYQ1abvny5bLZbI0+1q1b1+Ryd9xxx2n9L7nkkg6sPDD9+/c/rd6HH3642WWMMXr88ceVkpKiyMhIXXnlldq0aVMHVdxyu3fv1p133qn09HRFRkZqwIABeuyxx87489jZt+GcOXOUnp6uiIgIZWZmatWqVc32X7FihTIzMxUREaFzzjlHL730UgdVGpjZs2frO9/5jrp3765evXrppptu0rZt25pdpqnf061bt3ZQ1YF5/PHHT6s1OTm52WWCZftJje9PbDab7rvvvkb7d/btt3LlSt1www1KSUmRzWbTu+++2+D11u4LFyxYoPPOO08ul0vnnXeeFi1a1KZ1h3wYqa6u1q233qqf/vSnjb7u9Xp13XXXqaqqSqtXr9bbb7+tBQsW6MEHH2z2fadNm6ZFixbp7bff1urVq3X06FFdf/318nq97bEaLZKdna2ioqIGj7vuukv9+/fXqFGjml32mmuuabDc4sWLO6jq1pk1a1aDev/jP/6j2f7PPPOMnn32WT3//PNat26dkpOTdfXVV/vve9RZbN26VT6fTy+//LI2bdqkP/zhD3rppZf0yCOPnHHZzroN58+fr2nTpunRRx9Vfn6+Ro8erfHjx6ugoKDR/rt27dK1116r0aNHKz8/X4888ogeeOABLViwoIMrP7MVK1bovvvu06effqrc3Fx5PB7l5OSoqqrqjMtu27atwfYaOHBgB1TcOsOGDWtQ68aNG5vsG0zbT5LWrVvXYN1yc3MlSbfeemuzy3XW7VdVVaXhw4fr+eefb/T11uwL165dqwkTJmjixIn64osvNHHiRN1222367LPP2q5w00XMmzfPxMbGnta+ePFiY7fbzb59+/xtb731lnG5XKa8vLzR9zpy5IgJDw83b7/9tr9t3759xm63mw8//LDNa2+t6upq06tXLzNr1qxm+02ePNl873vf65ii2kBaWpr5wx/+0OL+Pp/PJCcnm6eeesrfduLECRMbG2teeumldqiwbT3zzDMmPT292T6deRtedNFFZsqUKQ3ahgwZYh5++OFG+//iF78wQ4YMadB2zz33mEsuuaTdamwrJSUlRpJZsWJFk32WLVtmJJnDhw93XGFn4bHHHjPDhw9vcf9g3n7GGPOzn/3MDBgwwPh8vkZfD6btJ8ksWrTI/7y1+8LbbrvNXHPNNQ3axo0bZ374wx+2Wa0hf2TkTNauXauMjAylpKT428aNGye32628vLxGl8nLy1NNTY1ycnL8bSkpKcrIyNCaNWvaveaWeu+991RaWqo77rjjjH2XL1+uXr16adCgQbr77rtVUlLS/gWehaeffloJCQm68MIL9eSTTzY7jLFr1y4VFxc32F4ul0tXXHFFp9peTSkvL1d8fPwZ+3XGbVhdXa28vLwG33tJysnJafJ7v3bt2tP6jxs3TuvXr1dNTU271doWysvLJalF22vEiBHq3bu3xo4dq2XLlrV3aWdlx44dSklJUXp6un74wx9q586dTfYN5u1XXV2tN954Qz/5yU/OeFPWYNp+9Vq7L2xqm7bl/rPLh5Hi4mIlJSU1aOvRo4ecTqeKi4ubXMbpdKpHjx4N2pOSkppcxgpz587VuHHjlJqa2my/8ePH680339THH3+s3//+91q3bp3GjBkjt9vdQZUG5mc/+5nefvttLVu2TFOnTtVzzz2ne++9t8n+9dvk1O3c2bZXY7755hv96U9/0pQpU5rt11m3YWlpqbxeb0Df+8Z+J5OSkuTxeFRaWtputZ4tY4xmzJihyy67TBkZGU326927t1555RUtWLBACxcu1ODBgzV27FitXLmyA6ttuYsvvlivv/66lixZoj//+c8qLi5Wdna2ysrKGu0frNtPkt59910dOXKk2X/ggm37nay1+8Kmtmlb7j+D4q69p3r88cf1xBNPNNtn3bp1ZzxPol5jCdgYc8Zk3BbLtERr1rewsFBLlizR3//+9zO+/4QJE/yfZ2RkaNSoUUpLS9MHH3ygH/zgB60vPACBrOP06dP9bRdccIF69OihW265xX+0pCmnbpv22l6Nac023L9/v6655hrdeuutuuuuu5pdtjNs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XF3HjjjQ36nbyOxhjz1FNPmdjYWLNw4UKzceNG86Mf/cj07t27063jvn37zLnnnmvGjBljCgsLTVFRkf9xsmDahm+//bYJDw83c+fONZs3bzbTpk0z0dHRZvfu3cYYYx5++GEzceJEf/+dO3eaqKgoM336dLN582Yzd+5cEx4ebv7xj39YtQpN+ulPf2piY2PN8uXLG2yrY8eO+fucun5/+MMfzKJFi8z27dvNV199ZR5++GEjySxYsMCKVTijBx980Cxfvtzs3LnTfPrpp+b666833bt3D4ntV8/r9Zp+/fqZX/7yl6e9Fmzbr7Ky0v93TpJ/f7lnzx5jTMv2hRMnTmxwtdsnn3xiHA6Heeqpp8yWLVvMU089ZcLCwsynn37aZnWHfBiZPHmykXTaY9myZf4+e/bsMdddd52JjIw08fHxZurUqebEiRP+13ft2nXaMsePHzdTp0418fHxJjIy0lx//fWmoKCgA9esaT/60Y9MdnZ2k69LMvPmzTPGGHPs2DGTk5NjevbsacLDw02/fv3M5MmTO826nCovL89cfPHFJjY21kRERJjBgwebxx57zFRVVTXod/I6GlN7Sdtjjz1mkpOTjcvlMpdffrnZuHFjB1d/ZvPmzWv05/XU/xuCbRu+8MILJi0tzTidTjNy5MgGl75OnjzZXHHFFQ36L1++3IwYMcI4nU7Tv39/8+KLL3ZwxS3T1LY6+Wfv1PV7+umnzYABA0xERITp0aOHueyyy8wHH3zQ8cW30IQJE0zv3r1NeHi4SUlJMT/4wQ/Mpk2b/K8H8/art2TJEiPJbNu27bTXgm371V96fOpj8uTJxpiW7QuvuOIKf/9677zzjhk8eLAJDw83Q4YMafPwZTOm7swiAAAAC3T5S3sBAIC1CCMAAMBShBEAAGApwggAALAUYQQAAFiKMAIAACxFGAEAAJYijAAAAEsRRgAAgKUIIwAAwFKEEQAAYCnCCAAAsNT/AyjbRbprRVFeAAAAAElFTkSuQmCC", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "x = np.linspace(-10, 10, 100)\n", "_ = plt.plot(x, sigmoid(x))" ] }, { "cell_type": "markdown", "id": "ed2e80f1", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "#### ReLU activation function\n", "\n", "The ReLU activation function is defined as\n", "\n", "\\begin{equation}\n", "f(x)=\\max(0,x)\n", "\\end{equation}\n", "\n", "This function will \"activate\" a neuron only if the input value is positive. Note that with this activation function, the activation level is not restricted to be between 0 an 1. Advantages of ReLU are that :\n", "- they are cheap to compute (later on, we are going to use millions of these units so we need to take that into account) ;\n", "- although its derivative is not continuous, is has nice properties for optimization purposes (the gradient does not vanish for large values of x, more on that later)." ] }, { "cell_type": "code", "execution_count": 16, "id": "eef37fc3", "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "def relu(x): \n", " return np.maximum(0, x)" ] }, { "cell_type": "code", "execution_count": 10, "id": "a860d1f6", "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGdCAYAAACyzRGfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA3i0lEQVR4nO3dd3xUdb7/8XfqpJCEmgYBAtJDooIiCCqoIAJiAct6veiWn6ygIkXBRlEIzfK7666u/ryse11FaYqKYlgpKqCAmNB7CSWEmoSE1Pn+/gjkGgiQhJk5U17Px2MeD3LmzJz3yRkm78xnTsbPGGMEAADgIv5WBwAAAL6F8gEAAFyK8gEAAFyK8gEAAFyK8gEAAFyK8gEAAFyK8gEAAFyK8gEAAFwq0OoA57Pb7Tp06JAiIiLk5+dndRwAAFANxhjl5eUpPj5e/v6Xfm3D7crHoUOHlJCQYHUMAABQC5mZmWrSpMkl13G78hERESGpPHxkZKTFaQAAQHXk5uYqISGh4uf4pbhd+Tg3aomMjKR8AADgYarzlgnecAoAAFyK8gEAAFyK8gEAAFyK8gEAAFyK8gEAAFyK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AALiUT5UPm82m8ePHy2azWR3FKbx9/yTv30f2z/N5+z56+/5J3r+P7rB/bveGUwAA4N186pUPAABgPcoHAABwKcoHAABwKcoHAABwKa8qH5MnT1a3bt0UFhamunXrVrnO/v37NWDAAIWHh6thw4Z66qmnVFxcfMn7LSoq0pNPPqmGDRsqPDxcd911lw4cOOCEPaiZZcuWyc/Pr8rLmjVrLnq7Rx999IL1b7jhBhcmr77mzZtfkHXs2LGXvI0xRhMmTFB8fLxCQ0N1yy23aNOmTS5KXDN79+7VH/7wByUmJio0NFQtW7bU+PHjL/uYdOdj+Le//U2JiYkKCQlRp06d9P33319y/eXLl6tTp04KCQlRixYt9M4777goac2lpqbquuuuU0REhKKjo3X33Xdr27Ztl7zNxf6fbt261UWpq2/ChAkX5IyNjb3kbTzp+ElVP6f4+flp2LBhVa7v7sdvxYoVGjBggOLj4+Xn56fPPvus0vW1fT6cN2+e2rdvL5vNpvbt22vBggUOze1V5aO4uFiDBw/Wn//85yqvLysrU79+/ZSfn68ffvhBs2fP1rx58zRq1KhL3u+IESO0YMECzZ49Wz/88INOnz6t/v37q6yszBm7UW3dunXT4cOHK13++Mc/qnnz5urcufMlb3vHHXdUut2iRYtclLrmJk2aVCnriy++eMn1p0+frtdff11vvfWW1qxZo9jYWN1+++0VnxvkTrZu3Sq73a6///3v2rRpk9544w298847ev755y97W3c8hp988olGjBihF154QevXr1ePHj3Ut29f7d+/v8r19+zZozvvvFM9evTQ+vXr9fzzz+upp57SvHnzXJy8epYvX65hw4Zp9erVSktLU2lpqXr37q38/PzL3nbbtm2VjlerVq1ckLjmOnToUCnnhg0bLrqupx0/SVqzZk2l/UtLS5MkDR48+JK3c9fjl5+fr5SUFL311ltVXl+b58NVq1bpgQce0COPPKL09HQ98sgjuv/++/XTTz85LrjxQrNmzTJRUVEXLF+0aJHx9/c3Bw8erFj28ccfG5vNZnJycqq8r1OnTpmgoCAze/bsimUHDx40/v7+5ptvvnF49itRXFxsoqOjzaRJky653pAhQ8zAgQN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XFfGvqyVK1ea119/3axfv97s3r3bfPLJJyY+Pt7cddddldb77f4ZY8zUqVNNVFSUmT9/vtmwYYN56KGHTFxcnNvtnzHlZ05dddVVplevXubAgQPm8OHDFZff8pRjOHv2bBMUFGTef/99s3nzZjNixAgTHh5u9u7da4wxZuzYseaRRx6pWH/37t0mLCzMPPPMM2bz5s3m/fffN0FBQWbu3LlW7cIl/fnPfzZRUVFm2bJllY5VQUFBxTrn7+Mbb7xhFixYYLZv3242btxoxo4daySZefPmWbELlzRq1CizbNkys3v3brN69WrTv39/ExER4TXH75yysjLTtGlT89xzz11wnacdv7y8vIqfdZIqnjP37dtnjKne8+EjjzxS6Yy0H3/80QQEBJipU6eaLVu2mKlTp5rAwECzevVqh+X2qvIxZMgQI+mCy9KlSyvW2bdvn+nXr58JDQ019evXN8OHDzeFhYUV1+/Zs+eC25w5c8YMHz7c1K9f34SGhpr+/fub/fv3u3DPLu2hhx4y3bp1u+j1ksysWbOMMcYUFBSY3r17m0aNGpmgoCDTtGlTM2TIELfan3PWrVtnunTpYqKiokxISIhp06aNGT9+vMnPz6+03m/3z5jy08vGjx9vYmNjjc1mMzfddJPZsGGDi9NXz6xZs6p8zJ7/e4EnHcO//vWvplmzZiY4ONhce+21lU5DHTJkiLn55psrrb9s2TJzzTXXmODgYNO8eXPz9ttvuzhx9V3sWP328Xf+Pk6bNs20bNnShISEmHr16pnu3bubr776yvXhq+GBBx4wcXFxJigoyMTHx5t7773XbNq0qeJ6Tz9+5yxevNhIMtu2bbvgOk87fudOBT7/MmTIEGNM9Z4Pb7755or1z5kzZ45p06aNCQoKMm3btnV42fIz5uy7gwAAAFzAp061BQAA1qN8AAAAl6J8AAAAl6J8AAAAl6J8AAAAl6J8AAAAl6J8AAAAl6J8AAAAl6J8AAAAl6J8AAAAl6J8AAAAl6J8AAAAl/r/ipgM4+Xc8/AAAAAASUVORK5CYII=", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "_ = plt.plot(x, relu(x))" ] }, { "cell_type": "markdown", "id": "43a67174", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Before to proceed, let us absorb the bias into the weight matrix to simplify the notation. To do so, we need to append a \"1\" to the $\\boldsymbol x$ vector.\n", "\n", "The affine transformation of the input vector is then given by the weighted sum:\n", "\n", "\\begin{equation}\n", "\\boldsymbol z = \\boldsymbol W \\boldsymbol x,\n", "\\end{equation}\n", "\n", "where the last column of $\\boldsymbol W$ is equal to $\\boldsymbol b$, and the dimension of $\\boldsymbol x$ is now $p + 1$." ] }, { "cell_type": "markdown", "id": "59661750", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Cost function\n", "\n", "In order to asses the performance of our network, we introduce the cost function that we want to minimize:\n", "\n", "$$\n", "C := \\frac{1}{N} \\sum_{i = 1}^N \\| \\boldsymbol y_i - \\boldsymbol {\\hat y}_i \\|^2\\, ,\n", "$$\n", "\n", "where $\\boldsymbol y_i$ is the target of the $i$th sample and $\\boldsymbol {\\hat y}_i$ is the network output for that sample. The sum spans the entire training set of size $N$.\n", "\n", "For an activation function $\\sigma$, the cost function for an individual input writes\n", "\n", "\\begin{equation}\n", "C_i := \\| \\boldsymbol y_i - \\sigma (\\boldsymbol W \\boldsymbol x_i) \\|^2\\, .\n", "\\end{equation}\n" ] }, { "cell_type": "markdown", "id": "a8295eb5", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Iterative algorithm: Gradient descent\n", "\n", "To solve this minimization problem, we follow a standard iterative algorithm known as the gradient descent.\n", "\n", "To illustrate it, let us first consider the two-class problem with a single sample:\n", "\n", "\\begin{equation}\n", "C := (y - \\sigma (\\boldsymbol w^\\top \\boldsymbol x) )^2\\, ,\n", "\\end{equation}\n", "\n", "where $y$ is a scalar.\n", "\n", "We want to find the set of weights and biases that minimize the cost function $C$. The cost function is minimum when \n", "\n", "\\begin{equation}\n", "\\frac{d C}{d \\boldsymbol w} = 0.\n", "\\end{equation}" ] }, { "cell_type": "markdown", "id": "0cddf62f", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "\n", "> ***Question***\n", "> \n", "> - Compute $dC/d \\boldsymbol w$.\n", "\n", "This nonlinear equation has no closed form solution so we will instead use an iterative algorithm." ] }, { "cell_type": "markdown", "id": "e0d07153", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "We start from a first guess for the weights $\\boldsymbol w^{(0)}$. For this value of the weights, we compute the value of the cost function $C$. We then add increments:\n", "\n", "\\begin{equation}\n", "\\boldsymbol w^{(1)} = \\boldsymbol w^{(0)} + \\delta \\boldsymbol w^{(0)}\n", "\\end{equation}\n", "\n", "The cost function will vary by an amount \n", "\n", "\\begin{align}\n", "\\Delta C &= C\\left(\\boldsymbol w^{(1)}\\right) - C\\left(\\boldsymbol w^{(0)}\\right)\\\\\n", "& = C\\left(\\boldsymbol w^{(0)} + \\delta \\boldsymbol w^{(0)}\\right) - C\\left(\\boldsymbol w^{(0)}\\right)\\\\\n", " & \\simeq \\left.\\frac{d C}{d \\boldsymbol w}\\right|_{\\boldsymbol w^{(0)}} \\delta \\boldsymbol w^{(0)}\n", "\\end{align}" ] }, { "cell_type": "markdown", "id": "1dda438b", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "> ***Question***\n", ">\n", ">- Show that if we choose \n", "\\begin{equation}\n", "\\delta \\boldsymbol w = - \\lambda \\left[\\frac{d C}{d \\boldsymbol w}\\right]^\\top\n", "\\end{equation}\n", "> then at each iteration, we have $\\Delta C < 0$ when $\\lambda$ is a positive number.\n" ] }, { "cell_type": "markdown", "id": "9760f802", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "The parameter $\\lambda$ is called the *learning rate*.\n", "\n", "In the limit where linearity holds we can compute the little increments in the weights and biases that ensure that the cost function will decrease.\n", "\n", "This method is called the *gradient descent*." ] }, { "cell_type": "markdown", "id": "bd5cb1e6", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Illustration of the gradient descent\n", "\n", "We illustrate the gradient descent technique in the next figure for the case where $\\boldsymbol w$ is dimension 2. The cost function $C$ is plotted with contours: it is minimum in the yellow area. The initial guess $\\boldsymbol w^{(0)}$ is plotted with the red dot. The value of $\\boldsymbol w$ for which $dC/d\\boldsymbol w = 0$ is plotted with a red cross.\n", "\n", "\n", "\"weather\"\n" ] }, { "cell_type": "markdown", "id": "9f23d1c4", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "> ***Question***\n", ">\n", "> - What is the problem if $\\lambda$ is too small? too big?\n", "> - What happens if the cost function is a complicated function of $\\mathbf w$ with many local minima?\n", "\n", "In practice, the gradient descent method works well but is slow to converge.\n", "\n", "There are other methods that have better convergence properties for this iterative process: [Newton-Raphson](https://en.wikipedia.org/wiki/Newton%27s_method), [Conjugate gradient](https://en.wikipedia.org/wiki/Conjugate_gradient_method), etc (see turorial)" ] }, { "cell_type": "markdown", "id": "1775ea7e", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Hidden layers" ] }, { "cell_type": "markdown", "id": "b3d623ac", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "In the perceptron model, the complexity of the relationship between the input and the output is limited. \n", "\n", "To overcome this limitation, one way is to add one or more *hidden layers* of neurons between the input and output layers." ] }, { "cell_type": "markdown", "id": "f3be17ee", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "The motivation to add these layers is to break down the problem into multiple small task, e.g. \"pick and edge\" and \"find a strait line\" in the case of the digit recognition.\n", "\n", "\"weather\"" ] }, { "cell_type": "markdown", "id": "57452641", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "The figure above is an illustration of the simplest possible architecture of a neural network: it comprises an input layer of $p$ neurons, one hidden layer, and one output layer.\n", "\n", "For historical reasons, neural networks are sometimes called *multi-layer perceptron (MLP)* even if the activation functions in the hidden layers do not constitute a perceptron." ] }, { "cell_type": "markdown", "id": "30b66ecf", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Universal approximation theorem\n", "\n", "Why could adding more layers help? \n", "\n", "The universal approximation theorem states that a feedforward network with at least one hidden layer can approximate any continuous function with an (training) error that can be made as small as we want by adding neurons in the hidden layer.\n", "\n", "Of course, the function $\\boldsymbol x \\to \\boldsymbol y = f(\\boldsymbol x)$ should exist for this theorem to be applied.\n", "\n", "Hence, neural networks are \"universal\" tools (can be used every time we believe there exists a mapping: digit recognition, classification, uncover physical laws...)." ] }, { "cell_type": "markdown", "id": "623bfcdf", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "One caveat however is that, if we are guaranteed the existence of a network, we have no guidance on how to find such network. We need to build a strategy to find the weights and biases to find that optimal solution.\n", "\n", "Plus, minimizing the training error could lead to overfitting ; it is the expected prediction error that should be minimized." ] }, { "cell_type": "markdown", "id": "d52030dd", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Training a neural network: backpropagation\n", "\n", "Let us consider the case where we have more than one hidden layer.\n", "\n", "We write with a subscript $\\boldsymbol a^l$ the activation in the $l^{th}$ layer. So we have,\n", "\n", "\\begin{equation}\n", "\\boldsymbol a^l = \\sigma \\left( \\boldsymbol W^l \\boldsymbol a^{l-1} \\right)\n", "\\end{equation}\n", "\n", "with $\\boldsymbol W^l$ the matrix of weights (including the bias) to compute the activation in layer $l$ and for some activation function $\\sigma$.\n", "\n", "The activation in the first layer is fixed to the input, $\\boldsymbol x = \\boldsymbol a^0$, while the activation in the last layer gives the output, $\\boldsymbol y = \\boldsymbol a^L$, resulting in $L + 1$ layers." ] }, { "cell_type": "markdown", "id": "97fc5146", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "We note,\n", "\n", "\\begin{equation}\n", "\\boldsymbol z^l := \\boldsymbol W^l \\boldsymbol a^{l-1},\n", "\\end{equation}\n", "\n", "the weighted sum in layer $l$." ] }, { "cell_type": "markdown", "id": "793f3628", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "> ***Question***\n", ">\n", "> - If there are $p$ neurons in layer $l-1$ and $q$ neurons in layer $l$, what is the dimension of each of the terms in the equation above? (Hint: don't forget about the bias.)" ] }, { "cell_type": "markdown", "id": "f41f8e8b", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "The cost function is\n", "\n", "\\begin{equation}\n", "C = \\frac{1}{N}\\sum_{i = 1}^N \\| \\boldsymbol y_i - \\boldsymbol a^L_i \\|^2\\, .\n", "\\end{equation}\n", "\n", "We want to compute the derivative of this cost function with respect to **all** weights and biases in the network in order to use the gradient descent algorithm:\n", "\n", "\\begin{equation}\n", "\\frac{\\partial C}{\\partial \\boldsymbol W^l} \\, ,\n", "\\end{equation}\n", "for all $l$." ] }, { "cell_type": "markdown", "id": "cc4ac682", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Observe that the derivatives in one layer is related to the derivatives in the previous layers by the chain rule:\n", "\n", "\\begin{equation}\n", "\\frac{\\partial C}{\\partial \\boldsymbol W^l} = \\frac{\\partial C}{\\partial \\boldsymbol z^l} \\frac{\\partial \\boldsymbol z^l}{\\partial \\boldsymbol W^l}.\n", "\\end{equation}\n", "\n", "Let us introduce the notation\n", "\n", "\\begin{equation}\n", "\\boldsymbol \\delta^l = \\frac{\\partial C}{\\partial \\boldsymbol z^l},\n", "\\end{equation}\n", "\n", "which is a row vector according to our numerator layout convention." ] }, { "cell_type": "markdown", "id": "bbcebe09", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Let's first derive $\\mathbf \\delta^L$ in the last layer. For a single point,\n", "\n", "\\begin{equation}\n", "C = (\\boldsymbol y - \\sigma(\\boldsymbol z^L))^\\top ( \\boldsymbol y - \\sigma (\\boldsymbol z^L))\\, ,\n", "\\end{equation}\n", "\n", "so,\n", "\n", "\\begin{equation}\n", "\\boldsymbol \\delta^L = -2( \\boldsymbol y - \\sigma(\\boldsymbol z^L))^\\top \\Sigma' (\\boldsymbol z^L))\\, ,\n", "\\end{equation}\n", "\n", "where $\\Sigma'$ is a matrix with diagonal entries which are $\\sigma'(\\boldsymbol z^l)$." ] }, { "cell_type": "markdown", "id": "4a1c41dc", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "The derivative of a vector by a matrix is given by\n", "\n", "\\begin{equation}\n", "\\frac{\\partial \\boldsymbol z^l}{\\partial \\boldsymbol W^l} = \\frac{\\partial }{\\partial \\boldsymbol W^l} \\boldsymbol W^l \\boldsymbol a^{l-1},\n", "\\end{equation}\n", "\n", "which is a tensor of order 3 with a lot of zeros in it (sparsity).\n", "\n", "The above equation simplifies in\n", "\n", "\\begin{equation}\n", "\\frac{\\partial C}{\\partial \\boldsymbol W^l} = \\boldsymbol a^{l-1} \\delta^l.\n", "\\end{equation}" ] }, { "cell_type": "markdown", "id": "aa59b3f2", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "> ***Question***\n", ">\n", "> - What is the physical interpretation of this derivative?\n", "> - *(Optional)* Verify that $\\frac{\\partial C}{\\partial \\boldsymbol W^l}$ is the same dimension as ${\\boldsymbol W^l}^\\top$" ] }, { "cell_type": "markdown", "id": "3bd1d19e", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "In addition, the chain rule gives us the following recurrence relation,\n", "\n", "\\begin{align}\n", "\\boldsymbol \\delta^l &= \\frac{\\partial C}{\\partial \\boldsymbol z^{l+1}} \\frac{\\partial \\boldsymbol z^{l+1}}{\\partial \\mathbf z^{l}}\\\\\n", "&= \\boldsymbol \\delta^{l+1} \\frac{\\partial \\boldsymbol z^{l+1}}{\\partial \\boldsymbol z^{l}}.\n", "\\end{align}" ] }, { "cell_type": "markdown", "id": "a3a5e0c0", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Moreover we have\n", "\n", "\\begin{equation}\n", "\\boldsymbol z^{l+1} = \\boldsymbol W^{l+1} \\boldsymbol a^l = \\boldsymbol W^{l+1} \\sigma(\\boldsymbol z^l)\n", "\\end{equation}\n", "\n", "so \n", "\n", "\\begin{equation}\n", "\\frac{\\partial \\boldsymbol z^{l+1}}{\\partial \\boldsymbol z^{l}} = \\boldsymbol W^{l+1} \\Sigma'(\\boldsymbol z^l).\n", "\\end{equation}" ] }, { "cell_type": "markdown", "id": "243a688f", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "So we have\n", "\n", "\\begin{equation}\n", "\\boldsymbol \\delta^l = \\boldsymbol \\delta^{l+1} \\boldsymbol W^{l+1} \\Sigma'(\\boldsymbol z^l)\n", "\\end{equation}" ] }, { "cell_type": "markdown", "id": "99b3f4d8", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "> ***Question***\n", "> \n", "> - Suppose that there are $p$ neurons in layer $l$ and $q$ neurons in layer $l+1$. What is the dimension of all the terms in the equation above?\n", "> - Since $\\Sigma'$ is a diagonal matrix, how are you going to compute the product of these 3 elements in a computer program?" ] }, { "cell_type": "markdown", "id": "d243336d", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "
\n", " Main equations\n", "\n", "- \\begin{equation}\n", "\\frac{\\partial C}{\\partial \\boldsymbol W^l} = \\boldsymbol a^{l-1} \\delta^l\n", "\\end{equation}\n", " \n", "- \\begin{equation}\n", "\\boldsymbol \\delta^l = \\boldsymbol \\delta^{l+1} \\boldsymbol W^{l+1} \\Sigma'(\\boldsymbol z^l)\n", "\\end{equation}\n", " \n", " \n", "- \\begin{equation}\n", "\\boldsymbol \\delta^L = -2( \\boldsymbol y - \\sigma(\\boldsymbol z^L))^\\top \\Sigma' (\\boldsymbol z^L))\\, ,\n", "\\end{equation}\n", "
" ] }, { "cell_type": "markdown", "id": "45f3da11", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Let us implement these formula in the [Tutorial: Universal approximation theorem](10_tutorial_neural_networks.ipynb) and see if we can make sense of it." ] }, { "cell_type": "markdown", "id": "631f9b78", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## References\n", "\n", "- [Chap. 6 in Goodfellow, I., Bengio, Y., Courville, A., 2016. *Deep Learning*. MIT Press, Cambridge](https://www.deeplearningbook.org/contents/mlp.html).\n" ] }, { "cell_type": "markdown", "id": "5e186998", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "***\n", "## Credit\n", "\n", "[//]: # \"This notebook is part of [E4C Interdisciplinary Center - Education](https://gitlab.in2p3.fr/energy4climate/public/education).\"\n", "Contributors include Bruno Deremble and Alexis Tantet.\n", "\n", "
\n", "\n", "
\n", " \n", "\"Logo\n", "\n", "\"Logo\n", "\n", "\"Logo\n", "\n", "\"Logo\n", "\n", "\"Logo\n", "\n", "\"Logo\n", "\n", "\"Logo\n", " \n", "
\n", "\n", "
\n", "\n", "
\n", " \"Creative\n", "
This work is licensed under a   Creative Commons Attribution-ShareAlike 4.0 International License.\n", "
" ] }, { "cell_type": "markdown", "id": "2aa72f62", "metadata": {}, "source": [ "# " ] } ], "metadata": { "celltoolbar": "Slideshow", "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.16" }, "latex_envs": { "LaTeX_envs_menu_present": true, "autoclose": true, "autocomplete": false, "bibliofile": "biblio.bib", "cite_by": "apalike", "current_citInitial": 1, "eqLabelWithNumbers": true, "eqNumInitial": 1, "hotkeys": { "equation": "Ctrl-E", "itemize": "Ctrl-I" }, "labels_anchors": false, "latex_user_defs": false, "report_style_numbering": false, "user_envs_cfg": false }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 5 }