This commit is contained in:
Morten Hjorth-Jensen
2024-10-28 13:21:17 +01:00
parent a453d1018d
commit 9f280e559e
11 changed files with 699 additions and 954 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+6 -46
View File
@@ -536,11 +536,6 @@ const thebe_selector_output = ".output, .cell_output"
Mathematics of CNNs
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#id1">
Mathematics of CNNs
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#convolution-examples-polynomial-multiplication">
Convolution Examples: Polynomial multiplication
@@ -978,11 +973,6 @@ const thebe_selector_output = ".output, .cell_output"
Mathematics of CNNs
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#id1">
Mathematics of CNNs
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#convolution-examples-polynomial-multiplication">
Convolution Examples: Polynomial multiplication
@@ -1319,7 +1309,7 @@ doconce format html week44.do.txt --no_mako -->
<!-- dom:TITLE: Week 44, Convolutional Neural Networks (CNN) --><div class="tex2jax_ignore mathjax_ignore section" id="week-44-convolutional-neural-networks-cnn">
<h1>Week 44, Convolutional Neural Networks (CNN)<a class="headerlink" href="#week-44-convolutional-neural-networks-cnn" title="Permalink to this headline"></a></h1>
<p><strong>Morten Hjorth-Jensen</strong>, Department of Physics, University of Oslo, Norway</p>
<p>Date: **October 28-November 1 **</p>
<p>Date: <strong>October 28</strong></p>
<div class="section" id="plan-for-week-44">
<h2>Plan for week 44<a class="headerlink" href="#plan-for-week-44" title="Permalink to this headline"></a></h2>
<p><strong>Material for the lecture Monday October 28, 2024.</strong></p>
@@ -1330,10 +1320,12 @@ doconce format html week44.do.txt --no_mako -->
<ul class="simple">
<li><p>These lecture notes at <a class="reference external" href="https://github.com/CompPhysics/MachineLearning/blob/master/doc/pub/week44/ipynb/week44.ipynb">https://github.com/CompPhysics/MachineLearning/blob/master/doc/pub/week44/ipynb/week44.ipynb</a></p></li>
<li><p>For a more in depth discussion on neural networks we recommend Goodfellow et al chapter 9. See also chapter 11 and 12 on practicalities and applications</p></li>
<li><p>Reading suggestions for implementation of CNNs see &lt;Rashcka et al.s chapter 14&gt;:”<a class="reference external" href="https://github.com/rasbt/machine-learning-book/tree/main/ch14">https://github.com/rasbt/machine-learning-book/tree/main/ch14</a>.</p></li>
<li><p>Reading suggestions for implementation of CNNs see Rashcka et al.s chapter 14 at <a class="reference external" href="https://github.com/rasbt/machine-learning-book/tree/main/ch14">https://github.com/rasbt/machine-learning-book/tree/main/ch14</a>.</p></li>
<li><p>Video on Deep Learning at <a class="reference external" href="https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi">https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi</a></p></li>
<li><p>Video on Convolutional Neural Networks from MIT at <a class="reference external" href="https://www.youtube.com/watch?v=iaSUYvmCekI&amp;amp;ab_channel=AlexanderAmini">https://www.youtube.com/watch?v=iaSUYvmCekI&amp;amp;ab_channel=AlexanderAmini</a></p></li>
<li><p>Video on CNNs from Stanford at <a class="reference external" href="https://www.youtube.com/watch?v=bNb2fEVKeEo&amp;amp;list=PLC1qU-LWwrF64f4QKQT-Vg5Wr4qEE1Zxk&amp;amp;index=6&amp;amp;ab_channel=StanfordUniversitySchoolofEngineering">https://www.youtube.com/watch?v=bNb2fEVKeEo&amp;amp;list=PLC1qU-LWwrF64f4QKQT-Vg5Wr4qEE1Zxk&amp;amp;index=6&amp;amp;ab_channel=StanfordUniversitySchoolofEngineering</a></p></li>
<li><p>Video of lecture October 28 at <a class="reference external" href="https://youtu.be/rfrSfikAz94">https://youtu.be/rfrSfikAz94</a></p></li>
<li><p>Whiteboard notes at <a class="reference external" href="https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/2024/NotesOctober28">https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/2024/NotesOctober28</a></p></li>
</ul>
</div>
<div class="section" id="lab-sessions-on-tuesday-and-wednesday">
@@ -1342,8 +1334,7 @@ doconce format html week44.do.txt --no_mako -->
<li><p>Main focus is discussion of and work on project 2</p></li>
<li><p>If you did not get time to finish the exercises from week 43, you can also keep working on them and hand in this coming Friday</p></li>
</ul>
<!-- * [Video of lab session from week 44](https://youtu.be/EajWMW__k0I) -->
<!-- * [See also whiteboard notes from lab session week 44](https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/2023/Exercisesweek44.pdf) --></div>
</div>
<div class="section" id="material-for-lecture-monday-october-28">
<h2>Material for Lecture Monday October 28<a class="headerlink" href="#material-for-lecture-monday-october-28" title="Permalink to this headline"></a></h2>
</div>
@@ -1723,37 +1714,6 @@ y(t) = \sum_{a=-\infty}^{a=\infty}x(a)w(t-a).
<p>Computing the inverse of the above convolution operations is known as deconvolution and the process is commutative.</p>
<p>How can we use this? And what does it mean? Let us study some familiar examples first.</p>
</div>
<div class="section" id="id1">
<h2>Mathematics of CNNs<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2>
<p>The mathematics of CNNs is based on the mathematical operation of
<strong>convolution</strong>. In mathematics (in particular in functional analysis),
convolution is represented by mathematical operations (integration,
summation etc) on two functions in order to produce a third function
that expresses how the shape of one gets modified by the other.
Convolution has a plethora of applications in a variety of
disciplines, spanning from statistics to signal processing, computer
vision, solutions of differential equations,linear algebra,
engineering, and yes, machine learning.</p>
<p>Mathematically, convolution is defined as follows (one-dimensional example):
Let us define a continuous function <span class="math notranslate nohighlight">\(y(t)\)</span> given by</p>
<div class="math notranslate nohighlight">
\[
y(t) = \int x(a) w(t-a) da,
\]</div>
<p>where <span class="math notranslate nohighlight">\(x(a)\)</span> represents a so-called input and <span class="math notranslate nohighlight">\(w(t-a)\)</span> is normally called the weight function or kernel.</p>
<p>The above integral is written in a more compact form as</p>
<div class="math notranslate nohighlight">
\[
y(t) = \left(x * w\right)(t).
\]</div>
<p>The discretized version reads</p>
<div class="math notranslate nohighlight">
\[
y(t) = \sum_{a=-\infty}^{a=\infty}x(a)w(t-a).
\]</div>
<p>Computing the inverse of the above convolution operations is known as deconvolution and the process is commutative.</p>
<p>How can we use this? And what does it mean? Let us study some familiar examples first.</p>
</div>
<div class="section" id="convolution-examples-polynomial-multiplication">
<h2>Convolution Examples: Polynomial multiplication<a class="headerlink" href="#convolution-examples-polynomial-multiplication" title="Permalink to this headline"></a></h2>
<p>Our first example is that of a multiplication between two polynomials,
@@ -2289,7 +2249,7 @@ classification.</p>
labels = (n_inputs) = (1797,)
</pre></div>
</div>
<img alt="_images/week44_125_1.png" src="_images/week44_125_1.png" />
<img alt="_images/week44_118_1.png" src="_images/week44_118_1.png" />
</div>
</div>
</div>
File diff suppressed because it is too large Load Diff
@@ -8,7 +8,7 @@
# # Week 44, Convolutional Neural Networks (CNN)
# **Morten Hjorth-Jensen**, Department of Physics, University of Oslo, Norway
#
# Date: **October 28-November 1 **
# Date: **October 28**
# ## Plan for week 44
#
@@ -22,21 +22,23 @@
#
# * For a more in depth discussion on neural networks we recommend Goodfellow et al chapter 9. See also chapter 11 and 12 on practicalities and applications
#
# * Reading suggestions for implementation of CNNs see <Rashcka et al.'s chapter 14>:"https://github.com/rasbt/machine-learning-book/tree/main/ch14".
# * Reading suggestions for implementation of CNNs see Rashcka et al.'s chapter 14 at <https://github.com/rasbt/machine-learning-book/tree/main/ch14>.
#
# * Video on Deep Learning at <https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi>
#
# * Video on Convolutional Neural Networks from MIT at <https://www.youtube.com/watch?v=iaSUYvmCekI&ab_channel=AlexanderAmini>
#
# * Video on CNNs from Stanford at <https://www.youtube.com/watch?v=bNb2fEVKeEo&list=PLC1qU-LWwrF64f4QKQT-Vg5Wr4qEE1Zxk&index=6&ab_channel=StanfordUniversitySchoolofEngineering>
#
# * Video of lecture October 28 at <https://youtu.be/rfrSfikAz94>
#
# * Whiteboard notes at <https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/2024/NotesOctober28>
# ## Lab sessions on Tuesday and Wednesday
#
# * Main focus is discussion of and work on project 2
#
# * If you did not get time to finish the exercises from week 43, you can also keep working on them and hand in this coming Friday
# <!-- * [Video of lab session from week 44](https://youtu.be/EajWMW__k0I) -->
# <!-- * [See also whiteboard notes from lab session week 44](https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/2023/Exercisesweek44.pdf) -->
# ## Material for Lecture Monday October 28
@@ -337,43 +339,6 @@ for k in (5,10, 20, 100,200,400,500):
print('Signa to noise ratio '+ str(round(srv)) +'dB')
# ## Mathematics of CNNs
#
# The mathematics of CNNs is based on the mathematical operation of
# **convolution**. In mathematics (in particular in functional analysis),
# convolution is represented by mathematical operations (integration,
# summation etc) on two functions in order to produce a third function
# that expresses how the shape of one gets modified by the other.
# Convolution has a plethora of applications in a variety of
# disciplines, spanning from statistics to signal processing, computer
# vision, solutions of differential equations,linear algebra,
# engineering, and yes, machine learning.
#
# Mathematically, convolution is defined as follows (one-dimensional example):
# Let us define a continuous function $y(t)$ given by
# $$
# y(t) = \int x(a) w(t-a) da,
# $$
# where $x(a)$ represents a so-called input and $w(t-a)$ is normally called the weight function or kernel.
#
# The above integral is written in a more compact form as
# $$
# y(t) = \left(x * w\right)(t).
# $$
# The discretized version reads
# $$
# y(t) = \sum_{a=-\infty}^{a=\infty}x(a)w(t-a).
# $$
# Computing the inverse of the above convolution operations is known as deconvolution and the process is commutative.
#
# How can we use this? And what does it mean? Let us study some familiar examples first.
# ## Mathematics of CNNs
#
# The mathematics of CNNs is based on the mathematical operation of
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

File diff suppressed because it is too large Load Diff