Files
FYS-STK4155/doc/pub/week40/html/._week40-bs026.html
T
2025-09-29 07:24:45 +02:00

366 lines
20 KiB
HTML

<!--
HTML file automatically generated from DocOnce source
(https://github.com/doconce/doconce/)
doconce format html week40.do.txt --html_style=bootstrap --pygments_html_style=default --html_admon=bootstrap_panel --html_output=week40-bs --no_mako
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="DocOnce: https://github.com/doconce/doconce/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Week 40: Gradient descent methods (continued) and start Neural networks">
<title>Week 40: Gradient descent methods (continued) and start Neural networks</title>
<!-- Bootstrap style: bootstrap -->
<!-- doconce format html week40.do.txt --html_style=bootstrap --pygments_html_style=default --html_admon=bootstrap_panel --html_output=week40-bs --no_mako -->
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<!-- not necessary
<link href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
-->
<style type="text/css">
/* Add scrollbar to dropdown menus in bootstrap navigation bar */
.dropdown-menu {
height: auto;
max-height: 400px;
overflow-x: hidden;
}
/* Adds an invisible element before each target to offset for the navigation
bar */
.anchor::before {
content:"";
display:block;
height:50px; /* fixed header height for style bootstrap */
margin:-50px 0 0; /* negative fixed header height */
}
</style>
</head>
<!-- tocinfo
{'highest level': 2,
'sections': [('Lecture Monday September 29, 2025',
2,
None,
'lecture-monday-september-29-2025'),
('Suggested readings and videos',
2,
None,
'suggested-readings-and-videos'),
('Lab sessions Tuesday and Wednesday',
2,
None,
'lab-sessions-tuesday-and-wednesday'),
('Logistic Regression, from last week',
2,
None,
'logistic-regression-from-last-week'),
('Classification problems', 2, None, 'classification-problems'),
('Optimization and Deep learning',
2,
None,
'optimization-and-deep-learning'),
('Basics', 2, None, 'basics'),
('Two parameters', 2, None, 'two-parameters'),
('Maximum likelihood', 2, None, 'maximum-likelihood'),
('The cost function rewritten',
2,
None,
'the-cost-function-rewritten'),
('Minimizing the cross entropy',
2,
None,
'minimizing-the-cross-entropy'),
('A more compact expression',
2,
None,
'a-more-compact-expression'),
('Extending to more predictors',
2,
None,
'extending-to-more-predictors'),
('Including more classes', 2, None, 'including-more-classes'),
('More classes', 2, None, 'more-classes'),
('Optimization, the central part of any Machine Learning '
'algortithm',
2,
None,
'optimization-the-central-part-of-any-machine-learning-algortithm'),
('Revisiting our Logistic Regression case',
2,
None,
'revisiting-our-logistic-regression-case'),
('The equations to solve', 2, None, 'the-equations-to-solve'),
("Solving using Newton-Raphson's method",
2,
None,
'solving-using-newton-raphson-s-method'),
('Example code for Logistic Regression',
2,
None,
'example-code-for-logistic-regression'),
('Synthetic data generation',
3,
None,
'synthetic-data-generation'),
('Using _Scikit-learn_', 2, None, 'using-scikit-learn'),
('Using the correlation matrix',
2,
None,
'using-the-correlation-matrix'),
('Discussing the correlation data',
2,
None,
'discussing-the-correlation-data'),
('Other measures in classification studies',
2,
None,
'other-measures-in-classification-studies'),
('Introduction to Neural networks',
2,
None,
'introduction-to-neural-networks'),
('Artificial neurons', 2, None, 'artificial-neurons'),
('Neural network types', 2, None, 'neural-network-types'),
('Feed-forward neural networks',
2,
None,
'feed-forward-neural-networks'),
('Convolutional Neural Network',
2,
None,
'convolutional-neural-network'),
('Recurrent neural networks',
2,
None,
'recurrent-neural-networks'),
('Other types of networks', 2, None, 'other-types-of-networks'),
('Multilayer perceptrons', 2, None, 'multilayer-perceptrons'),
('Why multilayer perceptrons?',
2,
None,
'why-multilayer-perceptrons'),
('Illustration of a single perceptron model and a '
'multi-perceptron model',
2,
None,
'illustration-of-a-single-perceptron-model-and-a-multi-perceptron-model'),
('Examples of XOR, OR and AND gates',
2,
None,
'examples-of-xor-or-and-and-gates'),
('Does Logistic Regression do a better Job?',
2,
None,
'does-logistic-regression-do-a-better-job'),
('Adding Neural Networks', 2, None, 'adding-neural-networks'),
('Mathematical model', 2, None, 'mathematical-model'),
('Mathematical model', 2, None, 'mathematical-model'),
('Mathematical model', 2, None, 'mathematical-model'),
('Mathematical model', 2, None, 'mathematical-model'),
('Mathematical model', 2, None, 'mathematical-model'),
('Matrix-vector notation', 3, None, 'matrix-vector-notation'),
('Matrix-vector notation and activation',
3,
None,
'matrix-vector-notation-and-activation'),
('Activation functions', 3, None, 'activation-functions'),
('Activation functions, Logistic and Hyperbolic ones',
3,
None,
'activation-functions-logistic-and-hyperbolic-ones'),
('Relevance', 3, None, 'relevance')]}
end of tocinfo -->
<body>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
equationNumbers: { autoNumber: "none" },
extensions: ["AMSmath.js", "AMSsymbols.js", "autobold.js", "color.js"]
}
});
</script>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- Bootstrap navigation bar -->
<div class="navbar navbar-default navbar-fixed-top">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="week40-bs.html">Week 40: Gradient descent methods (continued) and start Neural networks</a>
</div>
<div class="navbar-collapse collapse navbar-responsive-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Contents <b class="caret"></b></a>
<ul class="dropdown-menu">
<!-- navigation toc: --> <li><a href="._week40-bs001.html#lecture-monday-september-29-2025" style="font-size: 80%;"><b>Lecture Monday September 29, 2025</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs002.html#suggested-readings-and-videos" style="font-size: 80%;"><b>Suggested readings and videos</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs003.html#lab-sessions-tuesday-and-wednesday" style="font-size: 80%;"><b>Lab sessions Tuesday and Wednesday</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs004.html#logistic-regression-from-last-week" style="font-size: 80%;"><b>Logistic Regression, from last week</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs005.html#classification-problems" style="font-size: 80%;"><b>Classification problems</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs006.html#optimization-and-deep-learning" style="font-size: 80%;"><b>Optimization and Deep learning</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs007.html#basics" style="font-size: 80%;"><b>Basics</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs008.html#two-parameters" style="font-size: 80%;"><b>Two parameters</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs009.html#maximum-likelihood" style="font-size: 80%;"><b>Maximum likelihood</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs010.html#the-cost-function-rewritten" style="font-size: 80%;"><b>The cost function rewritten</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs011.html#minimizing-the-cross-entropy" style="font-size: 80%;"><b>Minimizing the cross entropy</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs012.html#a-more-compact-expression" style="font-size: 80%;"><b>A more compact expression</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs013.html#extending-to-more-predictors" style="font-size: 80%;"><b>Extending to more predictors</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs014.html#including-more-classes" style="font-size: 80%;"><b>Including more classes</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs015.html#more-classes" style="font-size: 80%;"><b>More classes</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs016.html#optimization-the-central-part-of-any-machine-learning-algortithm" style="font-size: 80%;"><b>Optimization, the central part of any Machine Learning algortithm</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs017.html#revisiting-our-logistic-regression-case" style="font-size: 80%;"><b>Revisiting our Logistic Regression case</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs018.html#the-equations-to-solve" style="font-size: 80%;"><b>The equations to solve</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs019.html#solving-using-newton-raphson-s-method" style="font-size: 80%;"><b>Solving using Newton-Raphson's method</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs020.html#example-code-for-logistic-regression" style="font-size: 80%;"><b>Example code for Logistic Regression</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs020.html#synthetic-data-generation" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Synthetic data generation</a></li>
<!-- navigation toc: --> <li><a href="._week40-bs021.html#using-scikit-learn" style="font-size: 80%;"><b>Using <b>Scikit-learn</b></b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs022.html#using-the-correlation-matrix" style="font-size: 80%;"><b>Using the correlation matrix</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs023.html#discussing-the-correlation-data" style="font-size: 80%;"><b>Discussing the correlation data</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs024.html#other-measures-in-classification-studies" style="font-size: 80%;"><b>Other measures in classification studies</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs025.html#introduction-to-neural-networks" style="font-size: 80%;"><b>Introduction to Neural networks</b></a></li>
<!-- navigation toc: --> <li><a href="#artificial-neurons" style="font-size: 80%;"><b>Artificial neurons</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs027.html#neural-network-types" style="font-size: 80%;"><b>Neural network types</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs028.html#feed-forward-neural-networks" style="font-size: 80%;"><b>Feed-forward neural networks</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs029.html#convolutional-neural-network" style="font-size: 80%;"><b>Convolutional Neural Network</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs030.html#recurrent-neural-networks" style="font-size: 80%;"><b>Recurrent neural networks</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs031.html#other-types-of-networks" style="font-size: 80%;"><b>Other types of networks</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs032.html#multilayer-perceptrons" style="font-size: 80%;"><b>Multilayer perceptrons</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs033.html#why-multilayer-perceptrons" style="font-size: 80%;"><b>Why multilayer perceptrons?</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs034.html#illustration-of-a-single-perceptron-model-and-a-multi-perceptron-model" style="font-size: 80%;"><b>Illustration of a single perceptron model and a multi-perceptron model</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs035.html#examples-of-xor-or-and-and-gates" style="font-size: 80%;"><b>Examples of XOR, OR and AND gates</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs036.html#does-logistic-regression-do-a-better-job" style="font-size: 80%;"><b>Does Logistic Regression do a better Job?</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs037.html#adding-neural-networks" style="font-size: 80%;"><b>Adding Neural Networks</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs042.html#mathematical-model" style="font-size: 80%;"><b>Mathematical model</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs042.html#mathematical-model" style="font-size: 80%;"><b>Mathematical model</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs042.html#mathematical-model" style="font-size: 80%;"><b>Mathematical model</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs042.html#mathematical-model" style="font-size: 80%;"><b>Mathematical model</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs042.html#mathematical-model" style="font-size: 80%;"><b>Mathematical model</b></a></li>
<!-- navigation toc: --> <li><a href="._week40-bs043.html#matrix-vector-notation" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Matrix-vector notation</a></li>
<!-- navigation toc: --> <li><a href="._week40-bs044.html#matrix-vector-notation-and-activation" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Matrix-vector notation and activation</a></li>
<!-- navigation toc: --> <li><a href="._week40-bs045.html#activation-functions" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Activation functions</a></li>
<!-- navigation toc: --> <li><a href="._week40-bs046.html#activation-functions-logistic-and-hyperbolic-ones" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Activation functions, Logistic and Hyperbolic ones</a></li>
<!-- navigation toc: --> <li><a href="._week40-bs047.html#relevance" style="font-size: 80%;">&nbsp;&nbsp;&nbsp;Relevance</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div> <!-- end of navigation bar -->
<div class="container">
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <!-- add vertical space -->
<a name="part0026"></a>
<!-- !split -->
<h2 id="artificial-neurons" class="anchor">Artificial neurons </h2>
<p>The field of artificial neural networks has a long history of
development, and is closely connected with the advancement of computer
science and computers in general. A model of artificial neurons was
first developed by McCulloch and Pitts in 1943 to study signal
processing in the brain and has later been refined by others. The
general idea is to mimic neural networks in the human brain, which is
composed of billions of neurons that communicate with each other by
sending electrical signals. Each neuron accumulates its incoming
signals, which must exceed an activation threshold to yield an
output. If the threshold is not overcome, the neuron remains inactive,
i.e. has zero output.
</p>
<p>This behaviour has inspired a simple mathematical model for an artificial neuron.</p>
$$
\begin{equation}
y = f\left(\sum_{i=1}^n w_ix_i\right) = f(u)
\tag{1}
\end{equation}
$$
<p>Here, the output \( y \) of the neuron is the value of its activation function, which have as input
a weighted sum of signals \( x_i, \dots ,x_n \) received by \( n \) other neurons.
</p>
<p>Conceptually, it is helpful to divide neural networks into four
categories:
</p>
<ol>
<li> general purpose neural networks for supervised learning,</li>
<li> neural networks designed specifically for image processing, the most prominent example of this class being Convolutional Neural Networks (CNNs),</li>
<li> neural networks for sequential data such as Recurrent Neural Networks (RNNs), and</li>
<li> neural networks for unsupervised learning such as Deep Boltzmann Machines.</li>
</ol>
<p>In natural science, DNNs and CNNs have already found numerous
applications. In statistical physics, they have been applied to detect
phase transitions in 2D Ising and Potts models, lattice gauge
theories, and different phases of polymers, or solving the
Navier-Stokes equation in weather forecasting. Deep learning has also
found interesting applications in quantum physics. Various quantum
phase transitions can be detected and studied using DNNs and CNNs,
topological phases, and even non-equilibrium many-body
localization. Representing quantum states as DNNs quantum state
tomography are among some of the impressive achievements to reveal the
potential of DNNs to facilitate the study of quantum systems.
</p>
<p>In quantum information theory, it has been shown that one can perform
gate decompositions with the help of neural.
</p>
<p>The applications are not limited to the natural sciences. There is a
plethora of applications in essentially all disciplines, from the
humanities to life science and medicine.
</p>
<p>
<!-- navigation buttons at the bottom of the page -->
<ul class="pagination">
<li><a href="._week40-bs025.html">&laquo;</a></li>
<li><a href="._week40-bs000.html">1</a></li>
<li><a href="">...</a></li>
<li><a href="._week40-bs018.html">19</a></li>
<li><a href="._week40-bs019.html">20</a></li>
<li><a href="._week40-bs020.html">21</a></li>
<li><a href="._week40-bs021.html">22</a></li>
<li><a href="._week40-bs022.html">23</a></li>
<li><a href="._week40-bs023.html">24</a></li>
<li><a href="._week40-bs024.html">25</a></li>
<li><a href="._week40-bs025.html">26</a></li>
<li class="active"><a href="._week40-bs026.html">27</a></li>
<li><a href="._week40-bs027.html">28</a></li>
<li><a href="._week40-bs028.html">29</a></li>
<li><a href="._week40-bs029.html">30</a></li>
<li><a href="._week40-bs030.html">31</a></li>
<li><a href="._week40-bs031.html">32</a></li>
<li><a href="._week40-bs032.html">33</a></li>
<li><a href="._week40-bs033.html">34</a></li>
<li><a href="._week40-bs034.html">35</a></li>
<li><a href="._week40-bs035.html">36</a></li>
<li><a href="">...</a></li>
<li><a href="._week40-bs047.html">48</a></li>
<li><a href="._week40-bs027.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
</div> <!-- end container -->
<!-- include javascript, jQuery *first* -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<!-- Bootstrap footer
<footer>
<a href="https://..."><img width="250" align=right src="https://..."></a>
</footer>
-->
<center style="font-size:80%">
<!-- copyright only on the titlepage -->
</center>
</body>
</html>