added more text
This commit is contained in:
@@ -190,6 +190,7 @@ Automatically generated HTML file from DocOnce source
|
||||
'layers-used-to-build-cnns'),
|
||||
('Transforming images', 2, None, 'transforming-images'),
|
||||
('CNNs in brief', 2, None, 'cnns-in-brief'),
|
||||
('Key Idea', 2, None, 'key-idea'),
|
||||
('Mathematics of CNNs', 2, None, 'mathematics-of-cnns'),
|
||||
('Convolution Examples: Polynomial multiplication',
|
||||
2,
|
||||
@@ -358,37 +359,38 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs057.html#layers-used-to-build-cnns" style="font-size: 80%;">Layers used to build CNNs</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs058.html#transforming-images" style="font-size: 80%;">Transforming images</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs059.html#cnns-in-brief" style="font-size: 80%;">CNNs in brief</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs060.html#mathematics-of-cnns" style="font-size: 80%;">Mathematics of CNNs</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs061.html#convolution-examples-polynomial-multiplication" style="font-size: 80%;">Convolution Examples: Polynomial multiplication</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs062.html#efficient-polynomial-multiplication" style="font-size: 80%;">Efficient Polynomial Multiplication</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs063.html#a-more-efficient-way-of-coding-the-above-convolution" style="font-size: 80%;">A more efficient way of coding the above Convolution</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs064.html#convolution-examples-principle-of-superposition-and-periodic-forces-fourier-transforms" style="font-size: 80%;">Convolution Examples: Principle of Superposition and Periodic Forces (Fourier Transforms)</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs065.html#principle-of-superposition" style="font-size: 80%;">Principle of Superposition</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs066.html#simple-code-example" style="font-size: 80%;">Simple Code Example</a></li>
|
||||
<!-- navigation toc: --> <li><a href="#wrapping-up-fourier-transforms" style="font-size: 80%;">Wrapping up Fourier transforms</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs068.html#finding-the-coefficients" style="font-size: 80%;">Finding the Coefficients</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs069.html#final-words-on-fourier-transforms" style="font-size: 80%;">Final words on Fourier Transforms</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs070.html#two-dimensional-objects" style="font-size: 80%;">Two-dimensional Objects</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs071.html#cross-correlation" style="font-size: 80%;">Cross-Correlation</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs072.html#more-on-dimensionalities" style="font-size: 80%;">More on Dimensionalities</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs073.html#further-dimensionality-remarks" style="font-size: 80%;">Further Dimensionality Remarks</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs074.html#cnns-in-more-detail-building-convolutional-neural-networks-in-tensorflow-and-keras" style="font-size: 80%;">CNNs in more detail, building convolutional neural networks in Tensorflow and Keras</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs075.html#setting-it-up" style="font-size: 80%;">Setting it up</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs076.html#the-mnist-dataset-again" style="font-size: 80%;">The MNIST dataset again</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs077.html#strong-correlations" style="font-size: 80%;">Strong correlations</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs078.html#layers-of-a-cnn" style="font-size: 80%;">Layers of a CNN</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs079.html#systematic-reduction" style="font-size: 80%;">Systematic reduction</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs080.html#prerequisites-collect-and-pre-process-data" style="font-size: 80%;">Prerequisites: Collect and pre-process data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs081.html#importing-keras-and-tensorflow" style="font-size: 80%;">Importing Keras and Tensorflow</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs082.html#running-with-keras" style="font-size: 80%;">Running with Keras</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs083.html#final-part" style="font-size: 80%;">Final part</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs084.html#final-visualization" style="font-size: 80%;">Final visualization</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs085.html#the-cifar01-data-set" style="font-size: 80%;">The CIFAR01 data set</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs086.html#verifying-the-data-set" style="font-size: 80%;">Verifying the data set</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs087.html#set-up-the-model" style="font-size: 80%;">Set up the model</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs088.html#add-dense-layers-on-top" style="font-size: 80%;">Add Dense layers on top</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs089.html#compile-and-train-the-model" style="font-size: 80%;">Compile and train the model</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs090.html#finally-evaluate-the-model" style="font-size: 80%;">Finally, evaluate the model</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs060.html#key-idea" style="font-size: 80%;">Key Idea</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs061.html#mathematics-of-cnns" style="font-size: 80%;">Mathematics of CNNs</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs062.html#convolution-examples-polynomial-multiplication" style="font-size: 80%;">Convolution Examples: Polynomial multiplication</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs063.html#efficient-polynomial-multiplication" style="font-size: 80%;">Efficient Polynomial Multiplication</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs064.html#a-more-efficient-way-of-coding-the-above-convolution" style="font-size: 80%;">A more efficient way of coding the above Convolution</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs065.html#convolution-examples-principle-of-superposition-and-periodic-forces-fourier-transforms" style="font-size: 80%;">Convolution Examples: Principle of Superposition and Periodic Forces (Fourier Transforms)</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs066.html#principle-of-superposition" style="font-size: 80%;">Principle of Superposition</a></li>
|
||||
<!-- navigation toc: --> <li><a href="#simple-code-example" style="font-size: 80%;">Simple Code Example</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs068.html#wrapping-up-fourier-transforms" style="font-size: 80%;">Wrapping up Fourier transforms</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs069.html#finding-the-coefficients" style="font-size: 80%;">Finding the Coefficients</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs070.html#final-words-on-fourier-transforms" style="font-size: 80%;">Final words on Fourier Transforms</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs071.html#two-dimensional-objects" style="font-size: 80%;">Two-dimensional Objects</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs072.html#cross-correlation" style="font-size: 80%;">Cross-Correlation</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs073.html#more-on-dimensionalities" style="font-size: 80%;">More on Dimensionalities</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs074.html#further-dimensionality-remarks" style="font-size: 80%;">Further Dimensionality Remarks</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs075.html#cnns-in-more-detail-building-convolutional-neural-networks-in-tensorflow-and-keras" style="font-size: 80%;">CNNs in more detail, building convolutional neural networks in Tensorflow and Keras</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs076.html#setting-it-up" style="font-size: 80%;">Setting it up</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs077.html#the-mnist-dataset-again" style="font-size: 80%;">The MNIST dataset again</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs078.html#strong-correlations" style="font-size: 80%;">Strong correlations</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs079.html#layers-of-a-cnn" style="font-size: 80%;">Layers of a CNN</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs080.html#systematic-reduction" style="font-size: 80%;">Systematic reduction</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs081.html#prerequisites-collect-and-pre-process-data" style="font-size: 80%;">Prerequisites: Collect and pre-process data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs082.html#importing-keras-and-tensorflow" style="font-size: 80%;">Importing Keras and Tensorflow</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs083.html#running-with-keras" style="font-size: 80%;">Running with Keras</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs084.html#final-part" style="font-size: 80%;">Final part</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs085.html#final-visualization" style="font-size: 80%;">Final visualization</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs086.html#the-cifar01-data-set" style="font-size: 80%;">The CIFAR01 data set</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs087.html#verifying-the-data-set" style="font-size: 80%;">Verifying the data set</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs088.html#set-up-the-model" style="font-size: 80%;">Set up the model</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs089.html#add-dense-layers-on-top" style="font-size: 80%;">Add Dense layers on top</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs090.html#compile-and-train-the-model" style="font-size: 80%;">Compile and train the model</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._week42-bs091.html#finally-evaluate-the-model" style="font-size: 80%;">Finally, evaluate the model</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -404,37 +406,46 @@ MathJax.Hub.Config({
|
||||
<a name="part0067"></a>
|
||||
<!-- !split -->
|
||||
|
||||
<h2 id="wrapping-up-fourier-transforms" class="anchor">Wrapping up Fourier transforms </h2>
|
||||
<h2 id="simple-code-example" class="anchor">Simple Code Example </h2>
|
||||
|
||||
<p>
|
||||
We can write down the answer for
|
||||
\( x_{pn}(t) \), by substituting \( f_n/m \) or \( g_n/m \) for \( F_0/m \). By
|
||||
writing each factor \( 2n\pi t/\tau \) as \( n\omega t \), with \( \omega\equiv
|
||||
2\pi/\tau \),
|
||||
The code here shows a typical example of such a square wave generated using the functionality included in the <b>scipy</b> Python package. We have used a period of \( \tau=0.2 \).
|
||||
|
||||
<p>
|
||||
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
|
||||
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">numpy</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">np</span>
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">math</span>
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">scipy</span> <span style="color: #008000; font-weight: bold">import</span> signal
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">matplotlib.pyplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">plt</span>
|
||||
|
||||
<span style="color: #408080; font-style: italic"># number of points </span>
|
||||
n <span style="color: #666666">=</span> <span style="color: #666666">500</span>
|
||||
<span style="color: #408080; font-style: italic"># start and final times </span>
|
||||
t0 <span style="color: #666666">=</span> <span style="color: #666666">0.0</span>
|
||||
tn <span style="color: #666666">=</span> <span style="color: #666666">1.0</span>
|
||||
<span style="color: #408080; font-style: italic"># Period </span>
|
||||
t <span style="color: #666666">=</span> np<span style="color: #666666">.</span>linspace(t0, tn, n, endpoint<span style="color: #666666">=</span><span style="color: #008000; font-weight: bold">False</span>)
|
||||
SqrSignal <span style="color: #666666">=</span> np<span style="color: #666666">.</span>zeros(n)
|
||||
SqrSignal <span style="color: #666666">=</span> <span style="color: #666666">1.0+</span>signal<span style="color: #666666">.</span>square(<span style="color: #666666">2*</span>np<span style="color: #666666">.</span>pi<span style="color: #666666">*5*</span>t)
|
||||
plt<span style="color: #666666">.</span>plot(t, SqrSignal)
|
||||
plt<span style="color: #666666">.</span>ylim(<span style="color: #666666">-0.5</span>, <span style="color: #666666">2.5</span>)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
</pre></div>
|
||||
<p>
|
||||
For the sinusoidal example the
|
||||
period is \( \tau=2\pi/\omega \). However, higher harmonics can also
|
||||
satisfy the periodicity requirement. In general, any force that
|
||||
satisfies the periodicity requirement can be expressed as a sum over
|
||||
harmonics,
|
||||
|
||||
$$
|
||||
\begin{equation}
|
||||
\tag{23}
|
||||
F(t)=\frac{f_0}{2}+\sum_{n>0}f_n\cos(n\omega t)+g_n\sin(n\omega t).
|
||||
F(t)=\frac{f_0}{2}+\sum_{n>0} f_n\cos(2n\pi t/\tau)+g_n\sin(2n\pi t/\tau).
|
||||
\tag{22}
|
||||
\end{equation}
|
||||
$$
|
||||
|
||||
<p>
|
||||
The solutions for \( x(t) \) then come from replacing \( \omega \) with
|
||||
\( n\omega \) for each term in the particular solution,
|
||||
|
||||
$$
|
||||
\begin{eqnarray}
|
||||
x_p(t)&=&\frac{f_0}{2k}+\sum_{n>0} \alpha_n\cos(n\omega t-\delta_n)+\beta_n\sin(n\omega t-\delta_n),\\
|
||||
\nonumber
|
||||
\alpha_n&=&\frac{f_n/m}{\sqrt{((n\omega)^2-\omega_0^2)+4\beta^2n^2\omega^2}},\\
|
||||
\nonumber
|
||||
\beta_n&=&\frac{g_n/m}{\sqrt{((n\omega)^2-\omega_0^2)+4\beta^2n^2\omega^2}},\\
|
||||
\nonumber
|
||||
\delta_n&=&\tan^{-1}\left(\frac{2\beta n\omega}{\omega_0^2-n^2\omega^2}\right).
|
||||
\end{eqnarray}
|
||||
$$
|
||||
|
||||
<p>
|
||||
<p>
|
||||
<!-- navigation buttons at the bottom of the page -->
|
||||
@@ -461,7 +472,7 @@ $$
|
||||
<li><a href="._week42-bs075.html">76</a></li>
|
||||
<li><a href="._week42-bs076.html">77</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._week42-bs090.html">91</a></li>
|
||||
<li><a href="._week42-bs091.html">92</a></li>
|
||||
<li><a href="._week42-bs068.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
Reference in New Issue
Block a user