Skip to content

Commit

Permalink
build based on cbcc0f3
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Dec 18, 2023
1 parent 46be464 commit 32684af
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.11.0-DEV.1109","generation_timestamp":"2023-12-17T06:19:49","documenter_version":"1.1.2"}}
{"documenter":{"julia_version":"1.11.0-DEV.1111","generation_timestamp":"2023-12-18T06:21:31","documenter_version":"1.1.2"}}
2 changes: 1 addition & 1 deletion dev/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
julia> map(∇(*), (1,2,3), (4,5,6))
((4.0, 1.0), (5.0, 2.0), (6.0, 3.0))</code></pre><p><strong>The derivative ∂f/∂f</strong></p><p>Note that since in Julia, there is no distinction between functions and values, there is in principle a partial derivative with respect to the function itself. However, said partial derivative is dropped by this interface. It is however available using the lower level ∂⃖ if desired. This interaction can also be used to obtain gradients with respect to only some of the arguments by using a closure:</p><p>∇((x,z)-&gt;f(x,y,z))(x, z) # returns (∂f/∂x, ∂f/∂z)</p><p>Though of course the same can be obtained by simply indexing the resulting tuple (in well-inferred code there should not be a performance difference between these two options).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/interface.jl#L76-L109">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Diffractor.:&#39;-Tuple{Any}" href="#Diffractor.:&#39;-Tuple{Any}"><code>Diffractor.:&#39;</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">f&#39;</code></pre><p>This is a convenience syntax for taking the derivative of a function f: ℝ -&gt; ℝ. In particular, for such a function f&#39;(x) will be the first derivative of <code>f</code> at <code>x</code> (and similar for <code>f&#39;&#39;(x)</code> and second derivatives and so on.)</p><p>Note that the syntax conflicts with the Base definition for the adjoint of a matrix and thus is not enabled by default. To use it, add the following to the top of your module:</p><pre><code class="language-julia hljs">using Diffractor: var&quot;&#39;&quot;</code></pre><p>It is also available using the @∂ macro:</p><pre><code class="language-julia hljs">@∂ f&#39;(x)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/interface.jl#L184-L203">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Diffractor.bundle" href="#Diffractor.bundle"><code>Diffractor.bundle</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">bundle(primal, tangent)</code></pre><p>Wraps a primal up with a tangent into the appropriate kind of <code>AbstractBundle{1}</code>. This is more or less the Diffractor equivelent of ForwardDiff.jl&#39;s <code>Dual</code> type.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/AbstractDifferentiation.jl#L5-L10">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Diffractor.destructure-Union{Tuple{Diffractor.TangentBundle{N, B, Diffractor.TaylorTangent{P}} where P}, Tuple{B}, Tuple{N}} where {N, B&lt;:Tuple}" href="#Diffractor.destructure-Union{Tuple{Diffractor.TangentBundle{N, B, Diffractor.TaylorTangent{P}} where P}, Tuple{B}, Tuple{N}} where {N, B&lt;:Tuple}"><code>Diffractor.destructure</code></a><span class="docstring-category">Method</span></header><section><div><p>for a TaylorTangent{N, &lt;:Tuple} this breaks it up unto 1 TaylorTangent{N} for each element of the primal tuple</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/tangent.jl#L258">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Diffractor.dx-Tuple{Real}" href="#Diffractor.dx-Tuple{Real}"><code>Diffractor.dx</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">dx(x)</code></pre><p>dx represents the trival differential one-form of a one dimensional Riemannian manifold <code>M</code>. In particular, it is a section of the cotangent bundle of <code>M</code>, meaning it may be evaluted at a point <code>x</code> of <code>M</code> to obtain an element of the cotangent space <code>T*ₓ M</code> to <code>M</code> at <code>x</code>. We impose no restrictions on the representations of either the manifold itself or the cotangent space.</p><p>By default, the only implementation provided identifies T*ₓ ℝ ≃ ℝ, keeping watever type is used to represent ℝ. i.e.</p><pre><code class="language-julia hljs">dx(x::Real) = one(x)</code></pre><p>However, users may provide additional overloads for custom representations of one dimensional Riemannian manifolds.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/interface.jl#L37-L54">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Diffractor.find_end_of_phi_block-Tuple{Core.Compiler.IRCode, Int64}" href="#Diffractor.find_end_of_phi_block-Tuple{Core.Compiler.IRCode, Int64}"><code>Diffractor.find_end_of_phi_block</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">find_end_of_phi_block(ir::IRCode, start_search_idx::Int)</code></pre><p>Finds the last index within the same basic block, on or after the <code>start_search_idx</code> which is not within a phi block. A phi-block is a run on PhiNodes or nothings that must be the first statements within the basic block.</p><p>If <code>start_search_idx</code> is not within a phi block to begin with, then just returns <code>start_search_idx</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/stage1/compiler_utils.jl#L60-L67">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Diffractor.forward_diff_no_inf!-Tuple{Core.Compiler.IRCode, Vector{Pair{Core.SSAValue, Int64}}}" href="#Diffractor.forward_diff_no_inf!-Tuple{Core.Compiler.IRCode, Vector{Pair{Core.SSAValue, Int64}}}"><code>Diffractor.forward_diff_no_inf!</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">forward_diff_no_inf!(ir::IRCode, to_diff::Vector{Pair{SSAValue,Int}}; visit_custom!, transform!)</code></pre><p>Internal method which generates the code for forward mode diffentiation</p><ul><li><p><code>ir</code> the IR being differnetation</p></li><li><p><code>to_diff</code>: collection of all SSA values for which the derivative is to be taken, paired with the order (first deriviative, second derivative etc)</p></li><li><p><code>visit_custom!(ir::IRCode, ssa, order::Int, recurse::Bool) -&gt; Bool</code>:</p></li></ul><pre><code class="nohighlight hljs"> decides if the custom `transform!` should be applied to a `stmt` or not
Default: `false` for all statements</code></pre><ul><li><code>transform!(ir::IRCode, ssa::SSAValue, order::Int)</code> mutates <code>ir</code> to do a custom tranformation.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/codegen/forward_demand.jl#L206-L220">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Diffractor.jet_taylor_ev-Union{Tuple{N}, Tuple{Val{N}, Any, Any}} where N" href="#Diffractor.jet_taylor_ev-Union{Tuple{N}, Tuple{Val{N}, Any, Any}} where N"><code>Diffractor.jet_taylor_ev</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">jet_taylor_ev(::Val{}, jet, taylor)</code></pre><p>Generates a closed form arithmetic expression for the N-th component of the action of a 1d jet (of order at least N) on a maximally symmetric (i.e. taylor) tangent bundle element. In particular, if we represent both the <code>jet</code> and the <code>taylor</code> tangent bundle element by their associated canonical taylor series:</p><pre><code class="nohighlight hljs">j = j₀ + j₁ (x - a) + j₂ 1/2 (x - a)^2 + ... + jₙ 1/n! (x - a)^n
t = t₀ + t₁ (x - t₀) + t₂ 1/2 (x - t₀)^2 + ... + tₙ 1/n! (x - t₀)^n</code></pre><p>then the action of evaluating <code>j</code> on <code>t</code>, is some other taylor series</p><pre><code class="nohighlight hljs">t′ = a + t′₁ (x - a) + t′₂ 1/2 (x - a)^2 + ... + t′ₙ 1/n! (x - a)^n</code></pre><p>The t′ᵢ can be found by explicitly plugging in <code>t</code> for every <code>x</code> and expanding out, dropping terms of orders that are higher. This computes closed form expressions for the t′ᵢ that are hopefully easier on the compiler.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/jet.jl#L204-L223">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Diffractor.@∂-Tuple{Any}" href="#Diffractor.@∂-Tuple{Any}"><code>Diffractor.@∂</code></a><span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@∂</code></pre><p>Convenice macro for writing partial derivatives. E.g. The expression:</p><pre><code class="language-julia hljs">@∂ f(∂x, ∂y)</code></pre><p>Will compute the partial derivative ∂^2 f/∂x∂y at <code>(x, y)</code>`. And similarly</p><pre><code class="language-julia hljs">@∂ f(∂²x, ∂y)</code></pre><p>will compute the derivative <code>∂^3 f/∂x^2 ∂y</code> at <code>(x,y)</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/interface.jl#L206-L222">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="reading_list.html">« Reading List</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Sunday 17 December 2023 06:19">Sunday 17 December 2023</span>. Using Julia version 1.11.0-DEV.1109.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
t = t₀ + t₁ (x - t₀) + t₂ 1/2 (x - t₀)^2 + ... + tₙ 1/n! (x - t₀)^n</code></pre><p>then the action of evaluating <code>j</code> on <code>t</code>, is some other taylor series</p><pre><code class="nohighlight hljs">t′ = a + t′₁ (x - a) + t′₂ 1/2 (x - a)^2 + ... + t′ₙ 1/n! (x - a)^n</code></pre><p>The t′ᵢ can be found by explicitly plugging in <code>t</code> for every <code>x</code> and expanding out, dropping terms of orders that are higher. This computes closed form expressions for the t′ᵢ that are hopefully easier on the compiler.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/jet.jl#L204-L223">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="Diffractor.@∂-Tuple{Any}" href="#Diffractor.@∂-Tuple{Any}"><code>Diffractor.@∂</code></a><span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">@∂</code></pre><p>Convenice macro for writing partial derivatives. E.g. The expression:</p><pre><code class="language-julia hljs">@∂ f(∂x, ∂y)</code></pre><p>Will compute the partial derivative ∂^2 f/∂x∂y at <code>(x, y)</code>`. And similarly</p><pre><code class="language-julia hljs">@∂ f(∂²x, ∂y)</code></pre><p>will compute the derivative <code>∂^3 f/∂x^2 ∂y</code> at <code>(x,y)</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaDiff/Diffractor.jl/blob/cbcc0f3ffcedd8074c91a261b7e19229dcb273b7/src/interface.jl#L206-L222">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="reading_list.html">« Reading List</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Monday 18 December 2023 06:21">Monday 18 December 2023</span>. Using Julia version 1.11.0-DEV.1111.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
3×3 Matrix{Float64}:
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0</code></pre></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="reading_list.html">Reading List »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Sunday 17 December 2023 06:19">Sunday 17 December 2023</span>. Using Julia version 1.11.0-DEV.1109.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
0.0 0.0 1.0</code></pre></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="reading_list.html">Reading List »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Monday 18 December 2023 06:21">Monday 18 December 2023</span>. Using Julia version 1.11.0-DEV.1111.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 32684af

Please sign in to comment.