Skip to content

Commit

Permalink
build based on b34bf64
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Oct 1, 2024
1 parent b760154 commit 576e316
Show file tree
Hide file tree
Showing 11 changed files with 267 additions and 267 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.10.5","generation_timestamp":"2024-10-01T08:55:00","documenter_version":"1.7.0"}}
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-01T10:02:51","documenter_version":"1.7.0"}}
2 changes: 1 addition & 1 deletion dev/bibliography/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/examples/sparse_linear_regression/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@

reg = ProximalOperators.NormL1(1)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">ProximalOperators.NormL1{Int64}(1)</code></pre><p>We want to minimize the sum of <code>training_loss</code> and <code>reg</code>, and for this task we can use <code>FastForwardBackward</code>, which implements the fast proximal gradient method (also known as fast forward-backward splitting, or FISTA). Therefore we construct the algorithm, then apply it to our problem by providing a starting point, and the objective terms <code>f=training_loss</code> (smooth) and <code>g=reg</code> (non smooth).</p><pre><code class="language-julia hljs">ffb = ProximalAlgorithms.FastForwardBackward()
solution, iterations = ffb(x0 = zeros(n_features + 1), f = training_loss, g = reg)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">([0.0, -9.84468723961304, 23.777300627851535, 12.957770377540996, -4.7470469711076575, 0.0, -11.013138882753212, 0.0, 24.351386511781616, 3.2906368579992815, 151.01169590643272], 285)</code></pre><p>We can now check how well the trained model performs on the test portion of our data.</p><pre><code class="language-julia hljs">test_output = standardized_linear_model(solution, test_input)
mean_squared_error(test_label, test_output)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">1369.3780923676934</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../guide/custom_algorithms/">« Custom algorithms</a><a class="docs-footer-nextpage" href="../../bibliography/">Bibliography »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Tuesday 1 October 2024 08:54">Tuesday 1 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
mean_squared_error(test_label, test_output)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">1369.3780923676934</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../guide/custom_algorithms/">« Custom algorithms</a><a class="docs-footer-nextpage" href="../../bibliography/">Bibliography »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Tuesday 1 October 2024 10:02">Tuesday 1 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/guide/custom_algorithms/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions dev/guide/custom_objectives/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions dev/guide/getting_started/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
color = :red,
markershape = :star5,
label = &quot;computed solution&quot;,
)</code></pre><img src="887f9a75.svg" alt="Example block output"/><h2 id="iterator_interface"><a class="docs-heading-anchor" href="#iterator_interface">Iterator interface</a><a id="iterator_interface-1"></a><a class="docs-heading-anchor-permalink" href="#iterator_interface" title="Permalink"></a></h2><p>Under the hood, algorithms are implemented in the form of standard Julia iterators: constructing such iterator objects directly, and looping over them, allows for more fine-grained control over the termination condition, or what information from the iterations get logged.</p><p>Each iterator is constructed with the full problem description (objective terms and, if needed, additional information like Lipschitz constats) and algorithm options (usually step sizes, and any other parameter or option of the algorithm), and produces the sequence of states of the algorithm, so that one can do (almost) anything with it.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>Iterators only implement the algorithm iteration logic, and not additional details like stopping criteria. As such, iterators usually yield an infinite sequence of states: when looping over them, be careful to properly guard the loop with a stopping criterion.</p></div></div><div class="admonition is-warning"><header class="admonition-header">Warning</header><div class="admonition-body"><p>To save on allocations, most (if not all) algorithms re-use state objects when iterating, by updating the state <em>in place</em> instead of creating a new one. For this reason:</p><ul><li>one <strong>should not</strong> mutate the state object in any way, as this may corrupt the algorithm&#39;s logic;</li><li>one <strong>should not</strong> <code>collect</code> the sequence of states, since this will result in an array of identical objects.</li></ul></div></div><p>Iterator types are named after the algorithm they implement, so the relationship should be obvious:</p><ul><li>the <code>ForwardBackward</code> algorithm uses the <code>ForwardBackwardIteration</code> iterator type;</li><li>the <code>FastForwardBackward</code> algorithm uses the <code>FastForwardBackwardIteration</code> iterator type;</li><li>the <code>DouglasRachford</code> algorithm uses the <code>DouglasRachfordIteration</code> iterator type;</li></ul><p>and so on.</p><p>Let&#39;s see what this means in terms of the previous example.</p><h2 id="box_qp_cont"><a class="docs-heading-anchor" href="#box_qp_cont">Example: box constrained quadratic (cont)</a><a id="box_qp_cont-1"></a><a class="docs-heading-anchor-permalink" href="#box_qp_cont" title="Permalink"></a></h2><p>Let&#39;s solve the problem from the <a href="#box_qp">previous example</a> by directly interacting with the underlying iterator: the <code>FastForwardBackward</code> algorithm internally uses a <a href="../implemented_algorithms/#ProximalAlgorithms.FastForwardBackwardIteration"><code>FastForwardBackwardIteration</code></a> object.</p><pre><code class="language-julia hljs">ffbiter = ProximalAlgorithms.FastForwardBackwardIteration(
)</code></pre><img src="402b5ef4.svg" alt="Example block output"/><h2 id="iterator_interface"><a class="docs-heading-anchor" href="#iterator_interface">Iterator interface</a><a id="iterator_interface-1"></a><a class="docs-heading-anchor-permalink" href="#iterator_interface" title="Permalink"></a></h2><p>Under the hood, algorithms are implemented in the form of standard Julia iterators: constructing such iterator objects directly, and looping over them, allows for more fine-grained control over the termination condition, or what information from the iterations get logged.</p><p>Each iterator is constructed with the full problem description (objective terms and, if needed, additional information like Lipschitz constats) and algorithm options (usually step sizes, and any other parameter or option of the algorithm), and produces the sequence of states of the algorithm, so that one can do (almost) anything with it.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>Iterators only implement the algorithm iteration logic, and not additional details like stopping criteria. As such, iterators usually yield an infinite sequence of states: when looping over them, be careful to properly guard the loop with a stopping criterion.</p></div></div><div class="admonition is-warning"><header class="admonition-header">Warning</header><div class="admonition-body"><p>To save on allocations, most (if not all) algorithms re-use state objects when iterating, by updating the state <em>in place</em> instead of creating a new one. For this reason:</p><ul><li>one <strong>should not</strong> mutate the state object in any way, as this may corrupt the algorithm&#39;s logic;</li><li>one <strong>should not</strong> <code>collect</code> the sequence of states, since this will result in an array of identical objects.</li></ul></div></div><p>Iterator types are named after the algorithm they implement, so the relationship should be obvious:</p><ul><li>the <code>ForwardBackward</code> algorithm uses the <code>ForwardBackwardIteration</code> iterator type;</li><li>the <code>FastForwardBackward</code> algorithm uses the <code>FastForwardBackwardIteration</code> iterator type;</li><li>the <code>DouglasRachford</code> algorithm uses the <code>DouglasRachfordIteration</code> iterator type;</li></ul><p>and so on.</p><p>Let&#39;s see what this means in terms of the previous example.</p><h2 id="box_qp_cont"><a class="docs-heading-anchor" href="#box_qp_cont">Example: box constrained quadratic (cont)</a><a id="box_qp_cont-1"></a><a class="docs-heading-anchor-permalink" href="#box_qp_cont" title="Permalink"></a></h2><p>Let&#39;s solve the problem from the <a href="#box_qp">previous example</a> by directly interacting with the underlying iterator: the <code>FastForwardBackward</code> algorithm internally uses a <a href="../implemented_algorithms/#ProximalAlgorithms.FastForwardBackwardIteration"><code>FastForwardBackwardIteration</code></a> object.</p><pre><code class="language-julia hljs">ffbiter = ProximalAlgorithms.FastForwardBackwardIteration(
x0 = ones(2),
f = quadratic_cost,
g = box_indicator,
Expand Down Expand Up @@ -63,4 +63,4 @@
color = :red,
markershape = :star5,
label = &quot;computed solution&quot;,
)</code></pre><img src="88ca0a45.svg" alt="Example block output"/><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>Since each algorithm iterator type has its own logic, it will also have its own dedicated state structure. Interacting with the state then requires being familiar with its structure, and with the nature of its attributes.</p></div></div><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../">« Home</a><a class="docs-footer-nextpage" href="../implemented_algorithms/">Problem types and algorithms »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Tuesday 1 October 2024 08:54">Tuesday 1 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
)</code></pre><img src="0a1aea4d.svg" alt="Example block output"/><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>Since each algorithm iterator type has its own logic, it will also have its own dedicated state structure. Interacting with the state then requires being familiar with its structure, and with the nature of its attributes.</p></div></div><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../">« Home</a><a class="docs-footer-nextpage" href="../implemented_algorithms/">Problem types and algorithms »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Tuesday 1 October 2024 10:02">Tuesday 1 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/guide/implemented_algorithms/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit 576e316

Please sign in to comment.