Skip to content

Commit

Permalink
CNN Intro
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Thoma committed Feb 10, 2019
1 parent 551102b commit 49b8552
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 6 deletions.
Binary file added presentations/CNN-Intro/CNN-Intro.pdf
Binary file not shown.
93 changes: 88 additions & 5 deletions presentations/CNN-Intro/CNN-Intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
\usepackage[utf8]{inputenc} % this is needed for german umlauts
\usepackage[english]{babel} % this is needed for german umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{caption}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.text}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{shapes.multipart, calc}
\usepackage{minted} % needed for the inclusion of source code

\begin{document}

Expand Down Expand Up @@ -107,13 +109,94 @@

\section{Applications}
\begin{frame}{Symbol recognizer}
\begin{center}
\href{http://write-math.com}{write-math.com}
\end{center}
\begin{figure}[ht]
\centering
\includegraphics[width=0.8\paperwidth, height=0.7\paperheight, keepaspectratio]{graphics/symbol-recognizer.png}
\captionsetup{labelformat=empty}
\caption{\href{http://write-math.com}{write-math.com}}
\end{figure}
\end{frame}

\begin{frame}{Symbol recognizer}
GANs
\begin{frame}{}
\inputminted[linenos,
numbersep=7pt,
gobble=0,
% frame=none,
% framesep=2mm,
fontsize=\footnotesize, tabsize=4]{python}{cnn.py}
\end{frame}

\begin{frame}{Super Resolution}
\begin{figure}[ht]
\centering
\includegraphics[width=0.8\paperwidth, height=0.7\paperheight, keepaspectratio]{graphics/pixel-recursive-super-resolution.png}
\captionsetup{labelformat=empty}
\caption{Dahl, Norouzi, Shlens: Pixel recursive super resolution (2017)}
\end{figure}
\end{frame}


\begin{frame}{Colorization: The Problem}
\begin{figure}[ht]
\centering
\includegraphics[width=0.8\paperwidth, height=0.7\paperheight, keepaspectratio]{graphics/multimodality-apple.png}
\captionsetup{labelformat=empty}
\caption{Cinarel: Automatic Colorization of Webtoons Using Deep Convolutional Neural Networks (2018)}
\end{figure}

Interactive Demo: \href{http://richzhang.github.io/colorization/}{richzhang.github.io/colorization}
\end{frame}


\begin{frame}{Colorization - Photographs}
\begin{figure}[ht]
\centering
\includegraphics[width=0.8\paperwidth, height=0.7\paperheight, keepaspectratio]{graphics/colorful-image-colorization.png}
\captionsetup{labelformat=empty}
\caption{Zhang, Isola, Efros: Colorful Image Colorization (2016)}
\end{figure}

Interactive Demo: \href{http://richzhang.github.io/colorization/}{richzhang.github.io/colorization}
\end{frame}


\begin{frame}{Colorization - Comic}
\begin{figure}[ht]
\centering
\includegraphics[width=0.8\paperwidth, height=0.7\paperheight, keepaspectratio]{graphics/comic-colorization.png}
\captionsetup{labelformat=empty}
\caption{Ci, Ma, Wang, Li, Luo: User-Guided Deep Anime Line Art Colorization with Conditional Adversarial Networks (2018)}
\end{figure}
\end{frame}

\begin{frame}{Denoising}
\begin{figure}[ht]
\centering
\includegraphics[width=0.8\paperwidth, height=0.7\paperheight, keepaspectratio]{graphics/denoising.png}
\captionsetup{labelformat=empty}
\caption{Zhang, Zuo, Gu, Zhang: Learning Deep CNN Denoiser Prior for Image Restoration (2017)}
\end{figure}
\end{frame}


\begin{frame}{Image Inpainting (Watermark removal)}
\begin{figure}[ht]
\centering
\includegraphics[width=0.8\paperwidth, height=0.7\paperheight, keepaspectratio]{graphics/leopard-inpainting.png}
\captionsetup{labelformat=empty}
\caption{Yang, Lu, Lin, Shechtman, Wang, Li: High-Resolution Image Inpainting using Multi-Scale Neural Patch Synthesis (2017)}
\end{figure}
\end{frame}


\begin{frame}{CNNs in NLP}
\begin{figure}[ht]
\centering
\includegraphics[width=0.8\paperwidth, height=0.7\paperheight, keepaspectratio]{graphics/tdnns.png}
\captionsetup{labelformat=empty}
\caption{Collobert, Weston, Bottou, Karlen, Kavukcuoglu, Kuksa:
Natural Language Processing (almost) from Scratch (2011)}
\end{figure}
\end{frame}

\end{document}
2 changes: 1 addition & 1 deletion presentations/CNN-Intro/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SOURCE = CNN-Intro

make:
pdflatex $(SOURCE).tex -output-format=pdf
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
make clean

clean:
Expand Down
19 changes: 19 additions & 0 deletions presentations/CNN-Intro/cnn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import data

from keras.layers import Dense, Flatten, Conv2D, MaxPooling2D
from keras.models import Sequential, load_model

model = Sequential()
model.add(Conv2D(16, (3, 3)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(16, (3, 3)))
model.add(Flatten())
model.add(Dense(128, activation='relu'))
model.add(Dense(data.n_classes, activation='softmax'))

model.compile(loss='categorical_crossentropy', optimizer='adam')
model.fit(data.x_train, data.y_train)

model.save('model.h5')
model = load_model('model.h5')
y_predicted = model.predict(data.x_test)

0 comments on commit 49b8552

Please sign in to comment.