Skip to content

Commit

Permalink
deploy: 1c1f631
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 9, 2023
1 parent 26ba409 commit dd8126a
Show file tree
Hide file tree
Showing 33 changed files with 1,442 additions and 801 deletions.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/mici.adapters.doctree
Binary file not shown.
Binary file modified .doctrees/mici.integrators.doctree
Binary file not shown.
Binary file modified .doctrees/mici.interop.doctree
Binary file not shown.
Binary file modified .doctrees/mici.progressbars.doctree
Binary file not shown.
Binary file modified .doctrees/mici.solvers.doctree
Binary file not shown.
Binary file modified .doctrees/mici.systems.doctree
Binary file not shown.
Binary file modified .doctrees/mici.transitions.doctree
Binary file not shown.
118 changes: 59 additions & 59 deletions _modules/mici/adapters.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions _modules/mici/autodiff.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ <h1>Source code for mici.autodiff</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">annotations</span>

<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">TYPE_CHECKING</span>

<span class="kn">import</span> <span class="nn">mici.autograd_wrapper</span> <span class="k">as</span> <span class="nn">autograd_wrapper</span>

<span class="k">if</span> <span class="n">TYPE_CHECKING</span><span class="p">:</span>
Expand Down
15 changes: 5 additions & 10 deletions _modules/mici/autograd_wrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,19 @@ <h1>Source code for mici.autograd_wrapper</h1><div class="highlight"><pre>

<span class="n">AUTOGRAD_AVAILABLE</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">try</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">autograd.wrap_util</span> <span class="kn">import</span> <span class="n">unary_to_nary</span>
<span class="kn">import</span> <span class="nn">autograd.numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">autograd.builtins</span> <span class="kn">import</span> <span class="nb">tuple</span> <span class="k">as</span> <span class="n">atuple</span>
<span class="kn">from</span> <span class="nn">autograd.core</span> <span class="kn">import</span> <span class="n">make_vjp</span>
<span class="kn">from</span> <span class="nn">autograd.extend</span> <span class="kn">import</span> <span class="n">vspace</span>
<span class="kn">import</span> <span class="nn">autograd.numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">autograd.wrap_util</span> <span class="kn">import</span> <span class="n">unary_to_nary</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="n">AUTOGRAD_AVAILABLE</span> <span class="o">=</span> <span class="kc">False</span>

<span class="k">if</span> <span class="n">TYPE_CHECKING</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Callable</span>
<span class="kn">from</span> <span class="nn">mici.types</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">ScalarLike</span><span class="p">,</span>
<span class="n">ArrayLike</span><span class="p">,</span>
<span class="n">ScalarFunction</span><span class="p">,</span>
<span class="n">ArrayFunction</span><span class="p">,</span>
<span class="n">MatrixHessianProduct</span><span class="p">,</span>
<span class="n">MatrixTressianProduct</span><span class="p">,</span>
<span class="p">)</span>

<span class="kn">from</span> <span class="nn">mici.types</span> <span class="kn">import</span> <span class="p">(</span><span class="n">ArrayFunction</span><span class="p">,</span> <span class="n">ArrayLike</span><span class="p">,</span> <span class="n">MatrixHessianProduct</span><span class="p">,</span>
<span class="n">MatrixTressianProduct</span><span class="p">,</span> <span class="n">ScalarFunction</span><span class="p">,</span> <span class="n">ScalarLike</span><span class="p">)</span>


