Skip to content

Commit

Permalink
Merge pull request dlab-berkeley#9 from dlab-berkeley/slides
Browse files Browse the repository at this point in the history
Added why Deep Learning to the slides and the link for the tidymodels…
  • Loading branch information
asteves authored Aug 12, 2021
2 parents a71f335 + f57d2c6 commit 8a0d7c3
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 19 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This is an advanced level workshop. Participants should be intermediate R users

We assume the following background:

* D-Lab's [Machine Learning in R introduction](https://github.com/dlab-berkeley/Machine-Learning-in-R) (6 hours)
* D-Lab's [Machine Learning in R introduction](https://github.com/dlab-berkeley/Machine-Learning-in-R) (6 hours) or its [tidymodels adaptation](https://github.com/dlab-berkeley/Machine-Learning-with-tidymodels)
* Or, comparable experience/training, assuming familiarity with:
* Basic R syntax
* statistical concepts such as mean and standard deviation
Expand All @@ -57,7 +57,6 @@ highly recommended but not required.
## Getting Started

Be sure to [follow the install instructions](https://github.com/dlab-berkeley/Deep-Learning-in-R/blob/master/participant-instructions.md) to get started. This process can take about 30 minutes, so be sure to try and do this before class.

## Resources

* D-Lab [Machine Learning Working Group](http://dlab.berkeley.edu/working-groups/machine-learning-working-group-0)
Expand Down
12 changes: 12 additions & 0 deletions docs/libs/header-attrs/header-attrs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});
24 changes: 20 additions & 4 deletions docs/slides.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ class: left

# What is deep learning? (short)

### - A subfield of machine learning that utilizes multi-layered artificial neural networks for modelling and prediction of data.
### - A subfield of machine learning that utilizes multi-layered artificial neural networks for modelling and prediction of data. It's also called "layered representational" or "hierarchical representational learning."

### - These models can be applied to numeric, categorical, image, text, audio, and time-series data.
### - These models (layered representations or neural networks) can be applied to numeric, categorical, image, text, audio, and time-series data.

### - For images, neural networks import the image as a matrix of pixel values. Therefore it is useful to think of images as giant matrices!

Expand All @@ -158,7 +158,8 @@ class: center

# What is an artificial neural network?

"Perceptron"
"Perceptron" or "Forward Propagation"

```{r, out.width = "600px", echo = F, eval = TRUE}
knitr::include_graphics("slide_img/ann.png")
```
Expand All @@ -185,6 +186,21 @@ knitr::include_graphics("slide_img/deep.png")

---

# Why deep learning?

- Rephrased from Allaire JJ, Chollet F 2018: 22-23

1. Simple: No more feature engineering.

2. Scalability:
- Parameterization on GPUs and TPUs.
- Iterating over smaller batches. (= Not restricted by the data size)

3. Versatility and reusability:
- Continuous online learning (new data can be learned without starting from scratch). The fundamental difference from classical ML models.

---

# How does it work?

#### 1. Supervised neural networks require "features", or an **input layer** of data that is used to produce our estimated **output layer**, or estimated classification of an actual image.
Expand All @@ -201,7 +217,7 @@ knitr::include_graphics("slide_img/deep.png")

#### 5. The vector of original weights is added to the vector of updated weights and are "backpropagated" (used as the recycled input) and passed through the model for another epoch.

#### 6. With deep networks, the process also takes places between **hidden layers**, or areas of nonlinear transformations connected only to the layers before and after them. They are referred to as "hidden" because they are not show as the final output.
#### 6. With deep networks, the process also takes places between **hidden layers**, or areas of *nonlinear* transformations connected only to the layers before and after them. They are referred to as "hidden" because they are not show as the final output.

---

Expand Down
118 changes: 105 additions & 13 deletions docs/slides.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<!DOCTYPE html>
<html>
<html lang="" xml:lang="">
<head>
<title>Introduction to Deep Learning in R</title>
<meta charset="utf-8">
<meta charset="utf-8" />
<meta name="author" content="D-Lab - Evan Muzzall and Chris Kennedy" />
<script src="libs/header-attrs/header-attrs.js"></script>
<link rel="stylesheet" href="scrollable.css" type="text/css" />
<link rel="stylesheet" href="mtheme_max.css" type="text/css" />
<link rel="stylesheet" href="fonts_mtheme_max.css" type="text/css" />
Expand Down Expand Up @@ -112,9 +113,9 @@

# What is deep learning? (short)

### - A subfield of machine learning that utilizes multi-layered artificial neural networks for modelling and prediction of data.
### - A subfield of machine learning that utilizes multi-layered artificial neural networks for modelling and prediction of data. It's also called "layered representational" or "hierarchical representational learning."

### - These models can be applied to numeric, categorical, image, text, audio, and time-series data.
### - These models (layered representations or neural networks) can be applied to numeric, categorical, image, text, audio, and time-series data.

### - For images, neural networks import the image as a matrix of pixel values. Therefore it is useful to think of images as giant matrices!

Expand All @@ -124,7 +125,8 @@

# What is an artificial neural network?

"Perceptron"
"Perceptron" or "Multistage information distillation operation" (Allaire JJ, Chollet F 2018: 9)

&lt;img src="slide_img/ann.png" width="600px" style="display: block; margin: auto;" /&gt;

---
Expand All @@ -145,6 +147,21 @@

---

# Why deep learning?

- Rephrased from Allaire JJ, Chollet F 2018: 22-23

