Skip to content

Commit

Permalink
build based on 6a70125
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Dec 5, 2024
1 parent ea15ae7 commit 94bd2dd
Show file tree
Hide file tree
Showing 33 changed files with 139 additions and 128 deletions.
2 changes: 1 addition & 1 deletion previews/PR2535/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2024-12-05T03:31:59","documenter_version":"1.8.0"}}
{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2024-12-05T16:35:39","documenter_version":"1.8.0"}}
2 changes: 1 addition & 1 deletion previews/PR2535/ecosystem/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR2535/guide/gpu/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@
true</code></pre><p>For Metal GPU:</p><pre><code class="language-julia-repl hljs">julia&gt; using Metal

julia&gt; Metal.functional()
true</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../models/recurrence/">« Recurrence</a><a class="docs-footer-nextpage" href="../saving/">Saving &amp; Loading »</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.8.0 on <span class="colophon-date" title="Thursday 5 December 2024 03:31">Thursday 5 December 2024</span>. Using Julia version 1.11.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
true</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../models/recurrence/">« Recurrence</a><a class="docs-footer-nextpage" href="../saving/">Saving &amp; Loading »</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.8.0 on <span class="colophon-date" title="Thursday 5 December 2024 16:35">Thursday 5 December 2024</span>. Using Julia version 1.11.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
33 changes: 22 additions & 11 deletions previews/PR2535/guide/models/basics/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR2535/guide/models/overview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@

julia&gt; y_test
1×5 Matrix{Int64}:
26 30 34 38 42</code></pre><p>The predictions are good. Here&#39;s how we got there. </p><p>First, we gathered real-world data into the variables <code>x_train</code>, <code>y_train</code>, <code>x_test</code>, and <code>y_test</code>. The <code>x_*</code> data defines inputs, and the <code>y_*</code> data defines outputs. The <code>*_train</code> data is for training the model, and the <code>*_test</code> data is for verifying the model. Our data was based on the function <code>4x + 2</code>.</p><p>Then, we built a single input, single output predictive model, <code>predict = Dense(1 =&gt; 1)</code>. The initial predictions weren&#39;t accurate, because we had not trained the model yet.</p><p>After building the model, we trained it with <code>train!(loss, predict, data, opt)</code>. The loss function is first, followed by the model itself, the training data, and the <code>Descent</code> optimiser provided by Flux. We ran the training step once, and observed that the parameters changed and the loss went down. Then, we ran the <code>train!</code> many times to finish the training process.</p><p>After we trained the model, we verified it with the test data to verify the results. </p><p>This overall flow represents how Flux works. Let&#39;s drill down a bit to understand what&#39;s going on inside the individual layers of Flux.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../quickstart/">« Quick Start</a><a class="docs-footer-nextpage" href="../basics/">Gradients and Layers »</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.8.0 on <span class="colophon-date" title="Thursday 5 December 2024 03:31">Thursday 5 December 2024</span>. Using Julia version 1.11.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
26 30 34 38 42</code></pre><p>The predictions are good. Here&#39;s how we got there. </p><p>First, we gathered real-world data into the variables <code>x_train</code>, <code>y_train</code>, <code>x_test</code>, and <code>y_test</code>. The <code>x_*</code> data defines inputs, and the <code>y_*</code> data defines outputs. The <code>*_train</code> data is for training the model, and the <code>*_test</code> data is for verifying the model. Our data was based on the function <code>4x + 2</code>.</p><p>Then, we built a single input, single output predictive model, <code>predict = Dense(1 =&gt; 1)</code>. The initial predictions weren&#39;t accurate, because we had not trained the model yet.</p><p>After building the model, we trained it with <code>train!(loss, predict, data, opt)</code>. The loss function is first, followed by the model itself, the training data, and the <code>Descent</code> optimiser provided by Flux. We ran the training step once, and observed that the parameters changed and the loss went down. Then, we ran the <code>train!</code> many times to finish the training process.</p><p>After we trained the model, we verified it with the test data to verify the results. </p><p>This overall flow represents how Flux works. Let&#39;s drill down a bit to understand what&#39;s going on inside the individual layers of Flux.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../quickstart/">« Quick Start</a><a class="docs-footer-nextpage" href="../basics/">Gradients and Layers »</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.8.0 on <span class="colophon-date" title="Thursday 5 December 2024 16:35">Thursday 5 December 2024</span>. Using Julia version 1.11.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion previews/PR2535/guide/models/quickstart/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@
y_hat = m(x)
Flux.logitcrossentropy(y_hat, y)
end
end</code></pre><ul><li><p>Notice that the full dataset <code>noisy</code> lives on the CPU, and is moved to the GPU one batch at a time, by <code>xy_cpu |&gt; device</code>. This is generally what you want for large datasets. Calling <code>loader |&gt; device</code> similarly modifies the <code>DataLoader</code> to move one batch at a time.</p></li><li><p>In our simple example, we conveniently created the model has a <a href="../../../reference/models/layers/#Flux.Chain"><code>Chain</code></a> of layers.</p></li></ul><p>For more complex models, you can define a custom struct <code>MyModel</code> containing layers and arrays and implement the call operator <code>(::MyModel)(x) = ...</code> to define the forward pass. This is all it is needed for Flux to work. Marking the struct with <a href="../../../reference/models/functors/#Flux.@layer"><code>Flux.@layer</code></a> will add some more functionality, like pretty printing and the ability to mark some internal fields as trainable or not (also see <a href="../../../reference/destructure/#Optimisers.trainable"><code>trainable</code></a>).</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../../">« Welcome</a><a class="docs-footer-nextpage" href="../overview/">Fitting a Line »</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.8.0 on <span class="colophon-date" title="Thursday 5 December 2024 03:31">Thursday 5 December 2024</span>. Using Julia version 1.11.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code></pre><ul><li><p>Notice that the full dataset <code>noisy</code> lives on the CPU, and is moved to the GPU one batch at a time, by <code>xy_cpu |&gt; device</code>. This is generally what you want for large datasets. Calling <code>loader |&gt; device</code> similarly modifies the <code>DataLoader</code> to move one batch at a time.</p></li><li><p>In our simple example, we conveniently created the model has a <a href="../../../reference/models/layers/#Flux.Chain"><code>Chain</code></a> of layers.</p></li></ul><p>For more complex models, you can define a custom struct <code>MyModel</code> containing layers and arrays and implement the call operator <code>(::MyModel)(x) = ...</code> to define the forward pass. This is all it is needed for Flux to work. Marking the struct with <a href="../../../reference/models/functors/#Flux.@layer"><code>Flux.@layer</code></a> will add some more functionality, like pretty printing and the ability to mark some internal fields as trainable or not (also see <a href="../../../reference/destructure/#Optimisers.trainable"><code>trainable</code></a>).</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../../">« Welcome</a><a class="docs-footer-nextpage" href="../overview/">Fitting a Line »</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.8.0 on <span class="colophon-date" title="Thursday 5 December 2024 16:35">Thursday 5 December 2024</span>. Using Julia version 1.11.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion previews/PR2535/guide/models/recurrence/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@
opt_state = Flux.setup(AdamW(1e-3), model)

g = gradient(m -&gt; Flux.mse(m(x), y), model)[1]
Flux.update!(opt_state, model, g)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../training/training/">« Training</a><a class="docs-footer-nextpage" href="../../gpu/">GPU Support »</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.8.0 on <span class="colophon-date" title="Thursday 5 December 2024 03:31">Thursday 5 December 2024</span>. Using Julia version 1.11.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Flux.update!(opt_state, model, g)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../training/training/">« Training</a><a class="docs-footer-nextpage" href="../../gpu/">GPU Support »</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.8.0 on <span class="colophon-date" title="Thursday 5 December 2024 16:35">Thursday 5 December 2024</span>. Using Julia version 1.11.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 94bd2dd

Please sign in to comment.