diff --git a/.gitignore b/.gitignore index 8417c29..891e5c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,15 @@ # LaTeX build files *.aux +*.bbl +*.bcf +*.blg *.eps *.fdb_latexmk *.fls *.log *.nav *.out +*.run.xml *.snm *.toc diff --git a/index.html b/index.html index 183098d..b790151 100644 --- a/index.html +++ b/index.html @@ -20,6 +20,7 @@ ✓information technologyLaser in optischen LaufwerkenSuchmaschine + ✓Machine Learning diff --git a/latex/assets/bibimage.pdf b/latex/assets/bibimage.pdf new file mode 100644 index 0000000..ec26938 Binary files /dev/null and b/latex/assets/bibimage.pdf differ diff --git a/latex/assets/custombeamer.cls b/latex/assets/custombeamer.cls new file mode 100644 index 0000000..006338d --- /dev/null +++ b/latex/assets/custombeamer.cls @@ -0,0 +1,23 @@ +% vim: set ft=tex +\PassOptionsToPackage{pdfencoding=auto}{hyperref} +\ProvidesClass{custombeamer} + +\LoadClass[aspectratio=1610]{beamer} +\usetheme[nofirafonts]{focus} +\usefonttheme[onlymath]{serif} + +\RequirePackage{fontspec} +\setsansfont{Fira Sans} +\setmonofont{Iosevka sbruder} + +\setbeamertemplate{bibliography item}{% + \ifboolexpr{ test {\ifentrytype{book}} or test {\ifentrytype{mvbook}} + or test {\ifentrytype{collection}} or test {\ifentrytype{mvcollection}} + or test {\ifentrytype{reference}} or test {\ifentrytype{mvreference}} } + {\setbeamertemplate{bibliography item}[book]} + {\ifentrytype{image} + {\setbeamertemplate{bibliography item}{\includegraphics[width=1.5em]{../assets/bibimage}}} + {\ifentrytype{online} + {\setbeamertemplate{bibliography item}[online]} + {\setbeamertemplate{bibliography item}[article]}}}% + \usebeamertemplate{bibliography item}} diff --git a/latex/machine-learning/captcha.png b/latex/machine-learning/captcha.png new file mode 100644 index 0000000..1c0939b Binary files /dev/null and b/latex/machine-learning/captcha.png differ diff --git a/latex/machine-learning/custombeamer.cls b/latex/machine-learning/custombeamer.cls new file mode 120000 index 0000000..842b8eb --- /dev/null +++ b/latex/machine-learning/custombeamer.cls @@ -0,0 +1 @@ +../assets/custombeamer.cls \ No newline at end of file diff --git a/latex/machine-learning/im-not-a-robot.png b/latex/machine-learning/im-not-a-robot.png new file mode 100644 index 0000000..2ad5cfa Binary files /dev/null and b/latex/machine-learning/im-not-a-robot.png differ diff --git a/latex/machine-learning/index.pdf b/latex/machine-learning/index.pdf new file mode 100644 index 0000000..9c90c9b Binary files /dev/null and b/latex/machine-learning/index.pdf differ diff --git a/latex/machine-learning/index.tex b/latex/machine-learning/index.tex new file mode 100644 index 0000000..a296b32 --- /dev/null +++ b/latex/machine-learning/index.tex @@ -0,0 +1,194 @@ +\PassOptionsToPackage{table}{xcolor} +\documentclass[aspectratio=1610, theme=focus]{custombeamer} +%\usetheme{focus} + +\usepackage[ngerman]{babel} + +\usepackage{biblatex} +\nocite{*} +\addbibresource{sources.bib} + +\usetikzlibrary{decorations.pathreplacing, positioning} + +\usepackage[thinlines]{easytable} + +\title{Machine Learning} +\subtitle{Eine Einführung} +\author{Simon Bruder} +%\titlegraphic{\includegraphics[scale=1.25]{focuslogo.pdf}} +\institute{Christian-von-Bomhard-Schule} +\usepackage{datetime} +\newdate{date}{09}{07}{2019} +\date{\displaydate{date}} + +\begin{document} + \begin{frame} + \maketitle + \end{frame} + + \begin{frame}[noframenumbering] + \tableofcontents + \end{frame} + + \section{Einsatzgebiete} + \begin{frame}{Einsatzgebiete} + \begin{itemize} + \item{Computerspiele-»KI«} + \item{Medizinische Diagnostik} + \item{Personalisierte Werbung} + \item{Selbstfahrende Autos} + \item{Spracherkennung} + \end{itemize} + \end{frame} + + \section{Praxis: Tic Tac Toe} + \begin{frame}{Tic Tac Toe} + \begin{minipage}[t]{.5\textwidth} + \textbf{Lernen} + \begin{itemize} + \item{Computer weiß nur, wann das Spiel gewonnen ist} + \item{\textbf{Generator} gibt zufällige Züge zurück} + \item{Wenn gewonnen: \textbf{Diskriminator} wertet Züge von Gewinner auf, Züge von Verlierer ab} + \end{itemize} + \end{minipage}% + \begin{minipage}[t]{.5\textwidth} + \textbf{Anwenden} + \begin{itemize} + \item{\textbf{Generator} weiß für jede Spielsituation, wie erfolgreich ein Zug ist} + \item{Erfolgreichster Zug wird ausgeführt} + \item{→ Immer Gewinn oder Unentschieden} + \end{itemize} + \end{minipage} + + \vspace{1em} + \renewcommand*{\o}{$\pmb\bigcirc$} + \newcommand*{\x}{$\pmb\times$} + \begin{center} + \pause + \ttfamily\begin{TAB}(e,1em,1em){|c|c|c|}{|c|c|c|} + \x & \o & \x \\ + 1 & \o & 0 \\ + \x & 0.5 & \o \\ + \end{TAB} \\ + X am Zug + \end{center} + \end{frame} + + \section{Theorie: Neuronale Netzwerke} + \begin{frame}{Neuronale Netzwerke: Eingabe} + \begin{center} + \begin{tikzpicture} + \onslide<+>\node[] (traffic light) {\includegraphics[height=.75\textheight]{traffic-light-ryg}}; + \onslide<+->\node[] (traffic light) {\includegraphics[height=.75\textheight]{traffic-light-ryg-gray}}; + \onslide<+-> + \draw[decoration={brace, raise=1pt, amplitude=5pt}, decorate] (traffic light.north west) -- node[above=5pt] (width) {$25$} (traffic light.north east); + \draw[decoration={brace, mirror, raise=1pt, amplitude=5pt}, decorate] (traffic light.south east) -- node[right=5pt] (height) {$75$} (traffic light.north east); + \onslide<+-> + \node[right=5 of traffic light.north east] (input) {$25 \cdot 75 = 1875$}; + \draw[->, thick] (traffic light.north east) ++ (0.25,0) -- (input); + \onslide<+-> + \node[below=1em of input] (values) {$[0 .. 255]$ → $[0, 1]$}; + \node[below=1em of values] {\includegraphics[width=.33\textwidth]{traffic-light-ryg-gray-values}}; + \onslide<1-> % I don’t use reveal because I have to do ugly hacks there … wait what? + \end{tikzpicture} + \end{center} + \end{frame} + + \begin{frame}{Neuronale Netzwerke} + % stolen from https://tex.stackexchange.com/a/153974 + \tikzset{% + every neuron/.style={ + circle, + draw, + minimum size=1cm + }, + neuron missing/.style={ + draw=none, + scale=4, + text height=0.333cm, + execute at begin node=\color{black}$\vdots$ + }, + } + + \begin{tikzpicture}[x=2.4cm, y=1.5cm, >=stealth, font=\sffamily] + + \foreach \m/\l [count=\y] in {1,2,3,missing,4} + \node [every neuron/.try, neuron \m/.try] (input-\m) at (0,2.5-\y) {}; + + \foreach \m [count=\y] in {1,missing,2} + \node [every neuron/.try, neuron \m/.try ] (hidden-\m) at (2,2-\y*1.25) {}; + + \foreach \m [count=\y] in {1,2,3} + \node [every neuron/.try, neuron \m/.try ] (output-\m) at (4,1.5-\y) {}; + + \foreach \l [count=\i] in {1,2,3,1875} + \draw [<-] (input-\i) -- ++(-1,0) + node [above, midway] {$I_{\l}$}; + + \foreach \l [count=\i] in {1,n} + \node [above] at (hidden-\i.north) {$H_\l$}; + + \foreach \l [count=\i] in {1,2,3} + \draw [->] (output-\i) -- ++(1,0) + node [above, midway] {$O_\l$}; + + \foreach \i in {1,...,4} + \foreach \j in {1,...,2} + \draw [->] (input-\i) -- (hidden-\j); + + \foreach \i in {1,...,2} + \foreach \j in {1,...,3} + \draw [->] (hidden-\i) -- (output-\j); + + \foreach \l [count=\x from 0] in {Input, Hidden, Output} + \node [align=center, above] at (\x*2,1.9) {\l \\ layer}; + + \end{tikzpicture} + \end{frame} + + \begin{frame}{Graphische Demo} + \href{https://playground.tensorflow.org/\#activation=tanh&batchSize=10&dataset=gauss®Dataset=reg-plane&learningRate=0.03®ularizationRate=0&noise=0&networkShape=4,2&seed=0.90019&showTestData=false&discretize=false&percTrainData=50&x=true&y=true&xTimesY=false&xSquared=false&ySquared=false&cosX=false&sinX=false&cosY=false&sinY=false&collectStats=false&problem=classification&initZero=false&hideText=false&discretize_hide=true&numHiddenLayers_hide=true®ularizationRate_hide=true&learningRate_hide=true&batchSize_hide=true&dataset_hide=true®ularization_hide=true&noise_hide=true&problem_hide=true&activation_hide=true&showTestData_hide=false&percTrainData_hide=false}{playground.tensorflow.org} + \end{frame} + + \section{Training in der Praxis} + \begin{frame}{Training} + \pause\begin{minipage}[t]{.30\textwidth} + \textbf{Computer trainiert sich selbst} + + \begin{itemize} + \item{Diskriminator hat Regelwerk vorliegen} + \item{In zufälliger Generation ist auch ein richtiges Ergebnis vorhanden} + \item{Funktioniert gut für Spiele} + \end{itemize} + \end{minipage}\hfill% + \pause\begin{minipage}[t]{.30\textwidth} + \textbf{Entwickelnde Menschen als Diskriminator} + + \begin{itemize} + \item{Menschen geben Eingabe und gewünschte Ausgabe vor} + \item{Teilweise existieren schon Datensätze} + \item{Arbeitsaufwändig/Teuer} + \end{itemize} + \end{minipage}\hfill% + \pause\begin{minipage}[t]{.30\textwidth} + \includegraphics[height=.1\textheight]{im-not-a-robot} \\ + \includegraphics[height=.7\textheight]{captcha} + \end{minipage}% + \end{frame} + + \appendix + \begin{frame}{Quellen} + \printbibliography[heading=none] + \end{frame} + + \begin{frame}[focus] + Nicht ganz verstanden? \\ + Fragen? + \end{frame} + + \begin{frame}{Bonus/Weiterführende Informationen} + \begin{itemize} + \item{Videoserie: \href{https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi}{3Blue1Brown: Neural networks}} + \end{itemize} + \end{frame} +\end{document} diff --git a/latex/machine-learning/sources.bib b/latex/machine-learning/sources.bib new file mode 100644 index 0000000..61ef5f2 --- /dev/null +++ b/latex/machine-learning/sources.bib @@ -0,0 +1,5 @@ +@image{Commons:TrafficLight, + author = "Petey21", + title = "File:Led traffic lights.jpg", + url = "https://commons.wikimedia.org/wiki/File:Led_traffic_lights.jpg" +} diff --git a/latex/machine-learning/traffic-light-ryg-gray-values.png b/latex/machine-learning/traffic-light-ryg-gray-values.png new file mode 100644 index 0000000..5563120 Binary files /dev/null and b/latex/machine-learning/traffic-light-ryg-gray-values.png differ diff --git a/latex/machine-learning/traffic-light-ryg-gray-values.svg b/latex/machine-learning/traffic-light-ryg-gray-values.svg new file mode 100644 index 0000000..1d642d1 --- /dev/null +++ b/latex/machine-learning/traffic-light-ryg-gray-values.svg @@ -0,0 +1,927 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/latex/machine-learning/traffic-light-ryg-gray.png b/latex/machine-learning/traffic-light-ryg-gray.png new file mode 100644 index 0000000..473a82d Binary files /dev/null and b/latex/machine-learning/traffic-light-ryg-gray.png differ diff --git a/latex/machine-learning/traffic-light-ryg.png b/latex/machine-learning/traffic-light-ryg.png new file mode 100644 index 0000000..92689c6 Binary files /dev/null and b/latex/machine-learning/traffic-light-ryg.png differ