Browse Source

Update documentation

Kevin P Murphy 3 năm trước cách đây
mục cha
commit
e4740e1f29

BIN
_images/pendulum.png


BIN
_images/ssm_15_0.png


BIN
_images/ssm_16_1.png


BIN
_images/ssm_21_1.png


BIN
_images/ssm_24_1.png


BIN
_images/ssm_25_1.png


BIN
_images/ssm_29_1.png


BIN
_images/ssm_30_1.png


BIN
_images/ssm_31_1.png


+ 23 - 0
_sources/chapters/hmm/hmm_filter.ipynb

@@ -6,6 +6,29 @@
    "source": [
     "# HMM filtering (forwards algorithm)\n"
    ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "```{math}\n",
+    "\n",
+    "\\newcommand\\floor[1]{\\lfloor#1\\rfloor}\n",
+    "```\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "vscode": {
+     "languageId": "plaintext"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "print(42)"
+   ]
   }
  ],
  "metadata": {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 582 - 15
_sources/chapters/ssm/ssm.ipynb


+ 1 - 1
chapters/hmm/hmm.html

@@ -646,7 +646,7 @@ const thebe_selector_output = ".output, .cell_output"
 <p>We first create the “Ocassionally dishonest casino” model from <span id="id1">[<a class="reference internal" href="../../bib.html#id3" title="R. Durbin, S. Eddy, A. Krogh, and G. Mitchison. Biological Sequence Analysis: Probabilistic Models of Proteins and Nucleic Acids. Cambridge University Press, 1998.">DEKM98</a>]</span>.</p>
 <div class="figure align-default" id="casino-fig">
 <a class="reference internal image-reference" href="../../_images/casino.png"><img alt="../../_images/casino.png" src="../../_images/casino.png" style="width: 208.5px; height: 142.5px;" /></a>
-<p class="caption"><span class="caption-number">Fig. 7 </span><span class="caption-text">Illustration of the casino HMM.</span><a class="headerlink" href="#casino-fig" title="Permalink to this image">¶</a></p>
+<p class="caption"><span class="caption-number">Fig. 8 </span><span class="caption-text">Illustration of the casino HMM.</span><a class="headerlink" href="#casino-fig" title="Permalink to this image">¶</a></p>
 </div>
 <p>There are 2 hidden states, each of which emit 6 possible observations.</p>
 <div class="cell docutils container">

+ 16 - 0
chapters/hmm/hmm_filter.html

@@ -51,6 +51,8 @@ const thebe_selector_input = "pre"
 const thebe_selector_output = ".output, .cell_output"
 </script>
     <script async="async" src="../../_static/sphinx-thebe.js"></script>
+    <script>window.MathJax = {"options": {"processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script>
+    <script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
     <link rel="index" title="Index" href="../../genindex.html" />
     <link rel="search" title="Search" href="../../search.html" />
     <link rel="next" title="HMM smoothing (forwards-backwards algorithm)" href="hmm_smoother.html" />
@@ -458,6 +460,20 @@ const thebe_selector_output = ".output, .cell_output"
                 
   <div class="tex2jax_ignore mathjax_ignore section" id="hmm-filtering-forwards-algorithm">
 <h1>HMM filtering (forwards algorithm)<a class="headerlink" href="#hmm-filtering-forwards-algorithm" title="Permalink to this headline">¶</a></h1>
+<div class="math notranslate nohighlight">
+\[\newcommand\floor[1]{\lfloor#1\rfloor}\]</div>
+<div class="cell docutils container">
+<div class="cell_input docutils container">
+<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="mi">42</span><span class="p">)</span>
+</pre></div>
+</div>
+</div>
+<div class="cell_output docutils container">
+<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>42
+</pre></div>
+</div>
+</div>
+</div>
 </div>
 
     <script type="text/x-thebe-config">

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 562 - 41
chapters/ssm/ssm.html


BIN
objects.inv


+ 42 - 12
reports/ssm.log

@@ -17,23 +17,53 @@ Traceback (most recent call last):
     raise CellExecutionError.from_cell_and_msg(cell, exec_reply['content'])
 nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
 ------------------
-# MAP estimation
+ # Filtering
 fig, ax = plt.subplots()
-plot_inference(z_map, z_hist, ax, map_estimate=True)
-ax.set_ylabel("MAP state")
-ax.set_title("Viterbi")
+plot_inference(filtered_dist, z_hist, ax)
+ax.set_ylabel("p(loaded)")
+ax.set_title("Filtered")
+ 
 
+  
 ------------------
 
 ---------------------------------------------------------------------------
-NameError                                 Traceback (most recent call last)
-<ipython-input-12-d20416120056> in <module>
-      1 # MAP estimation
+ValueError                                Traceback (most recent call last)
+<ipython-input-17-a3a9c11b46bd> in <module>
+      1 # Filtering
       2 fig, ax = plt.subplots()
-----> 3 plot_inference(z_map, z_hist, ax, map_estimate=True)
-      4 ax.set_ylabel("MAP state")
-      5 ax.set_title("Viterbi")
+----> 3 plot_inference(filtered_dist, z_hist, ax)
+      4 ax.set_ylabel("p(loaded)")
+      5 ax.set_title("Filtered")
 
-NameError: name 'z_map' is not defined
-NameError: name 'z_map' is not defined
+<ipython-input-16-9c8ddad3f57c> in plot_inference(inference_values, z_hist, ax, state, map_estimate)
+      3     n_samples = len(inference_values)
+      4     xspan = np.arange(1, n_samples + 1)
+----> 5     spans = find_dishonest_intervals(z_hist)
+      6     if map_estimate:
+      7         ax.step(xspan, inference_values, where="post")
+
+<ipython-input-15-4606c615e17a> in find_dishonest_intervals(z_hist)
+      4     x_init = 0
+      5     for t, _ in enumerate(z_hist[:-1]):
+----> 6         if z_hist[t + 1] == 0 and z_hist[t] == 1:
+      7             x_end = t
+      8             spans.append((x_init, x_end))
+
+/opt/anaconda3/lib/python3.8/functools.py in _method(cls_or_self, *args, **keywords)
+    397         def _method(cls_or_self, /, *args, **keywords):
+    398             keywords = {**self.keywords, **keywords}
+--> 399             return self.func(cls_or_self, *self.args, *args, **keywords)
+    400         _method.__isabstractmethod__ = self.__isabstractmethod__
+    401         _method._partialmethod = self
+
+/opt/anaconda3/lib/python3.8/site-packages/jax/_src/device_array.py in _forward_method(attrname, self, fun, *args)
+     39 
+     40 def _forward_method(attrname, self, fun, *args):
+---> 41   return fun(getattr(self, attrname), *args)
+     42 _forward_to_value = partial(_forward_method, "_value")
+     43 
+
+ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
+ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
 

+ 1 - 0
root.html

@@ -449,6 +449,7 @@ in automatic differentiation and parallel computing.</p>
 <li class="toctree-l1"><a class="reference internal" href="chapters/ssm/ssm.html">What are State Space Models?</a></li>
 <li class="toctree-l1"><a class="reference internal" href="chapters/ssm/ssm.html#hidden-markov-models">Hidden Markov Models</a></li>
 <li class="toctree-l1"><a class="reference internal" href="chapters/ssm/ssm.html#linear-gaussian-ssms">Linear Gaussian SSMs</a></li>
+<li class="toctree-l1"><a class="reference internal" href="chapters/ssm/ssm.html#nonlinear-gaussian-ssms">Nonlinear Gaussian SSMs</a></li>
 <li class="toctree-l1"><a class="reference internal" href="chapters/ssm/ssm.html#inferential-goals">Inferential goals</a></li>
 <li class="toctree-l1"><a class="reference internal" href="chapters/hmm/hmm_index.html">Inference in discrete SSMs</a><ul>
 <li class="toctree-l2"><a class="reference internal" href="chapters/hmm/hmm.html">Hidden Markov Models</a></li>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
searchindex.js