Skip to content

Commit 5aa2a2a

Browse files
author
Documenter.jl
committed
build based on 649afa6
1 parent 943192f commit 5aa2a2a

File tree

32 files changed

+119
-119
lines changed

32 files changed

+119
-119
lines changed

dev/.documenter-siteinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documenter":{"julia_version":"1.12.2","generation_timestamp":"2025-11-26T22:49:51","documenter_version":"1.16.1"}}
1+
{"documenter":{"julia_version":"1.12.2","generation_timestamp":"2025-11-28T23:22:30","documenter_version":"1.16.1"}}

dev/ecosystem/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dev/guide/gpu/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,4 @@
174174
true</code></pre><p>For Metal GPU:</p><pre><code class="language-julia-repl hljs">julia&gt; using Metal
175175

176176
julia&gt; Metal.functional()
177-
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.16.1 on <span class="colophon-date" title="Wednesday 26 November 2025 22:49">Wednesday 26 November 2025</span>. Using Julia version 1.12.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
177+
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.16.1 on <span class="colophon-date" title="Friday 28 November 2025 23:22">Friday 28 November 2025</span>. Using Julia version 1.12.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

dev/guide/models/basics/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@
7373

7474
layer3s(x) # output, 2-element Vector{Float32}
7575

76-
Flux.gradient((x,d) -&gt; d(x)[1], x, layer3s)[2] # NamedTuple{(:W, :b, :act)}</code></pre><p>This <code>∂f/∂layer3s</code> is a named tuple with the same fields as <code>Layer</code>. Within it, the gradient with respect to <code>W</code> is a matrix of seemingly random numbers. Notice that there is also an entry for <code>act</code>, which is <code>nothing</code>, as this field of the struct is not a smoothly adjustible parameter.</p><p>We can compose these layers just as we did the polynomials above, in <code>poly4</code>. Here&#39;s a composition of 3 functions, in which the last step is the function <code>only</code> which takes a 1-element vector and gives us the number inside:</p><pre><code class="language-julia hljs">model1 = only ∘ Layer(20, 1) ∘ Layer(1, 20)
76+
Flux.gradient((x,d) -&gt; d(x)[1], x, layer3s)[2] # NamedTuple{(:W, :b, :act)}</code></pre><p>This <code>∂f/∂layer3s</code> is a named tuple with the same fields as <code>Layer</code>. Within it, the gradient with respect to <code>W</code> is a matrix of seemingly random numbers. Notice that there is also an entry for <code>act</code>, which is <code>nothing</code>, as this field of the struct is not a smoothly adjustible parameter.</p><p>We can compose these layers just as we did the polynomials above, in <code>poly4</code>. Here&#39;s a composition of 3 functions, in which the last step is the function <code>only</code> which takes a 1-element vector and gives us the number inside:</p><pre><code class="language-julia hljs">model1 = only ∘ Layer(20, 1, identity) ∘ Layer(1, 20)
7777

7878
y = model1(Float32[0.1]) # output is a Float32 number
7979

8080
grad = Flux.gradient(|&gt;, [1f0], model1)[2]</code></pre><p>This gradient is starting to be a complicated nested structure. But it works just like before: <code>grad.outer.inner.W</code> corresponds to <code>model1.outer.inner.W</code>.</p><p>We don&#39;t have to use <code></code> (which makes a <code>ComposedFunction</code> struct) to combine layers. Instead, we could define our own container struct, or use a closure. This <code>model2</code> will work the same way (although its fields have different names):</p><pre><code class="language-julia hljs">model2 = let
8181
lay1 = Layer(1, 20) # local variables containing layers
82-
lay2 = Layer(20, 1)
82+
lay2 = Layer(20, 1, identity)
8383
function fwd(x) # equivalent to x -&gt; only(lay2(lay1(x)))
8484
mid = lay1(x)
8585
lay2(mid) |&gt; only
@@ -95,4 +95,4 @@
9595
Flux.train!((m,x,y) -&gt; (m(x) - y)^2, model3, data, Descent(0.01))
9696
end</code></pre><p>The same code will also work with <code>model1</code> or <code>model2</code> instead. Here&#39;s how to plot the desired and actual outputs:</p><pre><code class="language-julia hljs">using Plots
9797
plot(x -&gt; 2x-x^3, -2, 2, label=&quot;truth&quot;)
98-
scatter!(x -&gt; model3([x]), -2:0.1f0:2, label=&quot;fitted&quot;)</code></pre><p>More detail about what exactly the function <code>train!</code> is doing, and how to use rules other than simple <a href="../../../reference/training/optimisers/#Optimisers.Descent"><code>Descent</code></a>, is what the next page in this guide is about: <a href="../../training/training/#man-training">training</a>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../overview/">« Fitting a Line</a><a class="docs-footer-nextpage" href="../../training/training/">Training »</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.16.1 on <span class="colophon-date" title="Wednesday 26 November 2025 22:49">Wednesday 26 November 2025</span>. Using Julia version 1.12.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
98+
scatter!(x -&gt; model3([x]), -2:0.1f0:2, label=&quot;fitted&quot;)</code></pre><p>More detail about what exactly the function <code>train!</code> is doing, and how to use rules other than simple <a href="../../../reference/training/optimisers/#Optimisers.Descent"><code>Descent</code></a>, is what the next page in this guide is about: <a href="../../training/training/#man-training">training</a>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../overview/">« Fitting a Line</a><a class="docs-footer-nextpage" href="../../training/training/">Training »</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.16.1 on <span class="colophon-date" title="Friday 28 November 2025 23:22">Friday 28 November 2025</span>. Using Julia version 1.12.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

dev/guide/models/overview/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@
5656

5757
julia&gt; y_test
5858
1×5 Matrix{Int64}:
59-
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.16.1 on <span class="colophon-date" title="Wednesday 26 November 2025 22:49">Wednesday 26 November 2025</span>. Using Julia version 1.12.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
59+
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.16.1 on <span class="colophon-date" title="Friday 28 November 2025 23:22">Friday 28 November 2025</span>. Using Julia version 1.12.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 commit comments

Comments
 (0)