Skip to content

Commit

Permalink
Auto merge of #93 - MichaelHirn:book, r=MichaelHirn
Browse files Browse the repository at this point in the history
[WIP] The 'Leaf: Machine Learning for hackers' book

This PR is a work in progress. So far I added the 1. Leaf and 2. Layers chapters.

Feedback for the overall structure of the book as well as the general ideas and style of the first two chapters are highly welcome.

There are probably a lot of typos and grammar mistakes in there. You don't have to bother yet pointing them out, the text might change quickly.

REFERENCE: #91
  • Loading branch information
homu committed Apr 13, 2016
2 parents de0eb7c + cd1d476 commit ba0ad2f
Show file tree
Hide file tree
Showing 45 changed files with 5,036 additions and 5 deletions.
4 changes: 4 additions & 0 deletions doc/book/_FontAwesome/css/font-awesome.css

Large diffs are not rendered by default.

Binary file added doc/book/_FontAwesome/fonts/FontAwesome.ttf
Binary file not shown.
Binary file not shown.
640 changes: 640 additions & 0 deletions doc/book/_FontAwesome/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
129 changes: 129 additions & 0 deletions doc/book/backend.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

<base href="">

<link rel="stylesheet" href="book.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

<link rel="shortcut icon" href="favicon.png">

<!-- Font Awesome -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

<link rel="stylesheet" href="highlight.css">
<link rel="stylesheet" href="tomorrow-night.css">

<!-- MathJax -->
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

<!-- Fetch JQuery from CDN but have a local fallback -->
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='jquery.js'%3E%3C/script%3E"));
}
</script>
</head>
<body>
<!-- Set the theme before any content is loaded, prevents flash -->
<script type="text/javascript">
var theme = localStorage.getItem('theme');
if (theme == null) { theme = 'light'; }
$('body').removeClass().addClass(theme);
</script>

<!-- Hide / unhide sidebar before it is displayed -->
<script type="text/javascript">
var sidebar = localStorage.getItem('sidebar');
if (sidebar === "hidden") { $("html").addClass("sidebar-hidden") }
else if (sidebar === "visible") { $("html").addClass("sidebar-visible") }
</script>

<div id="sidebar" class="sidebar">
<ul class="chapter"><li><a href="./leaf.html"><strong>1.</strong> Leaf</a></li><li><a href="./layers.html"><strong>2.</strong> Layers</a></li><li><ul class="section"><li><a href="./layer-lifecycle.html"><strong>2.1.</strong> Layer Lifecycle</a></li><li><a href="./building-networks.html"><strong>2.2.</strong> Create a Network</a></li><li><a href="./create-new-layer.html"><strong>2.3.</strong> Create a new Layer</a></li></ul></li><li><a href="./solvers.html"><strong>3.</strong> Solvers</a></li><li><ul class="section"><li><a href="./optimize-layers.html"><strong>3.1.</strong> Optimize Layers</a></li><li><a href="./multi-device-optimization.html"><strong>3.2.</strong> Multi-Device Optimization</a></li><li><a href="./distributed-optimization.html"><strong>3.3.</strong> Distributed Optimization</a></li></ul></li><li><a href="./backend.html" class="active"><strong>4.</strong> Backend</a></li><li><a href="./deep-learning-glossary.html"><strong>5.</strong> Glossary</a></li><li class="spacer"></li><li><a href="http://autumnai.github.io/leaf/leaf/index.html"><strong>6.</strong> Rust API Documentation</a></li></ul>
</div>

<div id="page-wrapper" class="page-wrapper">

<div class="page">
<div id="menu-bar" class="menu-bar">
<div class="left-buttons">
<i id="sidebar-toggle" class="fa fa-bars"></i>
<i id="theme-toggle" class="fa fa-paint-brush"></i>
</div>

<h1 class="menu-title"></h1>

<div class="right-buttons">
<i id="print-button" class="fa fa-print" title="Print this book"></i>
</div>
</div>

<div id="content" class="content">
<h1>Backend</h1>
<p>Via the concept of a backend we can abstract over the platform we will execute
or optimize a network on. The construction of a backend is trivial. The backend
is passed to the <code>Solver</code>, (one backend for <code>network</code> and one for the
<code>objectve</code>). The Solver than executes all operations on the provided backend.</p>
<pre><code class="language-rust">let backend = ::std::rc::Rc::new(Backend::&lt;Cuda&gt;::default().unwrap());

// set up solver
let mut solver_cfg = SolverConfig { minibatch_size: batch_size, base_lr: learning_rate, momentum: momentum, .. SolverConfig::default() };
solver_cfg.network = LayerConfig::new(&quot;network&quot;, net_cfg);
solver_cfg.objective = LayerConfig::new(&quot;classifier&quot;, classifier_cfg);
let mut solver = Solver::from_config(backend.clone(), backend.clone(), &amp;solver_cfg);
</code></pre>
<p>The backend is a concept of
<a href="https://github.com/autumnai/collenchyma">Collenchyma</a>, to which you can refer
for now, until this chapter becomes more fleshed out.</p>

</div>

<!-- Mobile navigation buttons -->

<a href="./distributed-optimization.html" class="mobile-nav-chapters previous">
<i class="fa fa-angle-left"></i>
</a>



<a href="./deep-learning-glossary.html" class="mobile-nav-chapters next">
<i class="fa fa-angle-right"></i>
</a>


</div>


<a href="./distributed-optimization.html" class="nav-chapters previous" title="You can navigate through the chapters using the arrow keys">
<i class="fa fa-angle-left"></i>
</a>



<a href="./deep-learning-glossary.html" class="nav-chapters next" title="You can navigate through the chapters using the arrow keys">
<i class="fa fa-angle-right"></i>
</a>


</div>


<!-- Local fallback for Font Awesome -->
<script>
if ($(".fa").css("font-family") !== "FontAwesome") {
$('<link rel="stylesheet" type="text/css" href="_FontAwesome/css/font-awesome.css">').prependTo('head');
}
</script>

<script src="highlight.js"></script>
<script src="book.js"></script>
</body>
</html>
Loading

0 comments on commit ba0ad2f

Please sign in to comment.