1. Simple: No more feature engineering.

2. Scalability:
- Parameterization on GPUs and TPUs.
- Iterating over smaller batches. (= Not restricted by the data size)

3. Versatility and reusability:
- Continuous online learning (new data can be learned without starting from scratch). The fundamental difference from classical ML models.

---

# How does it work?

#### 1. Supervised neural networks require "features", or an **input layer** of data that is used to produce our estimated **output layer**, or estimated classification of an actual image.
Expand All @@ -161,7 +178,7 @@

#### 5. The vector of original weights is added to the vector of updated weights and are "backpropagated" (used as the recycled input) and passed through the model for another epoch.

#### 6. With deep networks, the process also takes places between **hidden layers**, or areas of nonlinear transformations connected only to the layers before and after them. They are referred to as "hidden" because they are not show as the final output.
#### 6. With deep networks, the process also takes places between **hidden layers**, or areas of *nonlinear* transformations connected only to the layers before and after them. They are referred to as "hidden" because they are not show as the final output.

---

Expand Down Expand Up @@ -403,27 +420,101 @@

Images [borrowed from Qingkai Kong's ANNs in Python workshop](https://github.com/qingkaikong/20181129_ANN_basics_DLab)
</textarea>
<style data-target="print-only">@media screen {.remark-slide-container{display:block;}.remark-slide-scaler{box-shadow:none;}}</style>
<script src="libs/remark-latest.min.js"></script>
<script>var slideshow = remark.create({
"ratio": "16:9",
"highlightStyle": "github",
"highlightLines": true,
"countIncrementalSlides": false,
"slideNumberFormat": "<div class=\"progress-bar-container\"> <div class=\"progress-bar\" style=\"width: calc(%current% / %total% * 100%);\"> </div> </div>` "
"slideNumberFormat": "<div class=\"progress-bar-container\">\n <div class=\"progress-bar\" style=\"width: calc(%current% / %total% * 100%);\">\n </div>\n</div>`\n"
});
if (window.HTMLWidgets) slideshow.on('afterShowSlide', function (slide) {
window.dispatchEvent(new Event('resize'));
});
(function() {
var d = document, s = d.createElement("style"), r = d.querySelector(".remark-slide-scaler");
(function(d) {
var s = d.createElement("style"), r = d.querySelector(".remark-slide-scaler");
if (!r) return;
s.type = "text/css"; s.innerHTML = "@page {size: " + r.style.width + " " + r.style.height +"; }";
d.head.appendChild(s);
})();</script>
})(document);

(function(d) {
var el = d.getElementsByClassName("remark-slides-area");
if (!el) return;
var slide, slides = slideshow.getSlides(), els = el[0].children;
for (var i = 1; i < slides.length; i++) {
slide = slides[i];
if (slide.properties.continued === "true" || slide.properties.count === "false") {
els[i - 1].className += ' has-continuation';
}
}
var s = d.createElement("style");
s.type = "text/css"; s.innerHTML = "@media print { .has-continuation { display: none; } }";
d.head.appendChild(s);
})(document);
// delete the temporary CSS (for displaying all slides initially) when the user
// starts to view slides
(function() {
var deleted = false;
slideshow.on('beforeShowSlide', function(slide) {
if (deleted) return;
var sheets = document.styleSheets, node;
for (var i = 0; i < sheets.length; i++) {
node = sheets[i].ownerNode;
if (node.dataset["target"] !== "print-only") continue;
node.parentNode.removeChild(node);
}
deleted = true;
});
})();
(function() {
"use strict"
// Replace <script> tags in slides area to make them executable
var scripts = document.querySelectorAll(
'.remark-slides-area .remark-slide-container script'
);
if (!scripts.length) return;
for (var i = 0; i < scripts.length; i++) {
var s = document.createElement('script');
var code = document.createTextNode(scripts[i].textContent);
s.appendChild(code);
var scriptAttrs = scripts[i].attributes;
for (var j = 0; j < scriptAttrs.length; j++) {
s.setAttribute(scriptAttrs[j].name, scriptAttrs[j].value);
}
scripts[i].parentElement.replaceChild(s, scripts[i]);
}
})();
(function() {
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) {
links[i].target = '_blank';
}
}
})();
// adds .remark-code-has-line-highlighted class to <pre> parent elements
// of code chunks containing highlighted lines with class .remark-code-line-highlighted
(function(d) {
const hlines = d.querySelectorAll('.remark-code-line-highlighted');
const preParents = [];
const findPreParent = function(line, p = 0) {
if (p > 1) return null; // traverse up no further than grandparent
const el = line.parentElement;
return el.tagName === "PRE" ? el : findPreParent(el, ++p);
};

for (let line of hlines) {
let pre = findPreParent(line);
if (pre && !preParents.includes(pre)) preParents.push(pre);
}
preParents.forEach(p => p.classList.add("remark-code-has-line-highlighted"));
})(document);</script>

<script>
(function() {
var i, text, code, codes = document.getElementsByTagName('code');
slideshow._releaseMath = function(el) {
var i, text, code, codes = el.getElementsByTagName('code');
for (i = 0; i < codes.length;) {
code = codes[i];
if (code.parentNode.tagName !== 'PRE' && code.childElementCount === 0) {
Expand All @@ -437,7 +528,8 @@
}
i++;
}
})();
};
slideshow._releaseMath(document);
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
Expand Down

0 comments on commit 8a0d7c3

Please sign in to comment.