Files
FYS-STK4155/doc/pub/BM/html/._BM-bs066.html
T
2018-11-29 05:31:05 +01:00

428 lines
22 KiB
HTML

<!--
Automatically generated HTML file from DocOnce source
(https://github.com/hplgit/doconce/)
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
<meta name="description" content="Machine Learning and Boltzmann machines with applications">
<title>Machine Learning and Boltzmann machines with applications</title>
<!-- Bootstrap style: bootstrap -->
<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': [('Types of Machine Learning, a repetition', 2, None, '___sec0'),
('Why Boltzmann machines?', 2, None, '___sec1'),
('An intermediate step, the Hopfield network and links to the '
'Ising and Potts models',
2,
None,
'___sec2'),
('A brief review on Markov Chains, Metropolis and Gibbs sampling',
2,
None,
'___sec3'),
('Brownian motion and Markov processes', 2, None, '___sec4'),
('Brownian motion and Markov processes, Ergodicity and Detailed '
'balance',
2,
None,
'___sec5'),
('Brownian motion and Markov processes, jargon',
2,
None,
'___sec6'),
('Brownian motion and Markov processes, sequence of ingredients',
2,
None,
'___sec7'),
('Applications: almost every field in science',
2,
None,
'___sec8'),
('Markov processes', 2, None, '___sec9'),
('Markov processes', 2, None, '___sec10'),
('Markov processes, the probabilities', 2, None, '___sec11'),
('Markov processes', 2, None, '___sec12'),
('An Illustrative Example', 2, None, '___sec13'),
('An Illustrative Example', 2, None, '___sec14'),
('An Illustrative Example, next step', 2, None, '___sec15'),
('An Illustrative Example, the steady state',
2,
None,
'___sec16'),
('An Illustrative Example, iterative steps', 2, None, '___sec17'),
('An Illustrative Example, what does it mean?',
2,
None,
'___sec18'),
('An Illustrative Example, understanding the basics',
2,
None,
'___sec19'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec20'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec21'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec22'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec23'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec24'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec25'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec26'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec27'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec28'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec29'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec30'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec31'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec32'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec33'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec34'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec35'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec36'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec37'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec38'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec39'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec40'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec41'),
('The Metropolis Algorithm and Detailed Balance',
2,
None,
'___sec42'),
('Brief Summary', 2, None, '___sec43'),
('Gibbs sampling', 2, None, '___sec44'),
('Boltzmann Machines', 2, None, '___sec45'),
('Some similarities and differences from DNNs',
2,
None,
'___sec46'),
('Boltzmann machines (BM)', 2, None, '___sec47'),
('A standard BM setup', 2, None, '___sec48'),
('The structure of the RBM network', 2, None, '___sec49'),
('The network', 2, None, '___sec50'),
('Goals', 2, None, '___sec51'),
('Joint distribution', 2, None, '___sec52'),
('Network Elements, the energy function', 2, None, '___sec53'),
('Defining different types of RBMs', 2, None, '___sec54'),
('More about RBMs', 2, None, '___sec55'),
('Sampling: Metropolis sampling', 2, None, '___sec56'),
('Sampling: Gibbs sampling', 2, None, '___sec57'),
('Gaussian RBM', 2, None, '___sec58'),
('Cost function', 2, None, '___sec59'),
('Optimization / Training', 2, None, '___sec60'),
('More on RBMs', 2, None, '___sec61'),
('Which sampling to use', 2, None, '___sec62'),
('Kullback-Leibler relative entropy', 2, None, '___sec63'),
('Optimizing the cost function', 2, None, '___sec64'),
('Setting up for gradient descent calculations',
2,
None,
'___sec65'),
('More interpretations', 2, None, '___sec66'),
('Recent examples: RBMs for the quantum many body problem',
2,
None,
'___sec67'),
('Choose the right RBM', 2, None, '___sec68'),
('Representing the wave function', 2, None, '___sec69'),
('Choose the cost function', 2, None, '___sec70'),
('Running the codes', 2, None, '___sec71'),
('Energy as function of iterations, $N=2$ electrons',
2,
None,
'___sec72')]}
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="BM-bs.html">Machine Learning and Boltzmann machines with applications</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="._BM-bs001.html#___sec0" style="font-size: 80%;">Types of Machine Learning, a repetition</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs002.html#___sec1" style="font-size: 80%;">Why Boltzmann machines?</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs003.html#___sec2" style="font-size: 80%;">An intermediate step, the Hopfield network and links to the Ising and Potts models</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs004.html#___sec3" style="font-size: 80%;">A brief review on Markov Chains, Metropolis and Gibbs sampling</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs005.html#___sec4" style="font-size: 80%;">Brownian motion and Markov processes</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs006.html#___sec5" style="font-size: 80%;">Brownian motion and Markov processes, Ergodicity and Detailed balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs007.html#___sec6" style="font-size: 80%;">Brownian motion and Markov processes, jargon</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs008.html#___sec7" style="font-size: 80%;">Brownian motion and Markov processes, sequence of ingredients</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs009.html#___sec8" style="font-size: 80%;">Applications: almost every field in science</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs010.html#___sec9" style="font-size: 80%;">Markov processes</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs011.html#___sec10" style="font-size: 80%;">Markov processes</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs012.html#___sec11" style="font-size: 80%;">Markov processes, the probabilities</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs013.html#___sec12" style="font-size: 80%;">Markov processes</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs014.html#___sec13" style="font-size: 80%;">An Illustrative Example</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs015.html#___sec14" style="font-size: 80%;">An Illustrative Example</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs016.html#___sec15" style="font-size: 80%;">An Illustrative Example, next step</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs017.html#___sec16" style="font-size: 80%;">An Illustrative Example, the steady state</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs018.html#___sec17" style="font-size: 80%;">An Illustrative Example, iterative steps</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs019.html#___sec18" style="font-size: 80%;">An Illustrative Example, what does it mean?</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs020.html#___sec19" style="font-size: 80%;">An Illustrative Example, understanding the basics</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs021.html#___sec20" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs022.html#___sec21" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs023.html#___sec22" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs024.html#___sec23" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs025.html#___sec24" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs026.html#___sec25" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs027.html#___sec26" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs028.html#___sec27" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs029.html#___sec28" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs030.html#___sec29" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs031.html#___sec30" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs032.html#___sec31" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs033.html#___sec32" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs034.html#___sec33" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs035.html#___sec34" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs036.html#___sec35" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs037.html#___sec36" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs038.html#___sec37" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs039.html#___sec38" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs040.html#___sec39" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs041.html#___sec40" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs042.html#___sec41" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs043.html#___sec42" style="font-size: 80%;">The Metropolis Algorithm and Detailed Balance</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs044.html#___sec43" style="font-size: 80%;">Brief Summary</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs045.html#___sec44" style="font-size: 80%;">Gibbs sampling</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs046.html#___sec45" style="font-size: 80%;">Boltzmann Machines</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs047.html#___sec46" style="font-size: 80%;">Some similarities and differences from DNNs</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs048.html#___sec47" style="font-size: 80%;">Boltzmann machines (BM)</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs049.html#___sec48" style="font-size: 80%;">A standard BM setup</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs050.html#___sec49" style="font-size: 80%;">The structure of the RBM network</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs051.html#___sec50" style="font-size: 80%;">The network</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs052.html#___sec51" style="font-size: 80%;">Goals</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs053.html#___sec52" style="font-size: 80%;">Joint distribution</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs054.html#___sec53" style="font-size: 80%;">Network Elements, the energy function</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs055.html#___sec54" style="font-size: 80%;">Defining different types of RBMs</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs056.html#___sec55" style="font-size: 80%;">More about RBMs</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs057.html#___sec56" style="font-size: 80%;">Sampling: Metropolis sampling</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs058.html#___sec57" style="font-size: 80%;">Sampling: Gibbs sampling</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs059.html#___sec58" style="font-size: 80%;">Gaussian RBM</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs060.html#___sec59" style="font-size: 80%;">Cost function</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs061.html#___sec60" style="font-size: 80%;">Optimization / Training</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs062.html#___sec61" style="font-size: 80%;">More on RBMs</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs063.html#___sec62" style="font-size: 80%;">Which sampling to use</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs064.html#___sec63" style="font-size: 80%;">Kullback-Leibler relative entropy</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs065.html#___sec64" style="font-size: 80%;">Optimizing the cost function</a></li>
<!-- navigation toc: --> <li><a href="#___sec65" style="font-size: 80%;">Setting up for gradient descent calculations</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs067.html#___sec66" style="font-size: 80%;">More interpretations</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs068.html#___sec67" style="font-size: 80%;">Recent examples: RBMs for the quantum many body problem</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs069.html#___sec68" style="font-size: 80%;">Choose the right RBM</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs070.html#___sec69" style="font-size: 80%;">Representing the wave function</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs071.html#___sec70" style="font-size: 80%;">Choose the cost function</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs072.html#___sec71" style="font-size: 80%;">Running the codes</a></li>
<!-- navigation toc: --> <li><a href="._BM-bs073.html#___sec72" style="font-size: 80%;">Energy as function of iterations, \( N=2 \) electrons</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="part0066"></a>
<!-- !split -->
<h2 id="___sec65" class="anchor">Setting up for gradient descent calculations </h2>
<p>
Using the previous relationship we can express the gradient of the cost function as
$$
\begin{align}
\frac{\partial \mathcal{C}_{LL}}{\partial \theta_i}
=& \langle \frac{ \partial E(\boldsymbol{x}; \theta_i) } { \partial \theta_i} \rangle_{data} + \frac{\partial \log Z(\theta_i)}{ \partial \theta_i}
\tag{34}\\
=& \langle \frac{ \partial E(\boldsymbol{x}; \theta_i) } { \partial \theta_i} \rangle_{data} - \langle \frac{ \partial E(\boldsymbol{x}; \theta_i) } { \partial \theta_i} \rangle_{model}
\tag{35}\\
%=& \langle O_i(\boldsymbol{x}) \rangle_{data} - \langle O_i(\boldsymbol{x}) \rangle_{model}
\tag{36}
\end{align}
$$
<p>
This expression shows that the gradient of the log-likelihood cost
function is a <b>difference of moments</b>, with one calculated from
the data and one calculated from the model. The data-dependent term is
called the <b>positive phase</b> and the model-dependent term is
called the <b>negative phase</b> of the gradient. We see now that
minimizing the cost function results in lowering the energy of
configurations \( \boldsymbol{x} \) near points in the training data and
increasing the energy of configurations not observed in the training
data. That means we increase the model's probability of configurations
similar to those in the training data.
<p>
<p>
<!-- navigation buttons at the bottom of the page -->
<ul class="pagination">
<li><a href="._BM-bs065.html">&laquo;</a></li>
<li><a href="._BM-bs000.html">1</a></li>
<li><a href="">...</a></li>
<li><a href="._BM-bs058.html">59</a></li>
<li><a href="._BM-bs059.html">60</a></li>
<li><a href="._BM-bs060.html">61</a></li>
<li><a href="._BM-bs061.html">62</a></li>
<li><a href="._BM-bs062.html">63</a></li>
<li><a href="._BM-bs063.html">64</a></li>
<li><a href="._BM-bs064.html">65</a></li>
<li><a href="._BM-bs065.html">66</a></li>
<li class="active"><a href="._BM-bs066.html">67</a></li>
<li><a href="._BM-bs067.html">68</a></li>
<li><a href="._BM-bs068.html">69</a></li>
<li><a href="._BM-bs069.html">70</a></li>
<li><a href="._BM-bs070.html">71</a></li>
<li><a href="._BM-bs071.html">72</a></li>
<li><a href="._BM-bs072.html">73</a></li>
<li><a href="._BM-bs073.html">74</a></li>
<li><a href="._BM-bs067.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="http://..."><img width="250" align=right src="http://..."></a>
</footer>
-->
<center style="font-size:80%">
<!-- copyright only on the titlepage -->
</center>
</body>
</html>