Skip to content

Commit

Permalink
build based on 7a1124e
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Nov 10, 2024
1 parent bd72c5b commit b38f2db
Show file tree
Hide file tree
Showing 27 changed files with 31 additions and 31 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.1","generation_timestamp":"2024-11-10T09:53:02","documenter_version":"1.7.0"}}
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-10T09:59:54","documenter_version":"1.7.0"}}
2 changes: 1 addition & 1 deletion dev/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Home · RestrictedBoltzmannMachines.jl</title><meta name="title" content="Home · RestrictedBoltzmannMachines.jl"/><meta property="og:title" content="Home · RestrictedBoltzmannMachines.jl"/><meta property="twitter:title" content="Home · RestrictedBoltzmannMachines.jl"/><meta name="description" content="Documentation for RestrictedBoltzmannMachines.jl."/><meta property="og:description" content="Documentation for RestrictedBoltzmannMachines.jl."/><meta property="twitter:description" content="Documentation for RestrictedBoltzmannMachines.jl."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href>RestrictedBoltzmannMachines.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Home</a></li><li><span class="tocitem">Examples</span><ul><li><a class="tocitem" href="literate/MNIST/">MNIST</a></li><li><input class="collapse-toggle" id="menuitem-2-2" type="checkbox"/><label class="tocitem" for="menuitem-2-2"><span class="docs-label">Layers</span><i class="docs-chevron"></i></label><ul class="collapsed"><li><a class="tocitem" href="literate/layers/Gaussian/">Gaussian</a></li><li><a class="tocitem" href="literate/layers/ReLU/">ReLU</a></li><li><a class="tocitem" href="literate/layers/dReLU/">dReLU</a></li></ul></li><li><a class="tocitem" href="literate/ais/">AIS</a></li><li><a class="tocitem" href="literate/metropolis/">Metropolis</a></li></ul></li><li><a class="tocitem" href="reference/">Reference</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Home</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Home</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/cossio/RestrictedBoltzmannMachines.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/cossio/RestrictedBoltzmannMachines.jl/blob/master/docs/src/index.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="RestrictedBoltzmannMachines.jl-Documentation"><a class="docs-heading-anchor" href="#RestrictedBoltzmannMachines.jl-Documentation">RestrictedBoltzmannMachines.jl Documentation</a><a id="RestrictedBoltzmannMachines.jl-Documentation-1"></a><a class="docs-heading-anchor-permalink" href="#RestrictedBoltzmannMachines.jl-Documentation" title="Permalink"></a></h1><p>A Julia package to train and simulate Restricted Boltzmann Machines. The package is registered. Install it with:</p><pre><code class="language-julia hljs">import Pkg
Pkg.add(&quot;RestrictedBoltzmannMachines&quot;)</code></pre><p>The source code is hosted on Github.</p><p><a href="https://github.com/cossio/RestrictedBoltzmannMachines.jl">https://github.com/cossio/RestrictedBoltzmannMachines.jl</a></p><p>This package doesn&#39;t export any symbols. It can be imported like this:</p><pre><code class="language-julia hljs">import RestrictedBoltzmannMachines as RBMs</code></pre><p>to avoid typing a long name everytime.</p><p>Most of the functions have a helpful docstring. See <a href="reference/#Reference">Reference</a> section.</p><p>See also the Examples listed on the menu on the left side bar to understand how the package works as a whole.</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="literate/MNIST/">MNIST »</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="Sunday 10 November 2024 09:53">Sunday 10 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Pkg.add(&quot;RestrictedBoltzmannMachines&quot;)</code></pre><p>The source code is hosted on Github.</p><p><a href="https://github.com/cossio/RestrictedBoltzmannMachines.jl">https://github.com/cossio/RestrictedBoltzmannMachines.jl</a></p><p>This package doesn&#39;t export any symbols. It can be imported like this:</p><pre><code class="language-julia hljs">import RestrictedBoltzmannMachines as RBMs</code></pre><p>to avoid typing a long name everytime.</p><p>Most of the functions have a helpful docstring. See <a href="reference/#Reference">Reference</a> section.</p><p>See also the Examples listed on the menu on the left side bar to understand how the package works as a whole.</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="literate/MNIST/">MNIST »</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="Sunday 10 November 2024 09:59">Sunday 10 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Binary file removed dev/literate/MNIST/1e8e1eed.png
Binary file not shown.
Binary file removed dev/literate/MNIST/3e7f5320.png
Binary file not shown.
Binary file added dev/literate/MNIST/73d0743f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/literate/MNIST/9cb3df5e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed dev/literate/MNIST/d0ac7736.png
Binary file not shown.
Binary file added dev/literate/MNIST/d521a019.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed dev/literate/MNIST/fa269099.png
Binary file not shown.
Binary file added dev/literate/MNIST/fd4fb255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions dev/literate/MNIST/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
Makie.image!(ax, imggrid(digits), colorrange=(1,0))
Makie.hidedecorations!(ax)
Makie.hidespines!(ax)
fig</code></pre><img src="d0ac7736.png" alt="Example block output"/><p>Initialize an RBM with 400 hidden units.</p><pre><code class="language-julia hljs">rbm = BinaryRBM(Float, (28,28), 400)
initialize!(rbm, train_x) # match single-site statistics</code></pre><p>Initially, the RBM assigns a poor pseudolikelihood to the data.</p><pre><code class="language-julia hljs">println(&quot;log(PL) = &quot;, mean(@time log_pseudolikelihood(rbm, train_x)))</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"> 1.974835 seconds (8.58 M allocations: 484.612 MiB, 4.35% gc time, 89.79% compilation time)
log(PL) = -0.2544163</code></pre><p>Now we train the RBM on the data.</p><pre><code class="language-julia hljs">batchsize = 256
fig</code></pre><img src="fd4fb255.png" alt="Example block output"/><p>Initialize an RBM with 400 hidden units.</p><pre><code class="language-julia hljs">rbm = BinaryRBM(Float, (28,28), 400)
initialize!(rbm, train_x) # match single-site statistics</code></pre><p>Initially, the RBM assigns a poor pseudolikelihood to the data.</p><pre><code class="language-julia hljs">println(&quot;log(PL) = &quot;, mean(@time log_pseudolikelihood(rbm, train_x)))</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"> 1.956182 seconds (8.58 M allocations: 484.734 MiB, 5.10% gc time, 90.16% compilation time)
log(PL) = -0.2590893</code></pre><p>Now we train the RBM on the data.</p><pre><code class="language-julia hljs">batchsize = 256
iters = 10000
history = MVHistory()
@time pcd!(
Expand All @@ -39,25 +39,25 @@
@trace history iter lpl
end
end
)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">268.708819 seconds (20.83 M allocations: 205.582 GiB, 21.09% gc time, 6.22% compilation time)</code></pre><p>After training, the pseudolikelihood score of the data improves significantly. Plot of log-pseudolikelihood of trian data during learning.</p><pre><code class="language-julia hljs">fig = Makie.Figure(resolution=(500,300))
)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">268.390142 seconds (20.85 M allocations: 205.583 GiB, 20.59% gc time, 6.25% compilation time)</code></pre><p>After training, the pseudolikelihood score of the data improves significantly. Plot of log-pseudolikelihood of trian data during learning.</p><pre><code class="language-julia hljs">fig = Makie.Figure(resolution=(500,300))
ax = Makie.Axis(fig[1,1], xlabel = &quot;train time&quot;, ylabel=&quot;pseudolikelihood&quot;)
Makie.lines!(ax, get(history, :lpl)...)
fig</code></pre><img src="3e7f5320.png" alt="Example block output"/><p>Sample digits from the RBM starting from a random condition.</p><pre><code class="language-julia hljs">nsteps = 3000
fig</code></pre><img src="d521a019.png" alt="Example block output"/><p>Sample digits from the RBM starting from a random condition.</p><pre><code class="language-julia hljs">nsteps = 3000
fantasy_F = zeros(nrows*ncols, nsteps)
fantasy_x = bitrand(28,28,nrows*ncols)
fantasy_F[:,1] .= free_energy(rbm, fantasy_x)
@time for t in 2:nsteps
fantasy_x .= sample_v_from_v(rbm, fantasy_x)
fantasy_F[:,t] .= free_energy(rbm, fantasy_x)
end</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"> 17.973418 seconds (244.20 k allocations: 11.988 GiB, 2.05% gc time, 1.14% compilation time)</code></pre><p>Check equilibration of sampling</p><pre><code class="language-julia hljs">fig = Makie.Figure(resolution=(400,300))
end</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"> 19.657277 seconds (244.20 k allocations: 11.988 GiB, 2.68% gc time, 1.06% compilation time)</code></pre><p>Check equilibration of sampling</p><pre><code class="language-julia hljs">fig = Makie.Figure(resolution=(400,300))
ax = Makie.Axis(fig[1,1], xlabel=&quot;sampling time&quot;, ylabel=&quot;free energy&quot;)
fantasy_F_μ = vec(mean(fantasy_F; dims=1))
fantasy_F_σ = vec(std(fantasy_F; dims=1))
Makie.band!(ax, 1:nsteps, fantasy_F_μ - fantasy_F_σ/2, fantasy_F_μ + fantasy_F_σ/2)
Makie.lines!(ax, 1:nsteps, fantasy_F_μ)
fig</code></pre><img src="1e8e1eed.png" alt="Example block output"/><p>Plot the sampled digits.</p><pre><code class="language-julia hljs">fig = Makie.Figure(resolution=(40ncols, 40nrows))
fig</code></pre><img src="9cb3df5e.png" alt="Example block output"/><p>Plot the sampled digits.</p><pre><code class="language-julia hljs">fig = Makie.Figure(resolution=(40ncols, 40nrows))
ax = Makie.Axis(fig[1,1], yreversed=true)
Makie.image!(ax, imggrid(reshape(fantasy_x, 28, 28, ncols, nrows)), colorrange=(1,0))
Makie.hidedecorations!(ax)
Makie.hidespines!(ax)
fig</code></pre><img src="fa269099.png" alt="Example block output"/><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="../layers/Gaussian/">Gaussian »</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="Sunday 10 November 2024 09:53">Sunday 10 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
fig</code></pre><img src="73d0743f.png" alt="Example block output"/><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="../layers/Gaussian/">Gaussian »</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="Sunday 10 November 2024 09:59">Sunday 10 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Binary file added dev/literate/ais/02d616e3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed dev/literate/ais/3c5c2a46.png
Binary file not shown.
Loading

0 comments on commit b38f2db

Please sign in to comment.