new update
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>12. Neural networks — Applied Data Analysis and Machine Learning</title>
|
||||
<title>13. Neural networks — Applied Data Analysis and Machine Learning</title>
|
||||
|
||||
<link href="_static/css/theme.css" rel="stylesheet" />
|
||||
<link href="_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" />
|
||||
@@ -54,8 +54,8 @@
|
||||
<script async="async" src="_static/sphinx-thebe.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="13. Building a Feed Forward Neural Network" href="chapter10.html" />
|
||||
<link rel="prev" title="11. Clustering Analysis" href="Clustering.html" />
|
||||
<link rel="next" title="14. Building a Feed Forward Neural Network" href="chapter10.html" />
|
||||
<link rel="prev" title="12. Clustering Analysis" href="Clustering.html" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="docsearch:language" content="en" />
|
||||
|
||||
@@ -139,17 +139,17 @@
|
||||
<ul class="nav bd-sidenav">
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="chapter1.html">
|
||||
3. Linear Regression, basic Elements
|
||||
3. Linear Regression
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="chapter2.html">
|
||||
4. Resampling Methods
|
||||
4. Ridge and Lasso Regression
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="chapter3.html">
|
||||
5. Ridge and Lasso Regression
|
||||
5. Resampling Methods
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
@@ -159,7 +159,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="chapter5.html">
|
||||
7. Support Vector Machines, overarching aims
|
||||
8. Support Vector Machines, overarching aims
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -171,12 +171,12 @@
|
||||
<ul class="nav bd-sidenav">
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="chapter6.html">
|
||||
8. Decision trees, overarching aims
|
||||
9. Decision trees, overarching aims
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="chapter7.html">
|
||||
9. Ensemble Methods: From a Single Tree to Many Trees and Extreme Boosting, Meet the Jungle of Methods
|
||||
10. Ensemble Methods: From a Single Tree to Many Trees and Extreme Boosting, Meet the Jungle of Methods
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -188,12 +188,12 @@
|
||||
<ul class="nav bd-sidenav">
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="chapter8.html">
|
||||
10. Basic ideas of the Principal Component Analysis (PCA)
|
||||
11. Basic ideas of the Principal Component Analysis (PCA)
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="Clustering.html">
|
||||
11. Clustering Analysis
|
||||
12. Clustering Analysis
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -205,12 +205,12 @@
|
||||
<ul class="current nav bd-sidenav">
|
||||
<li class="toctree-l1 current active">
|
||||
<a class="current reference internal" href="#">
|
||||
12. Neural networks
|
||||
13. Neural networks
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="chapter10.html">
|
||||
13. Building a Feed Forward Neural Network
|
||||
14. Building a Feed Forward Neural Network
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -286,76 +286,76 @@
|
||||
<ul class="visible nav section-nav flex-column">
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#feed-forward-neural-networks">
|
||||
12.1. Feed-forward neural networks
|
||||
13.1. Feed-forward neural networks
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#convolutional-neural-network">
|
||||
12.2. Convolutional Neural Network
|
||||
13.2. Convolutional Neural Network
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#recurrent-neural-networks">
|
||||
12.3. Recurrent neural networks
|
||||
13.3. Recurrent neural networks
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#other-types-of-networks">
|
||||
12.4. Other types of networks
|
||||
13.4. Other types of networks
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#multilayer-perceptrons">
|
||||
12.5. Multilayer perceptrons
|
||||
13.5. Multilayer perceptrons
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#matrix-vector-notation-and-activation">
|
||||
12.5.1. Matrix-vector notation and activation
|
||||
13.5.1. Matrix-vector notation and activation
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#activation-functions">
|
||||
12.5.2. Activation functions
|
||||
13.5.2. Activation functions
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#the-multilayer-perceptron-mlp">
|
||||
12.6. The multilayer perceptron (MLP)
|
||||
13.6. The multilayer perceptron (MLP)
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#from-one-to-many-layers-the-universal-approximation-theorem">
|
||||
12.6.1. From one to many layers, the universal approximation theorem
|
||||
13.6.1. From one to many layers, the universal approximation theorem
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toc-h2 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#deriving-the-back-propagation-code-for-a-multilayer-perceptron-model">
|
||||
12.7. Deriving the back propagation code for a multilayer perceptron model
|
||||
13.7. Deriving the back propagation code for a multilayer perceptron model
|
||||
</a>
|
||||
<ul class="nav section-nav flex-column">
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#derivatives-and-the-chain-rule">
|
||||
12.7.1. Derivatives and the chain rule
|
||||
13.7.1. Derivatives and the chain rule
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#bringing-it-together-first-back-propagation-equation">
|
||||
12.7.2. Bringing it together, first back propagation equation
|
||||
13.7.2. Bringing it together, first back propagation equation
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#final-back-propagating-equation">
|
||||
12.7.3. Final back propagating equation
|
||||
13.7.3. Final back propagating equation
|
||||
</a>
|
||||
</li>
|
||||
<li class="toc-h3 nav-item toc-entry">
|
||||
<a class="reference internal nav-link" href="#setting-up-the-back-propagation-algorithm">
|
||||
12.7.4. Setting up the Back propagation algorithm
|
||||
13.7.4. Setting up the Back propagation algorithm
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -372,7 +372,7 @@
|
||||
<div>
|
||||
|
||||
<div class="section" id="neural-networks">
|
||||
<h1><span class="section-number">12. </span>Neural networks<a class="headerlink" href="#neural-networks" title="Permalink to this headline">¶</a></h1>
|
||||
<h1><span class="section-number">13. </span>Neural networks<a class="headerlink" href="#neural-networks" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Artificial neural networks are computational systems that can learn to
|
||||
perform tasks by considering examples, generally without being
|
||||
programmed with any task-specific rules. It is supposed to mimic a
|
||||
@@ -444,7 +444,7 @@ can be viewed as natural, more powerful extensions of supervised
|
||||
learning methods such as linear and logistic regression and soft-max
|
||||
methods we discussed earlier.</p>
|
||||
<div class="section" id="feed-forward-neural-networks">
|
||||
<h2><span class="section-number">12.1. </span>Feed-forward neural networks<a class="headerlink" href="#feed-forward-neural-networks" title="Permalink to this headline">¶</a></h2>
|
||||
<h2><span class="section-number">13.1. </span>Feed-forward neural networks<a class="headerlink" href="#feed-forward-neural-networks" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The feed-forward neural network (FFNN) was the first and simplest type
|
||||
of ANNs that were devised. In this network, the information moves in
|
||||
only one direction: forward through the layers.</p>
|
||||
@@ -456,7 +456,7 @@ to <em>all</em> nodes in the subsequent layer, making this a so-called
|
||||
<em>fully-connected</em> FFNN.</p>
|
||||
</div>
|
||||
<div class="section" id="convolutional-neural-network">
|
||||
<h2><span class="section-number">12.2. </span>Convolutional Neural Network<a class="headerlink" href="#convolutional-neural-network" title="Permalink to this headline">¶</a></h2>
|
||||
<h2><span class="section-number">13.2. </span>Convolutional Neural Network<a class="headerlink" href="#convolutional-neural-network" title="Permalink to this headline">¶</a></h2>
|
||||
<p>A different variant of FFNNs are <em>convolutional neural networks</em>
|
||||
(CNNs), which have a connectivity pattern inspired by the animal
|
||||
visual cortex. Individual neurons in the visual cortex only respond to
|
||||
@@ -476,7 +476,7 @@ produces the outputs. They have wide applications in image and video
|
||||
recognition.</p>
|
||||
</div>
|
||||
<div class="section" id="recurrent-neural-networks">
|
||||
<h2><span class="section-number">12.3. </span>Recurrent neural networks<a class="headerlink" href="#recurrent-neural-networks" title="Permalink to this headline">¶</a></h2>
|
||||
<h2><span class="section-number">13.3. </span>Recurrent neural networks<a class="headerlink" href="#recurrent-neural-networks" title="Permalink to this headline">¶</a></h2>
|
||||
<p>So far we have only mentioned ANNs where information flows in one
|
||||
direction: forward. <em>Recurrent neural networks</em> on the other hand,
|
||||
have connections between nodes that form directed <em>cycles</em>. This
|
||||
@@ -489,7 +489,7 @@ example of such information is sentences, making recurrent NNs
|
||||
especially well-suited for handwriting and speech recognition.</p>
|
||||
</div>
|
||||
<div class="section" id="other-types-of-networks">
|
||||
<h2><span class="section-number">12.4. </span>Other types of networks<a class="headerlink" href="#other-types-of-networks" title="Permalink to this headline">¶</a></h2>
|
||||
<h2><span class="section-number">13.4. </span>Other types of networks<a class="headerlink" href="#other-types-of-networks" title="Permalink to this headline">¶</a></h2>
|
||||
<p>There are many other kinds of ANNs that have been developed. One type
|
||||
that is specifically designed for interpolation in multidimensional
|
||||
space is the radial basis function (RBF) network. RBFs are typically
|
||||
@@ -502,7 +502,7 @@ fully-connected FFNN. They are however usually treated as a separate
|
||||
type of NN due the unusual activation functions.</p>
|
||||
</div>
|
||||
<div class="section" id="multilayer-perceptrons">
|
||||
<h2><span class="section-number">12.5. </span>Multilayer perceptrons<a class="headerlink" href="#multilayer-perceptrons" title="Permalink to this headline">¶</a></h2>
|
||||
<h2><span class="section-number">13.5. </span>Multilayer perceptrons<a class="headerlink" href="#multilayer-perceptrons" title="Permalink to this headline">¶</a></h2>
|
||||
<p>One uses often so-called fully-connected feed-forward neural networks
|
||||
with three or more layers (an input layer, one or more hidden layers
|
||||
and an output layer) consisting of neurons that have non-linear
|
||||
@@ -672,7 +672,7 @@ the equation for the activations of hidden layer 2 (assuming three nodes for sim
|
||||
\end{equation}
|
||||
\end{split}\]</div>
|
||||
<div class="section" id="matrix-vector-notation-and-activation">
|
||||
<h3><span class="section-number">12.5.1. </span>Matrix-vector notation and activation<a class="headerlink" href="#matrix-vector-notation-and-activation" title="Permalink to this headline">¶</a></h3>
|
||||
<h3><span class="section-number">13.5.1. </span>Matrix-vector notation and activation<a class="headerlink" href="#matrix-vector-notation-and-activation" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The activation of node <span class="math notranslate nohighlight">\(i\)</span> in layer 2 is</p>
|
||||
<!-- Equation labels as ordinary links -->
|
||||
<div id="_auto7"></div>
|
||||
@@ -691,7 +691,7 @@ used as input to the activation functions. For each operation
|
||||
<span class="math notranslate nohighlight">\(\mathrm{W}_l \hat{y}_{l-1}\)</span> we move forward one layer.</p>
|
||||
</div>
|
||||
<div class="section" id="activation-functions">
|
||||
<h3><span class="section-number">12.5.2. </span>Activation functions<a class="headerlink" href="#activation-functions" title="Permalink to this headline">¶</a></h3>
|
||||
<h3><span class="section-number">13.5.2. </span>Activation functions<a class="headerlink" href="#activation-functions" title="Permalink to this headline">¶</a></h3>
|
||||
<p>A property that characterizes a neural network, other than its
|
||||
connectivity, is the choice of activation function(s). As described
|
||||
in, the following restrictions are imposed on an activation function
|
||||
@@ -811,7 +811,7 @@ become the most popular for <em>deep neural networks</em></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="the-multilayer-perceptron-mlp">
|
||||
<h2><span class="section-number">12.6. </span>The multilayer perceptron (MLP)<a class="headerlink" href="#the-multilayer-perceptron-mlp" title="Permalink to this headline">¶</a></h2>
|
||||
<h2><span class="section-number">13.6. </span>The multilayer perceptron (MLP)<a class="headerlink" href="#the-multilayer-perceptron-mlp" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The multilayer perceptron is a very popular, and easy to implement approach, to deep learning. It consists of</p>
|
||||
<ol class="simple">
|
||||
<li><p>A neural network with one or more layers of nodes between the input and the output nodes.</p></li>
|
||||
@@ -836,7 +836,7 @@ are learned from data. This results in an important difference between
|
||||
neural networks and deep learning approaches on one side and methods
|
||||
like logistic regression or linear regression and their modifications on the other side.</p>
|
||||
<div class="section" id="from-one-to-many-layers-the-universal-approximation-theorem">
|
||||
<h3><span class="section-number">12.6.1. </span>From one to many layers, the universal approximation theorem<a class="headerlink" href="#from-one-to-many-layers-the-universal-approximation-theorem" title="Permalink to this headline">¶</a></h3>
|
||||
<h3><span class="section-number">13.6.1. </span>From one to many layers, the universal approximation theorem<a class="headerlink" href="#from-one-to-many-layers-the-universal-approximation-theorem" title="Permalink to this headline">¶</a></h3>
|
||||
<p>A neural network with only one layer, what we called the simple
|
||||
perceptron, is best suited if we have a standard binary model with
|
||||
clear (linear) boundaries between the outcomes. As such it could
|
||||
@@ -857,7 +857,7 @@ the potential of being universal approximators.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="deriving-the-back-propagation-code-for-a-multilayer-perceptron-model">
|
||||
<h2><span class="section-number">12.7. </span>Deriving the back propagation code for a multilayer perceptron model<a class="headerlink" href="#deriving-the-back-propagation-code-for-a-multilayer-perceptron-model" title="Permalink to this headline">¶</a></h2>
|
||||
<h2><span class="section-number">13.7. </span>Deriving the back propagation code for a multilayer perceptron model<a class="headerlink" href="#deriving-the-back-propagation-code-for-a-multilayer-perceptron-model" title="Permalink to this headline">¶</a></h2>
|
||||
<p>As we have seen now in a feed forward network, we can express the final output of our network in terms of basic matrix-vector multiplications.
|
||||
The unknowwn quantities are our weights <span class="math notranslate nohighlight">\(w_{ij}\)</span> and we need to find an algorithm for changing them so that our errors are as small as possible.
|
||||
This leads us to the famous <a class="reference external" href="https://www.nature.com/articles/323533a0">back propagation algorithm</a>.</p>
|
||||
@@ -904,7 +904,7 @@ and their nodes. It means we have</p>
|
||||
a_j^l = f(z_j^l) = \frac{1}{1+\exp{-(z_j^l)}}.
|
||||
\]</div>
|
||||
<div class="section" id="derivatives-and-the-chain-rule">
|
||||
<h3><span class="section-number">12.7.1. </span>Derivatives and the chain rule<a class="headerlink" href="#derivatives-and-the-chain-rule" title="Permalink to this headline">¶</a></h3>
|
||||
<h3><span class="section-number">13.7.1. </span>Derivatives and the chain rule<a class="headerlink" href="#derivatives-and-the-chain-rule" title="Permalink to this headline">¶</a></h3>
|
||||
<p>From the definition of the activation <span class="math notranslate nohighlight">\(z_j^l\)</span> we have</p>
|
||||
<div class="math notranslate nohighlight">
|
||||
\[
|
||||
@@ -938,7 +938,7 @@ a_j^l = f(z_j^l) = \frac{1}{1+\exp{-(z_j^l)}}.
|
||||
\]</div>
|
||||
</div>
|
||||
<div class="section" id="bringing-it-together-first-back-propagation-equation">
|
||||
<h3><span class="section-number">12.7.2. </span>Bringing it together, first back propagation equation<a class="headerlink" href="#bringing-it-together-first-back-propagation-equation" title="Permalink to this headline">¶</a></h3>
|
||||
<h3><span class="section-number">13.7.2. </span>Bringing it together, first back propagation equation<a class="headerlink" href="#bringing-it-together-first-back-propagation-equation" title="Permalink to this headline">¶</a></h3>
|
||||
<p>We have thus</p>
|
||||
<div class="math notranslate nohighlight">
|
||||
\[
|
||||
@@ -1037,7 +1037,7 @@ to do so we need to represent the error in the layer before the final
|
||||
one <span class="math notranslate nohighlight">\(L-1\)</span> in terms of the errors in the final output layer.</p>
|
||||
</div>
|
||||
<div class="section" id="final-back-propagating-equation">
|
||||
<h3><span class="section-number">12.7.3. </span>Final back propagating equation<a class="headerlink" href="#final-back-propagating-equation" title="Permalink to this headline">¶</a></h3>
|
||||
<h3><span class="section-number">13.7.3. </span>Final back propagating equation<a class="headerlink" href="#final-back-propagating-equation" title="Permalink to this headline">¶</a></h3>
|
||||
<p>We have that (replacing <span class="math notranslate nohighlight">\(L\)</span> with a general layer <span class="math notranslate nohighlight">\(l\)</span>)</p>
|
||||
<div class="math notranslate nohighlight">
|
||||
\[
|
||||
@@ -1062,7 +1062,7 @@ z_j^{l+1} = \sum_{i=1}^{M_{l}}w_{ij}^{l+1}a_i^{l}+b_j^{l+1},
|
||||
<p>We are now ready to set up the algorithm for back propagation and learning the weights and biases.</p>
|
||||
</div>
|
||||
<div class="section" id="setting-up-the-back-propagation-algorithm">
|
||||
<h3><span class="section-number">12.7.4. </span>Setting up the Back propagation algorithm<a class="headerlink" href="#setting-up-the-back-propagation-algorithm" title="Permalink to this headline">¶</a></h3>
|
||||
<h3><span class="section-number">13.7.4. </span>Setting up the Back propagation algorithm<a class="headerlink" href="#setting-up-the-back-propagation-algorithm" title="Permalink to this headline">¶</a></h3>
|
||||
<p>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.</p>
|
||||
<p>First, we set up the input data <span class="math notranslate nohighlight">\(\hat{x}\)</span> and the activations
|
||||
<span class="math notranslate nohighlight">\(\hat{z}_1\)</span> of the input layer and compute the activation function and
|
||||
@@ -1121,8 +1121,8 @@ Here it is convenient to use stochastic gradient descent (see the examples below
|
||||
|
||||
<div class='prev-next-bottom'>
|
||||
|
||||
<a class='left-prev' id="prev-link" href="Clustering.html" title="previous page"><span class="section-number">11. </span>Clustering Analysis</a>
|
||||
<a class='right-next' id="next-link" href="chapter10.html" title="next page"><span class="section-number">13. </span>Building a Feed Forward Neural Network</a>
|
||||
<a class='left-prev' id="prev-link" href="Clustering.html" title="previous page"><span class="section-number">12. </span>Clustering Analysis</a>
|
||||
<a class='right-next' id="next-link" href="chapter10.html" title="next page"><span class="section-number">14. </span>Building a Feed Forward Neural Network</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user