<span class="k">def</span> <span class="nf">_wrapped_unary_to_nary</span><span class="p">(</span><span class="n">func</span><span class="p">:</span> <span class="n">Callable</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Callable</span><span class="p">:</span>
Expand Down
112 changes: 82 additions & 30 deletions _modules/mici/integrators.html

Large diffs are not rendered by default.

71 changes: 36 additions & 35 deletions _modules/mici/interop.html

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions _modules/mici/matrices.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,19 @@ <h1>Source code for mici.matrices</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">abc</span>
<span class="kn">import</span> <span class="nn">numbers</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">TYPE_CHECKING</span>

<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">mici.errors</span> <span class="kn">import</span> <span class="n">LinAlgError</span>
<span class="kn">import</span> <span class="nn">numpy.linalg</span> <span class="k">as</span> <span class="nn">nla</span>
<span class="kn">import</span> <span class="nn">scipy.linalg</span> <span class="k">as</span> <span class="nn">sla</span>

<span class="kn">from</span> <span class="nn">mici.errors</span> <span class="kn">import</span> <span class="n">LinAlgError</span>
<span class="kn">from</span> <span class="nn">mici.utils</span> <span class="kn">import</span> <span class="n">hash_array</span>

<span class="k">if</span> <span class="n">TYPE_CHECKING</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Iterable</span><span class="p">,</span> <span class="n">Literal</span><span class="p">,</span> <span class="n">Optional</span><span class="p">,</span> <span class="n">Tuple</span><span class="p">,</span> <span class="n">Union</span>

<span class="kn">from</span> <span class="nn">numpy.typing</span> <span class="kn">import</span> <span class="n">NDArray</span>

<span class="kn">from</span> <span class="nn">mici.types</span> <span class="kn">import</span> <span class="n">MatrixLike</span><span class="p">,</span> <span class="n">ScalarLike</span>


Expand Down Expand Up @@ -720,7 +724,7 @@ <h1>Source code for mici.matrices</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">_scalar</span>

<div class="viewcode-block" id="ScaledIdentityMatrix.grad_quadratic_form_inv"><a class="viewcode-back" href="../../mici.matrices.html#mici.matrices.ScaledIdentityMatrix.grad_quadratic_form_inv">[docs]</a> <span class="k">def</span> <span class="nf">grad_quadratic_form_inv</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">vector</span><span class="p">:</span> <span class="n">NDArray</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">float</span><span class="p">:</span>
<span class="k">return</span> <span class="o">-</span><span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">vector</span> <span class="o">**</span> <span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">_scalar</span> <span class="o">**</span> <span class="mi">2</span></div>
<span class="k">return</span> <span class="o">-</span><span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">vector</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">_scalar</span><span class="o">**</span><span class="mi">2</span></div>

<span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;(shape=</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">shape</span><span class="si">}</span><span class="s2">, scalar=</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_scalar</span><span class="si">}</span><span class="s2">)&quot;</span>
Expand Down Expand Up @@ -753,7 +757,7 @@ <h1>Source code for mici.matrices</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">PositiveScaledIdentityMatrix</span><span class="p">(</span><span class="mi">1</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">_scalar</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>

<span class="k">def</span> <span class="nf">_construct_sqrt</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">PositiveScaledIdentityMatrix</span><span class="p">:</span>
<span class="k">return</span> <span class="n">PositiveScaledIdentityMatrix</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_scalar</span> <span class="o">**</span> <span class="mf">0.5</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span></div>
<span class="k">return</span> <span class="n">PositiveScaledIdentityMatrix</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_scalar</span><span class="o">**</span><span class="mf">0.5</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span></div>


<div class="viewcode-block" id="DiagonalMatrix"><a class="viewcode-back" href="../../mici.matrices.html#mici.matrices.DiagonalMatrix">[docs]</a><span class="k">class</span> <span class="nc">DiagonalMatrix</span><span class="p">(</span><span class="n">SymmetricMatrix</span><span class="p">,</span> <span class="n">DifferentiableMatrix</span><span class="p">,</span> <span class="n">ImplicitArrayMatrix</span><span class="p">):</span>
Expand Down Expand Up @@ -838,7 +842,7 @@ <h1>Source code for mici.matrices</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">PositiveDiagonalMatrix</span><span class="p">(</span><span class="mf">1.0</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">diagonal</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_construct_sqrt</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">PositiveDiagonalMatrix</span><span class="p">:</span>
<span class="k">return</span> <span class="n">PositiveDiagonalMatrix</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">diagonal</span> <span class="o">**</span> <span class="mf">0.5</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">PositiveDiagonalMatrix</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">diagonal</span><span class="o">**</span><span class="mf">0.5</span><span class="p">)</span></div>


<span class="k">def</span> <span class="nf">_make_array_triangular</span><span class="p">(</span><span class="n">array</span><span class="p">:</span> <span class="n">NDArray</span><span class="p">,</span> <span class="n">lower</span><span class="p">:</span> <span class="nb">bool</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">NDArray</span><span class="p">:</span>
Expand Down Expand Up @@ -1114,7 +1118,7 @@ <h1>Source code for mici.matrices</h1><div class="highlight"><pre>
<span class="k">def</span> <span class="nf">_scalar_multiply</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">scalar</span><span class="p">:</span> <span class="n">ScalarLike</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">TriangularFactoredDefiniteMatrix</span><span class="p">:</span>
<span class="k">if</span> <span class="n">scalar</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">return</span> <span class="n">TriangularFactoredPositiveDefiniteMatrix</span><span class="p">(</span>
<span class="n">factor</span><span class="o">=</span><span class="n">scalar</span> <span class="o">**</span> <span class="mf">0.5</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">factor</span>
<span class="n">factor</span><span class="o">=</span><span class="n">scalar</span><span class="o">**</span><span class="mf">0.5</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">factor</span>
<span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">_scalar_multiply</span><span class="p">(</span><span class="n">scalar</span><span class="p">)</span>
Expand Down Expand Up @@ -1614,7 +1618,7 @@ <h1>Source code for mici.matrices</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">EigendecomposedPositiveDefiniteMatrix</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">eigvec</span><span class="p">,</span> <span class="mi">1</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">eigval</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_construct_sqrt</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">EigendecomposedPositiveDefiniteMatrix</span><span class="p">:</span>
<span class="k">return</span> <span class="n">EigendecomposedPositiveDefiniteMatrix</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">eigvec</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">eigval</span> <span class="o">**</span> <span class="mf">0.5</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">EigendecomposedPositiveDefiniteMatrix</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">eigvec</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">eigval</span><span class="o">**</span><span class="mf">0.5</span><span class="p">)</span></div>


<div class="viewcode-block" id="SoftAbsRegularizedPositiveDefiniteMatrix"><a class="viewcode-back" href="../../mici.matrices.html#mici.matrices.SoftAbsRegularizedPositiveDefiniteMatrix">[docs]</a><span class="k">class</span> <span class="nc">SoftAbsRegularizedPositiveDefiniteMatrix</span><span class="p">(</span>
Expand Down
2 changes: 1 addition & 1 deletion _modules/mici/progressbars.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ <h1>Source code for mici.progressbars</h1><div class="highlight"><pre>

<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">description</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;&quot;Description of task being tracked.&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Description of task being tracked.&quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_description</span>

<span class="nd">@property</span>
Expand Down
Loading

0 comments on commit dd8126a

Please sign in to comment.