Skip to content

Commit

Permalink
API updated
Browse files Browse the repository at this point in the history
  • Loading branch information
marionmari committed Jul 22, 2014
1 parent 4218ec9 commit 4155b61
Show file tree
Hide file tree
Showing 59 changed files with 152 additions and 144 deletions.
Binary file modified doc/build/doctrees/CV.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/Examples.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/GPC.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/GPC_FITC.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/GPMC.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/GPR.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/GPR_FITC.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/Graph.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/Install.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/Kernels.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/Likelihoods.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/Opts.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/SemiSupervised.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/Theory.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/_static/copyright.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/demoHousing.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/demoMaunaLoa.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified doc/build/doctrees/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 2abc3c3e7678fef7f1895889019e9c34
config: 671334558ad756f088d7c8b8718316be
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion doc/build/html/CV.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2013, Marion Neumann, Shan Huang, Daniel Marthaler, Kristian Kersting.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>
8 changes: 4 additions & 4 deletions doc/build/html/Examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ <h3>Navigation</h3>

<div class="section" id="demos">
<h1>Demos<a class="headerlink" href="#demos" title="Permalink to this headline"></a></h1>
<p>There are several demos exemplifying the use of pyGPs for various Gaussian process (<img class="math" src="_images/math/192d69ed9c7bd67b3f34486786531bae08ba2d88.png" alt="GP"/>) tasks.
We recommend to first go through <em>Basic GP Regression</em> which introduces the <img class="math" src="_images/math/192d69ed9c7bd67b3f34486786531bae08ba2d88.png" alt="GP"/> regression model.
Basic regression is the most intuitive and simplest learning task feasable with <img class="math" src="_images/math/502c8d8d8b92a24e5186c2d0d79f44b1d97e373b.png" alt="GPs"/>.
<p>There are several demos exemplifying the use of pyGPs for various Gaussian process (<img class="math" src="_images/math/bc008ec23119a8f24d723e0616fee9a6f9a87cd2.png" alt="GP"/>) tasks.
We recommend to first go through <em>Basic GP Regression</em> which introduces the <img class="math" src="_images/math/bc008ec23119a8f24d723e0616fee9a6f9a87cd2.png" alt="GP"/> regression model.
Basic regression is the most intuitive and simplest learning task feasable with <img class="math" src="_images/math/296cca5da127cd61508d98f42eb470f637e9912c.png" alt="GPs"/>.
The other demos will then provide a general insight into more advanced functionalities of the package.
You will also find the implementation of the demos in the <a class="reference external" href="https://github.com/marionmari/pyGPs">source</a> folder under <a class="reference external" href="https://github.com/marionmari/pyGPs/tree/master/pyGPs/Demo">pyGPs/Demo</a>.</p>
<p>The Demos give some theoretical explanations. Further, it is useful to have a look at our documentation on <a class="reference external" href="Kernels.html">Kernels &amp; Means</a> and <a class="reference external" href="Opts.html">Optimizers</a>.</p>
Expand Down Expand Up @@ -141,7 +141,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2013, Marion Neumann, Shan Huang, Daniel Marthaler, Kristian Kersting.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>
24 changes: 12 additions & 12 deletions doc/build/html/GPC.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ <h2>Load data<a class="headerlink" href="#load-data" title="Permalink to this he
<span class="n">z</span> <span class="o">=</span> <span class="n">demoData</span><span class="p">[</span><span class="s">&#39;xstar&#39;</span><span class="p">]</span> <span class="c"># test data</span>
</pre></div>
</div>
<p>The <img class="math" src="_images/math/aaa4de95cc6371d125d5cf773cdd9f9913dd1d8e.png" alt="120"/> data points were generated from two Gaussians with different means and covariances. One Gaussian is isotropic and contains
<img class="math" src="_images/math/38bd36e353df831303c0de895a9ec614cf3e7202.png" alt="2/3"/> of the data (blue), the other is highly correlated and contains <img class="math" src="_images/math/217aedbdc339bacc8ba075a2ec16902b098194e3.png" alt="1/3"/> of the points (red).
Note, that the labels for the targets are specified to be <img class="math" src="_images/math/7cfbd35086ffefb83637d42166582b43c8a1ff4a.png" alt="\pm 1"/> (and not <img class="math" src="_images/math/e15d84dfcdccf6b0d8fb485020852b5b0f4ea097.png" alt="0/1"/>).</p>
<p>The <img class="math" src="_images/math/1c1fc25eb56b788647384456e0e1a8dade41a0c1.png" alt="120"/> data points were generated from two Gaussians with different means and covariances. One Gaussian is isotropic and contains
<img class="math" src="_images/math/62cfeebb5ed187b89fa9e16c9413edbb3509ae74.png" alt="2/3"/> of the data (blue), the other is highly correlated and contains <img class="math" src="_images/math/6ce2356fc9366d51aa33bf8c380f04bdda621a67.png" alt="1/3"/> of the points (red).
Note, that the labels for the targets are specified to be <img class="math" src="_images/math/5afef8883a1e1142173e76df8d16e764b2779782.png" alt="\pm 1"/> (and not <img class="math" src="_images/math/26b1a580c36b3c8ff2d4b4419ad8a7d054213501.png" alt="0/1"/>).</p>
<p>In the plot, we superimpose the data points with the posterior equi-probability contour lines for the probability of the second class
given complete information about the generating mechanism.</p>
<div class="figure align-center">
<a class="reference internal image-reference" href="_images/d2_1.png"><img alt="_images/d2_1.png" src="_images/d2_1.png" style="width: 560.0px; height: 420.0px;" /></a>
</div>
</div>
<div class="section" id="first-example-state-default-values">
<h2>First example <img class="math" src="_images/math/e12b6767375342ed57d27678e3ea1cdb97f47e15.png" alt="\rightarrow"/> state default values<a class="headerlink" href="#first-example-state-default-values" title="Permalink to this headline"></a></h2>
<h2>First example <img class="math" src="_images/math/a9c4c6156d25f42923975ce449aadad9848ed7dc.png" alt="\rightarrow"/> state default values<a class="headerlink" href="#first-example-state-default-values" title="Permalink to this headline"></a></h2>
<p>Again, lets see the simplest use of gp classification at first</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">model</span> <span class="o">=</span> <span class="n">pyGPs</span><span class="o">.</span><span class="n">gp</span><span class="o">.</span><span class="n">GPC</span><span class="p">()</span> <span class="c"># binary classification (default inference method: EP)</span>
<span class="n">model</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span> <span class="c"># fit default model (mean zero &amp; rbf kernel) with data</span>
Expand All @@ -88,8 +88,8 @@ <h2>First example <img class="math" src="_images/math/e12b6767375342ed57d27678e3
<p>Note, that inference is done via expectation propagation (EP) approximation by deault. How to set inference to Laplace approximation, see <a class="reference internal" href="#more-on-gpc"><em>A bit more things you can do</em></a>.</p>
</div>
<div class="section" id="second-example-gp-classification">
<h2>Second example <img class="math" src="_images/math/e12b6767375342ed57d27678e3ea1cdb97f47e15.png" alt="\rightarrow"/> GP classification<a class="headerlink" href="#second-example-gp-classification" title="Permalink to this headline"></a></h2>
<p>So we first state the model to be <img class="math" src="_images/math/192d69ed9c7bd67b3f34486786531bae08ba2d88.png" alt="GP"/> classification now:</p>
<h2>Second example <img class="math" src="_images/math/a9c4c6156d25f42923975ce449aadad9848ed7dc.png" alt="\rightarrow"/> GP classification<a class="headerlink" href="#second-example-gp-classification" title="Permalink to this headline"></a></h2>
<p>So we first state the model to be <img class="math" src="_images/math/bc008ec23119a8f24d723e0616fee9a6f9a87cd2.png" alt="GP"/> classification now:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">model</span> <span class="o">=</span> <span class="n">pyGPs</span><span class="o">.</span><span class="n">GPC</span><span class="p">()</span>
</pre></div>
</div>
Expand All @@ -107,8 +107,8 @@ <h2>Second example <img class="math" src="_images/math/e12b6767375342ed57d27678e
</div>
<p><strong>[Theory]</strong>
In this example, we used an RBF kernel (squared exponential covariance function) with automatic relevance determination (ARD). This covariance function has one
characteristic length-scale parameter for each dimension of the input space (here <img class="math" src="_images/math/41c544263a265ff15498ee45f7392c5f86c6d151.png" alt="2"/> in total), and a signal magnitude parameter, resulting in
a total of <img class="math" src="_images/math/7cde695f2e4542fd01f860a89189f47a27143b66.png" alt="3"/> hyperparameters. ARD with separate length-scales for each input dimension is a very powerful tool to learn which
characteristic length-scale parameter for each dimension of the input space (here <img class="math" src="_images/math/15c663954a3e059d1f876bc8a4621de376038c96.png" alt="2"/> in total), and a signal magnitude parameter, resulting in
a total of <img class="math" src="_images/math/b9b358d9bbdf54c3d9aef7554638822d996c21ea.png" alt="3"/> hyperparameters. ARD with separate length-scales for each input dimension is a very powerful tool to learn which
inputs are important for the predictions: if length-scales are short, input dimensions are very important, and when they grow very large
(compared to the spread of the data), the corresponding input dimensions will be mostly ignored.</p>
<p>Note, <em>pyGPs.GPC().plot()</em> is a toy method for 2-d data:</p>
Expand All @@ -117,7 +117,7 @@ <h2>Second example <img class="math" src="_images/math/e12b6767375342ed57d27678e
</div>
<p>The contour plot for the predictive distribution is shown below. Note, that the predictive
probability is fairly close to the probabilities of the generating process in regions of high data density. Note also, that as you move
away from the data, the probability approaches <img class="math" src="_images/math/217aedbdc339bacc8ba075a2ec16902b098194e3.png" alt="1/3"/>, the overall class probability.</p>
away from the data, the probability approaches <img class="math" src="_images/math/6ce2356fc9366d51aa33bf8c380f04bdda621a67.png" alt="1/3"/>, the overall class probability.</p>
<div class="figure align-center">
<a class="reference internal image-reference" href="_images/d2_2.png"><img alt="_images/d2_2.png" src="_images/d2_2.png" style="width: 560.0px; height: 420.0px;" /></a>
</div>
Expand All @@ -143,8 +143,8 @@ <h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Basic Classification</a><ul>
<li><a class="reference internal" href="#load-data">Load data</a></li>
<li><a class="reference internal" href="#first-example-state-default-values">First example <img class="math" src="_images/math/e12b6767375342ed57d27678e3ea1cdb97f47e15.png" alt="\rightarrow"/> state default values</a></li>
<li><a class="reference internal" href="#second-example-gp-classification">Second example <img class="math" src="_images/math/e12b6767375342ed57d27678e3ea1cdb97f47e15.png" alt="\rightarrow"/> GP classification</a></li>
<li><a class="reference internal" href="#first-example-state-default-values">First example <img class="math" src="_images/math/a9c4c6156d25f42923975ce449aadad9848ed7dc.png" alt="\rightarrow"/> state default values</a></li>
<li><a class="reference internal" href="#second-example-gp-classification">Second example <img class="math" src="_images/math/a9c4c6156d25f42923975ce449aadad9848ed7dc.png" alt="\rightarrow"/> GP classification</a></li>
<li><a class="reference internal" href="#a-bit-more-things-you-can-do">A bit more things you can do</a></li>
</ul>
</li>
Expand Down Expand Up @@ -199,7 +199,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2013, Marion Neumann, Shan Huang, Daniel Marthaler, Kristian Kersting.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>
Loading

0 comments on commit 4155b61

Please sign in to comment.