Skip to content

Commit 2084eca

Browse files
committed
Generate Python docs from pytorch/pytorch@37c1f4a
1 parent 6393c63 commit 2084eca

File tree

9 files changed

+949
-14
lines changed

9 files changed

+949
-14
lines changed

docs/1.8.0/_modules/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ <h1>All modules for which code is available</h1>
440440
<li><a href="torch/distributions/kl.html">torch.distributions.kl</a></li>
441441
<li><a href="torch/distributions/kumaraswamy.html">torch.distributions.kumaraswamy</a></li>
442442
<li><a href="torch/distributions/laplace.html">torch.distributions.laplace</a></li>
443+
<li><a href="torch/distributions/lkj_cholesky.html">torch.distributions.lkj_cholesky</a></li>
443444
<li><a href="torch/distributions/log_normal.html">torch.distributions.log_normal</a></li>
444445
<li><a href="torch/distributions/lowrank_multivariate_normal.html">torch.distributions.lowrank_multivariate_normal</a></li>
445446
<li><a href="torch/distributions/mixture_same_family.html">torch.distributions.mixture_same_family</a></li>

docs/1.8.0/_modules/torch/distributions/lkj_cholesky.html

Lines changed: 835 additions & 0 deletions
Large diffs are not rendered by default.

docs/1.8.0/_sources/distributions.rst.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,15 @@ Probability distributions - torch.distributions
176176
:undoc-members:
177177
:show-inheritance:
178178

179+
:hidden:`LKJCholesky`
180+
~~~~~~~~~~~~~~~~~~~~~~~
181+
182+
.. currentmodule:: torch.distributions.lkj_cholesky
183+
.. autoclass:: LKJCholesky
184+
:members:
185+
:undoc-members:
186+
:show-inheritance:
187+
179188
:hidden:`Laplace`
180189
~~~~~~~~~~~~~~~~~~~~~~~
181190

@@ -337,7 +346,7 @@ Probability distributions - torch.distributions
337346
:members:
338347
:undoc-members:
339348
:show-inheritance:
340-
349+
341350
:hidden:`Weibull`
342351
~~~~~~~~~~~~~~~~~~~~~~~
343352

docs/1.8.0/_static/css/theme.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/1.8.0/_static/js/theme.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -957,28 +957,31 @@ if (downloadNote.length >= 1) {
957957
$(".pytorch-call-to-action-links").hide();
958958
}
959959

960-
//This code makes the Notes section of the Docs Left Nav collapsible
960+
//This code handles the Expand/Hide toggle for the Docs/Tutorials left nav items
961961

962-
if ($("p.caption:first").text() == "Notes") {
962+
var expandMenu = "#pytorch-left-menu p.caption";
963963

964-
$("p.caption:first").addClass("left-nav-top-caption");
965-
$("span.caption-text:first").after("<span class='expand-menu'>[Expand]</span>");
966-
$(".expand-menu").after("<span class='hide-menu'>[Hide]</span>");
967-
$("p.caption:first").next("ul").hide();
964+
if ($(expandMenu)) {
965+
966+
$(expandMenu).addClass("left-nav-top-caption");
967+
$("#pytorch-left-menu span.caption-text").after("<span class='expand-menu'>[ + ]</span>");
968+
$("#pytorch-left-menu .expand-menu").after("<span class='hide-menu'>[ - ]</span>");
969+
$(expandMenu).next("ul").hide();
968970

969971
$(".expand-menu").on("click", function() {
970-
$(".hide-menu").toggle();
972+
$(this).next(".hide-menu").toggle();
973+
$(this).parent().next("ul").toggle();
971974
toggleList(this);
972975
});
973976

974977
$(".hide-menu").on("click", function() {
975-
$(".expand-menu").toggle();
978+
$(this).prev(".expand-menu").toggle();
979+
$(this).parent().next("ul").toggle();
976980
toggleList(this);
977981
});
978982

979983
function toggleList(menuCommand) {
980984
$(menuCommand).toggle();
981-
$("p.caption:first").next("ul").toggle();
982985
}
983986
}
984987

docs/1.8.0/distributions.html

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,6 +2051,80 @@ <h2><span class="hidden-section">Kumaraswamy</span><a class="headerlink" href="#
20512051

20522052
</dd></dl>
20532053

2054+
</div>
2055+
<div class="section" id="lkjcholesky">
2056+
<h2><span class="hidden-section">LKJCholesky</span><a class="headerlink" href="#lkjcholesky" title="Permalink to this headline"></a></h2>
2057+
<dl class="class">
2058+
<dt id="torch.distributions.lkj_cholesky.LKJCholesky">
2059+
<em class="property">class </em><code class="sig-prename descclassname">torch.distributions.lkj_cholesky.</code><code class="sig-name descname">LKJCholesky</code><span class="sig-paren">(</span><em class="sig-param">dim</em>, <em class="sig-param">concentration=1.0</em>, <em class="sig-param">validate_args=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/torch/distributions/lkj_cholesky.html#LKJCholesky"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#torch.distributions.lkj_cholesky.LKJCholesky" title="Permalink to this definition"></a></dt>
2060+
<dd><p>Bases: <a class="reference internal" href="#torch.distributions.distribution.Distribution" title="torch.distributions.distribution.Distribution"><code class="xref py py-class docutils literal notranslate"><span class="pre">torch.distributions.distribution.Distribution</span></code></a></p>
2061+
<p>LKJ distribution for lower Cholesky factor of correlation matrices.
2062+
The distribution is controlled by <code class="docutils literal notranslate"><span class="pre">concentration</span></code> parameter <span class="math"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.19444em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">η</span></span></span></span>
2063+
2064+
</span>
2065+
to make the probability of the correlation matrix <span class="math"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathnormal" style="margin-right:0.10903em;">M</span></span></span></span>
2066+
2067+
</span> generated from
2068+
a Cholesky factor propotional to <span class="math"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>det</mi><mo></mo><mo stretchy="false">(</mo><mi>M</mi><msup><mo stretchy="false">)</mo><mrow><mi>η</mi><mo></mo><mn>1</mn></mrow></msup></mrow><annotation encoding="application/x-tex">\det(M)^{\eta - 1}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.064108em;vertical-align:-0.25em;"></span><span class="mop">det</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.10903em;">M</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03588em;">η</span><span class="mbin mtight"></span><span class="mord mtight">1</span></span></span></span></span></span></span></span></span></span></span></span>
2069+
2070+
</span>. Because of that,
2071+
when <code class="docutils literal notranslate"><span class="pre">concentration</span> <span class="pre">==</span> <span class="pre">1</span></code>, we have a uniform distribution over Cholesky
2072+
factors of correlation matrices. Note that this distribution samples the
2073+
Cholesky factor of correlation matrices and not the correlation matrices
2074+
themselves and thereby differs slightly from the derivations in [1] for
2075+
the <cite>LKJCorr</cite> distribution. For sampling, this uses the Onion method from
2076+
[1] Section 3.</p>
2077+
<blockquote>
2078+
<div><p>L ~ LKJCholesky(dim, concentration)
2079+
X = L &#64; L’ ~ LKJCorr(dim, concentration)</p>
2080+
</div></blockquote>
2081+
<p>Example:</p>
2082+
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">l</span> <span class="o">=</span> <span class="n">LKJCholesky</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">)</span>
2083+
<span class="gp">&gt;&gt;&gt; </span><span class="n">l</span><span class="o">.</span><span class="n">sample</span><span class="p">()</span> <span class="c1"># l @ l.T is a sample of a correlation 3x3 matrix</span>
2084+
<span class="go">tensor([[ 1.0000, 0.0000, 0.0000],</span>
2085+
<span class="go"> [ 0.3516, 0.9361, 0.0000],</span>
2086+
<span class="go"> [-0.1899, 0.4748, 0.8593]])</span>
2087+
</pre></div>
2088+
</div>
2089+
<dl class="field-list simple">
2090+
<dt class="field-odd">Parameters</dt>
2091+
<dd class="field-odd"><ul class="simple">
2092+
<li><p><strong>dimension</strong> (<em>dim</em>) – dimension of the matrices</p></li>
2093+
<li><p><strong>concentration</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em> or </em><a class="reference internal" href="tensors.html#torch.Tensor" title="torch.Tensor"><em>Tensor</em></a>) – concentration/shape parameter of the
2094+
distribution (often referred to as eta)</p></li>
2095+
</ul>
2096+
</dd>
2097+
</dl>
2098+
<p><strong>References</strong></p>
2099+
<p>[1] <cite>Generating random correlation matrices based on vines and extended onion method</cite>,
2100+
Daniel Lewandowski, Dorota Kurowicka, Harry Joe.</p>
2101+
<dl class="attribute">
2102+
<dt id="torch.distributions.lkj_cholesky.LKJCholesky.arg_constraints">
2103+
<code class="sig-name descname">arg_constraints</code><em class="property"> = {'concentration': GreaterThan(lower_bound=0.0)}</em><a class="headerlink" href="#torch.distributions.lkj_cholesky.LKJCholesky.arg_constraints" title="Permalink to this definition"></a></dt>
2104+
<dd></dd></dl>
2105+
2106+
<dl class="method">
2107+
<dt id="torch.distributions.lkj_cholesky.LKJCholesky.expand">
2108+
<code class="sig-name descname">expand</code><span class="sig-paren">(</span><em class="sig-param">batch_shape</em>, <em class="sig-param">_instance=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/torch/distributions/lkj_cholesky.html#LKJCholesky.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#torch.distributions.lkj_cholesky.LKJCholesky.expand" title="Permalink to this definition"></a></dt>
2109+
<dd></dd></dl>
2110+
2111+
<dl class="method">
2112+
<dt id="torch.distributions.lkj_cholesky.LKJCholesky.log_prob">
2113+
<code class="sig-name descname">log_prob</code><span class="sig-paren">(</span><em class="sig-param">value</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/torch/distributions/lkj_cholesky.html#LKJCholesky.log_prob"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#torch.distributions.lkj_cholesky.LKJCholesky.log_prob" title="Permalink to this definition"></a></dt>
2114+
<dd></dd></dl>
2115+
2116+
<dl class="method">
2117+
<dt id="torch.distributions.lkj_cholesky.LKJCholesky.sample">
2118+
<code class="sig-name descname">sample</code><span class="sig-paren">(</span><em class="sig-param">sample_shape=torch.Size([])</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/torch/distributions/lkj_cholesky.html#LKJCholesky.sample"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#torch.distributions.lkj_cholesky.LKJCholesky.sample" title="Permalink to this definition"></a></dt>
2119+
<dd></dd></dl>
2120+
2121+
<dl class="attribute">
2122+
<dt id="torch.distributions.lkj_cholesky.LKJCholesky.support">
2123+
<code class="sig-name descname">support</code><em class="property"> = CorrCholesky()</em><a class="headerlink" href="#torch.distributions.lkj_cholesky.LKJCholesky.support" title="Permalink to this definition"></a></dt>
2124+
<dd></dd></dl>
2125+
2126+
</dd></dl>
2127+
20542128
</div>
20552129
<div class="section" id="laplace">
20562130
<h2><span class="hidden-section">Laplace</span><a class="headerlink" href="#laplace" title="Permalink to this headline"></a></h2>
@@ -4241,6 +4315,7 @@ <h2><span class="hidden-section">Weibull</span><a class="headerlink" href="#weib
42414315
<li><a class="reference internal" href="#halfnormal"><span class="hidden-section">HalfNormal</span></a></li>
42424316
<li><a class="reference internal" href="#independent"><span class="hidden-section">Independent</span></a></li>
42434317
<li><a class="reference internal" href="#kumaraswamy"><span class="hidden-section">Kumaraswamy</span></a></li>
4318+
<li><a class="reference internal" href="#lkjcholesky"><span class="hidden-section">LKJCholesky</span></a></li>
42444319
<li><a class="reference internal" href="#laplace"><span class="hidden-section">Laplace</span></a></li>
42454320
<li><a class="reference internal" href="#lognormal"><span class="hidden-section">LogNormal</span></a></li>
42464321
<li><a class="reference internal" href="#lowrankmultivariatenormal"><span class="hidden-section">LowRankMultivariateNormal</span></a></li>

docs/1.8.0/genindex.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,8 @@ <h2 id="A">A</h2>
825825
<li><a href="distributions.html#torch.distributions.kumaraswamy.Kumaraswamy.arg_constraints">(torch.distributions.kumaraswamy.Kumaraswamy attribute)</a>
826826
</li>
827827
<li><a href="distributions.html#torch.distributions.laplace.Laplace.arg_constraints">(torch.distributions.laplace.Laplace attribute)</a>
828+
</li>
829+
<li><a href="distributions.html#torch.distributions.lkj_cholesky.LKJCholesky.arg_constraints">(torch.distributions.lkj_cholesky.LKJCholesky attribute)</a>
828830
</li>
829831
<li><a href="distributions.html#torch.distributions.log_normal.LogNormal.arg_constraints">(torch.distributions.log_normal.LogNormal attribute)</a>
830832
</li>
@@ -2068,14 +2070,14 @@ <h2 id="E">E</h2>
20682070
</ul></li>
20692071
<li><a href="tensors.html#torch.Tensor.erfc_">erfc_() (torch.Tensor method)</a>
20702072
</li>
2071-
</ul></td>
2072-
<td style="width: 33%; vertical-align: top;"><ul>
20732073
<li><a href="generated/torch.erfinv.html#torch.erfinv">erfinv() (in module torch)</a>
20742074

20752075
<ul>
20762076
<li><a href="tensors.html#torch.Tensor.erfinv">(torch.Tensor method)</a>
20772077
</li>
20782078
</ul></li>
2079+
</ul></td>
2080+
<td style="width: 33%; vertical-align: top;"><ul>
20792081
<li><a href="tensors.html#torch.Tensor.erfinv_">erfinv_() (torch.Tensor method)</a>
20802082
</li>
20812083
<li><a href="generated/torch.jit.ScriptModule.html#torch.jit.ScriptModule.eval">eval() (torch.jit.ScriptModule method)</a>
@@ -2142,6 +2144,8 @@ <h2 id="E">E</h2>
21422144
<li><a href="distributions.html#torch.distributions.kumaraswamy.Kumaraswamy.expand">(torch.distributions.kumaraswamy.Kumaraswamy method)</a>
21432145
</li>
21442146
<li><a href="distributions.html#torch.distributions.laplace.Laplace.expand">(torch.distributions.laplace.Laplace method)</a>
2147+
</li>
2148+
<li><a href="distributions.html#torch.distributions.lkj_cholesky.LKJCholesky.expand">(torch.distributions.lkj_cholesky.LKJCholesky method)</a>
21452149
</li>
21462150
<li><a href="distributions.html#torch.distributions.log_normal.LogNormal.expand">(torch.distributions.log_normal.LogNormal method)</a>
21472151
</li>
@@ -3451,6 +3455,8 @@ <h2 id="L">L</h2>
34513455
<li><a href="hub.html#torch.hub.list">list() (in module torch.hub)</a>
34523456
</li>
34533457
<li><a href="cuda.html#torch.cuda.list_gpu_processes">list_gpu_processes() (in module torch.cuda)</a>
3458+
</li>
3459+
<li><a href="distributions.html#torch.distributions.lkj_cholesky.LKJCholesky">LKJCholesky (class in torch.distributions.lkj_cholesky)</a>
34543460
</li>
34553461
<li><a href="generated/torch.nn.utils.prune.ln_structured.html#torch.nn.utils.prune.ln_structured">ln_structured() (in module torch.nn.utils.prune)</a>
34563462
</li>
@@ -3572,6 +3578,8 @@ <h2 id="L">L</h2>
35723578
<li><a href="distributions.html#torch.distributions.independent.Independent.log_prob">(torch.distributions.independent.Independent method)</a>
35733579
</li>
35743580
<li><a href="distributions.html#torch.distributions.laplace.Laplace.log_prob">(torch.distributions.laplace.Laplace method)</a>
3581+
</li>
3582+
<li><a href="distributions.html#torch.distributions.lkj_cholesky.LKJCholesky.log_prob">(torch.distributions.lkj_cholesky.LKJCholesky method)</a>
35753583
</li>
35763584
<li><a href="distributions.html#torch.distributions.lowrank_multivariate_normal.LowRankMultivariateNormal.log_prob">(torch.distributions.lowrank_multivariate_normal.LowRankMultivariateNormal method)</a>
35773585
</li>
@@ -5146,6 +5154,8 @@ <h2 id="S">S</h2>
51465154
<li><a href="distributions.html#torch.distributions.geometric.Geometric.sample">(torch.distributions.geometric.Geometric method)</a>
51475155
</li>
51485156
<li><a href="distributions.html#torch.distributions.independent.Independent.sample">(torch.distributions.independent.Independent method)</a>
5157+
</li>
5158+
<li><a href="distributions.html#torch.distributions.lkj_cholesky.LKJCholesky.sample">(torch.distributions.lkj_cholesky.LKJCholesky method)</a>
51495159
</li>
51505160
<li><a href="distributions.html#torch.distributions.mixture_same_family.MixtureSameFamily.sample">(torch.distributions.mixture_same_family.MixtureSameFamily method)</a>
51515161
</li>
@@ -5712,6 +5722,8 @@ <h2 id="S">S</h2>
57125722
<li><a href="distributions.html#torch.distributions.kumaraswamy.Kumaraswamy.support">(torch.distributions.kumaraswamy.Kumaraswamy attribute)</a>
57135723
</li>
57145724
<li><a href="distributions.html#torch.distributions.laplace.Laplace.support">(torch.distributions.laplace.Laplace attribute)</a>
5725+
</li>
5726+
<li><a href="distributions.html#torch.distributions.lkj_cholesky.LKJCholesky.support">(torch.distributions.lkj_cholesky.LKJCholesky attribute)</a>
57155727
</li>
57165728
<li><a href="distributions.html#torch.distributions.log_normal.LogNormal.support">(torch.distributions.log_normal.LogNormal attribute)</a>
57175729
</li>

docs/1.8.0/objects.inv

61 Bytes
Binary file not shown.

docs/1.8.0/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)