\documentclass[aspectratio=1610]{beamer}
\setbeamertemplate{navigation symbols}{}
\mode<presentation>
{
\usetheme{Montpellier}
\setbeamercovered{invisible}
}
\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.35\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.57\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.08\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
  \end{beamercolorbox}}%
  \vskip0pt%
}
\setbeamertemplate{headline}
{%
  \begin{beamercolorbox}{section in head/foot}
  \insertnavigation{\paperwidth}{}{}\vskip1pt
  \end{beamercolorbox}
}
\addtobeamertemplate{frametitle}{\vspace*{-0.25cm}}{\vspace*{-0.1cm}}

\usepackage[T1]{fontenc}       % Zeichensatz mit deutschen Umlauten
\usepackage[utf8]{inputenc}    % uft8 text-Codierung
% font definitions, try \usepackage{ae} instead of the following
% three lines if you don't like this look
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
\usepackage{verbatim}          % useful for program listings
\usepackage[T1]{fontenc}
\usepackage{tikz,pgfplots}     % Zeichnen in Latex
\pgfplotsset{compat=1.14}
\usetikzlibrary{shapes,arrows} % Tikz
\usetikzlibrary{decorations.pathreplacing}
\usepackage{pgfplotstable}     % tabellen
\usepackage{booktabs}          % Tabellen
%\usepackage{subfig}         % Nebeneinanderstellen von Abbildungen
\usepackage{caption}
\usepackage[list=true, font=large, labelfont=bf, 
labelformat=brace, position=top]{subcaption}
\usepackage[obeyall]{siunitx}  % Einheiten
\usepackage{multimedia}        % use movies in pdf
\usepackage{blindtext}
\usepackage{listings}
\RequirePackage{fix-cm}        % permit Computer Modern fonts at arbitrary sizes

% Custom colors
\usepackage{color}
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}

%Damit wir Quellcode nutzen können.
\usepackage{listings}
\lstset{numbers=left,
	numberstyle=\tiny,
	numbersep=5pt,
	breaklines=true,
	showstringspaces=false,
	frame=l ,
	xleftmargin=15pt,
	xrightmargin=15pt,
	basicstyle=\ttfamily\small,
	stepnumber=1,
	keywordstyle=\color{deepblue},          % keyword style
  	commentstyle=\color{deepred},       % comment style
  	stringstyle=\color{deepgreen}         % string literal style
}

\usepackage[%
backend=biber, style=authoryear, citestyle=authoryear, sorting=none]{biblatex}	% use style = numeric or alphabetic
\addbibresource{bibliography.bib}

\defbibenvironment{bibliography}
  {\list{}
     {\settowidth{\labelwidth}{\usebeamertemplate{bibliography item}}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\rightmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
  {\endlist}
  {\item}
\usepackage{url}

\DefineBibliographyStrings{ngerman}{ 
	andothers = {{et\,al\adddot}},             
}
\setbeamertemplate{caption}{\raggedright\insertcaption\par} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HIER ANPASSEN:
% Thema,
% Vorname und Nachname
% Datum
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Thema XYZ}
\subtitle{Seminar Maschinelles Lernen}
\author{Vorname Nachname}
\date{01. April 2019}

\institute[]{
Universität Duisburg-Essen \\
Fakultät für Informatik \\
Abteilung für Software Engineering \\
Lehrstuhl für Intelligente Systeme
}



\makeatletter
%all circles in navigation in one line
\newcommand*{\compresson}{\addtocontents{nav}{\protect\headcommand{\protect\beamer@compresstrue}}}
\newcommand*{\compressoff}{\addtocontents{nav}{\protect\headcommand{\protect\beamer@compressfalse}}}
\makeatother

\begin{document}

\compresson

\begin{frame}[plain]
\titlepage
\end{frame}

{
\setbeamertemplate{headline}{} %remove headline here
\begin{frame}{Gliederung}
    \tableofcontents
\end{frame}
}

\section{Erster Abschnitt}
\begin{frame}{Erste Folie vom ersten Abschnitt}
    \blinditemize[3]
\end{frame}

\begin{frame}{Zweite Folie vom ersten Abschnitt}
    \blindenumerate[3]
\end{frame}

\section{Zweiter Abschnitt}
\begin{frame}{Erste Folie vom zweiten Abschnitt}
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    \[ \frac{1}{n} \sum \limits_{i=1}^{n} x_{i} = \frac{x_1 + x_2 + \ldots + x_n}{n}\]
\end{frame}


\section{Beispiele und Hinweise}

\begin{frame}{Symbole im Mathematik-Modus}
    \begin{itemize}
       \item gegeben sind Breite $W$ und Höhe $H$ eines Graustufenbildes $b_g$
       \item weiterhin gegeben Anzahl Intensitäten $I$ ($I-1$ entspricht Weiß)
       \item Bild $b_g$ ist eine Funktion $\mathbb{N}^2\rightarrow\mathbb{N}$, genauer
                $\{0,\ldots,W-1\}\times\{0,\ldots,H-1\}\rightarrow\{0,\ldots,I-1\}$
       \item Koordinatenpaar $(x,y)$ beschreibt ein Pixel \\ mit Intensität $b_g(x,y)$
    \end{itemize}
\end{frame}

\begin{frame}{Use jpg or even better png files}
     \includegraphics[height=0.8\textheight]{pics/02_pixel.jpg} 
\end{frame}

\vfuzz=15pt %ignore overfull vbox
\begin{frame}{Vector graphic, exported as pdf with Inkscape}
	\begin{center}
	\begin{figure}
	  \includegraphics[height=0.83\textheight]{pics/diagram}
	  \caption{Main Structure from [\textcite{korn1}]}
	\end{figure}
	\end{center}
\end{frame}

\begin{frame}{Subcaption}
\begin{figure}
\centering
\subcaptionbox{Teilbild 1}{
\includegraphics[width=0.47\textwidth]{pics/plot1.pdf}
} \hfill
\subcaptionbox{Teilbild 2}{
\includegraphics[width=0.47\textwidth]{pics/plot2.pdf}
}
\caption[Kurzbeschreibung von Multiplots]{Beispiel von Plots nebeneinander, die
mit Matlab erstellt wurden \\(Code für die Plots unter \textit{images/makeMatlabPlots.m}).}
\end{figure}
\end{frame}

\begin{frame}{Minipages}
	\begin{center}
	    \begin{minipage}{0.495\textwidth}
	    "Adversarial training is the coolest thing since sliced bread."\\ \tiny{(Yann LeCun, Director of AI Research at Facebook and Professor at NYU)}\\
		    \begin{small}
				Two neural networks play against each other\ldots \\
				\begin{tabular}{|c|}
					\hline
					\textbf{Generative model $G$}\\
					\scriptsize{Input data $\rightarrow$ Learn distribution $\rightarrow$ Generate samples}\\
					\hline
					\multicolumn{1}{c}{vs.} \\
					\hline
					\textbf{Discriminative model $D$} \\
					\scriptsize{Original data or fake by $G$?} \\
					\hline
				\end{tabular}\\
				\ldots and improve over time.
			\end{small}
			\begin{figure}
				\centering
				\includegraphics[width=\textwidth]{pics/GAN_SuperRes.png} \vspace{-0.3cm}
				\caption*{\tiny{Single Image Super Resolution, Source: \cite{Ledig.20170525}}}
			\end{figure}
	    \end{minipage}
	    \begin{minipage}{0.495\textwidth}\vspace{-0.5cm}
			\begin{figure}
				\centering
				\includegraphics[width=\textwidth]{pics/GAN_HiResImgSyn.png} \vspace{-0.3cm}
				\caption*{\tiny{High Resolution Image Synthesis, Source: \cite{Wang.20171130}}}
			\end{figure} \vspace{-1cm}
			\begin{figure}
				\centering
				\includegraphics[width=\textwidth]{pics/GAN_3DModel.png} \vspace{-0.3cm}
				\caption*{\tiny{Single Image 3D reconstruction \& Shape Arithmetics, Source: \cite{Wu.20170104}}}
			\end{figure}
	    \end{minipage}
	\end{center}
\end{frame}

\begin{frame}{Minipage and pause}
\begin{center}
\includegraphics[width=0.86\columnwidth]{pics/sliding_bad2.png}
\end{center}
\vspace{-0.6em}
\pause
  \begin{center}
    \begin{minipage}{0.495\textwidth}
      1. Step:
      \begin{itemize}
      \setlength\itemsep{0.1em}
        \item coarse camera movement estimation
        \item registration of current and previous depth maps
        \item based on previous background correspondences
        \item good performance
      \end{itemize}
    \end{minipage}
% \hspace{1mm} %wichtig, hier keine leerzeile im code
    \begin{minipage}{0.495\textwidth}
    \vspace{-1.5em}
    \pause
            2. Step:
      \begin{itemize}
        \item eigenvalues $\lambda_1 \geq \ldots \geq \lambda_6$ of $A_i^T A_i$
        \item unconstrained degree of freedom if $\frac{\lambda_1}{\lambda_6} > 1000$    %condition number
        \item no update of the object pose during the first five ICP iterations
      \end{itemize}
    \end{minipage}
  \end{center}
\end{frame}

\begin{frame}{Plot basierend auf Textdatei: Evaluating Color Weight (Typical Scene)}
\begin{center}
% Voxel size: 2cm
\begin{tikzpicture}[trim axis left]
    \begin{axis}[grid, width=0.95\linewidth, height=7cm, ymin=0, xmin=-0.003, xmax=0.093, legend pos=north east, legend columns=2, legend cell align=left,
    every x tick scale label/.style={at={(xticklabel cs:1)},anchor=south west, overlay}, xlabel=color weight $\alpha$, cycle list name=exotic, every axis plot/.append style=thick] 
      \addplot+[mark=square*] table[x=weight, y=iterations]{data/colorWeight2.txt};   
      \addplot+[mark=diamond*] table[x=weight, y expr=\thisrow{duration}/100]{data/colorWeight2.txt};
      \addplot+[] table[x=weight, y=translation_error]{data/colorWeight2.txt};
      \addplot+[] table[x=weight, y=rotation_error] {data/colorWeight2.txt};
      \legend{iterations, runtime in \SI{100}{\milli\second}, translation error in \si{\centi\meter} $ \ \ $, rotation error in \si{\degree}}
    \end{axis}    
  \end{tikzpicture}
\end{center}
\end{frame}


% Einstellungen für Balkendiagramm
\usetikzlibrary{pgfplots.groupplots}
\usepgfplotslibrary{patchplots}
\usetikzlibrary{shapes,arrows}

\pgfplotstableset{% global config, for example in the preamble % these columns//.style={} things define a style
	% which applies to  only.
	empty cells with={--}, % replace empty cells with '--'
	every head row/.style={before row=\toprule,after row=\midrule},
	every last row/.style={after row=\bottomrule},
	col sep=&,
	zerofill
}

\pgfplotsset{select coords between index/.style 2 args={
    x filter/.code={
        \ifnum\coordindex<#1\def\pgfmathresult{}\fi
        \ifnum\coordindex>#2\def\pgfmathresult{}\fi
    }
}}

\pgfplotscreateplotcyclelist{myList}{%
	{color=blue!70, mark=*},
	{color=orange!90, mark=square*},
	{color=purple!90, mark=diamond*}}
	
\begin{frame}
\frametitle{Balkendiagramm basierend auf csv-Datei}
  \begin{figure}
  	\centering
  	\begin{tikzpicture}[trim axis left]
  	\begin{axis}[grid, ybar, width=.6\linewidth,
  	xticklabels={Roboter\_komplett,Roboter\_einfach, Roboter\_parallel, Roboter\_rotation, Roboter\_von\_Kamera\_weg, Roboter\_zu\_kamera},
  	x tick label style={
  		rotate=30,
  		anchor=east,
  	},
  	xticklabel shift=4pt,
  	x label style={at={(axis description cs:0.5,-0.25)},anchor=north},
  	xtick={1,2,...,6},
  	xtick align=inside,
  	legend pos=north east, legend columns=1, legend	cell align=left,
  	ylabel=Laufzeit $\lbrack$ms$\rbrack$,
  	xlabel=
  	]
  	\addplot+[] table[x=index, y=AvgTimeCCL]{data/Daten.csv};
  	\addlegendentry{CCL ICP};
  	\addplot+[] table[x=index, y=AvgTimeICP]{data/Daten.csv};
  	\addlegendentry{ICP};  
  	\end{axis}    
  	\end{tikzpicture}
  	\addtolength\abovecaptionskip{-13pt}
  	\caption[Kurzbeschreibung eines CSV-Plots]{Plot aus Daten einer CSV-Datei   
  	(\textit{data/Daten.csv})}
  	\label{fig:evalAlgTimeVergl}
  \end{figure}\end{frame}
  
\begin{frame}
\frametitle{Komplexes Balkendiagramm aus csv-Datei}
%
\begin{figure}
\centering
\begin{tikzpicture}%[trim axis left, trim axis right]
  \begin{axis}[xbar stacked, width=.6\linewidth,
%  yticklabels={complete robot pass, robot frontal to camera, robot towards camera, parallel to image plane, robot rotation, robot away from camera },
yticklabels from table={data/CCLKernelVergl.csv}{dataset_en},
%     x tick label style={
%       rotate=30,
%       anchor=east,
%     },
%     xticklabel shift=4pt,
%     x label style={at={(axis description cs:0.5,-0.25)},anchor=north},
    ymax=6,
    ytick={1,2,...,6},
      x tick label style={
            /pgf/number format/.cd,
                 fixed,
                 fixed zerofill,
                 precision=0,
             /tikz/.cd
         },
     legend style={%legend rows=-1,
     %legend pos=outer north east
     at={(1.43,0.5)},
     font=\small,
     anchor=east
     },
    grid,
    xlabel=total runtime $\lbrack$ms$\rbrack$,
    xlabel absolute, xlabel style={yshift=1.5mm},
%    x filter/.code={\pgfmathparse{#1/600*1000}\pgfmathresult},
    y=-0.42cm,
    bar width=0.22cm,
    enlarge y limits={abs=0.2cm},
    xmax=260
%    enlarge x limits={abs=1.2cm}
    ]
  \addplot+[] table[y=index, x=init]{data/CCLKernelVergl.csv};
  \addlegendentry{Init};
  \addplot+[] table[y=index, x=Scanning]{data/CCLKernelVergl.csv};
  \addlegendentry{Scanning};
  \addplot+[] table[y=index, x=Analysis]{data/CCLKernelVergl.csv};
  \addlegendentry{Analysis};
%  \addplot+[] table[y=index, x=MaxReduce]{data/CCLKernelVergl.csv};
%  \addlegendentry{Largest};
  \addplot+[] table[y=index, x expr={\thisrow{sumEachComponent}+\thisrow{MaxReduce}}]{data/CCLKernelVergl.csv};   
%  \addplot+[] table[y=index, x=sumEachComponent]{data/CCLKernelVergl.csv}; 
  \addlegendentry{Criterion 1};
%  \addplot+[] table[y=index, x=SumReduce]{data/CCLKernelVergl.csv};
  \addplot+[] table[y=index, x expr={\thisrow{calculateAreaX} + \thisrow{calculateAreaY} + \thisrow{SumReduce}}]{data/CCLKernelVergl.csv};
  \addlegendentry{Criteria 2\&3}; 
  \end{axis}
\end{tikzpicture}
\caption{Comparison of the runtimes for six different datasets. Shown is the total runtime over the first 600 frames for selected CUDA kernels (just GPU time).}
\end{figure}
\end{frame}

\begin{frame}{Tabelle aus csv-Datei}
  \begin{table}
  \centering
  	\pgfplotstabletypeset[ % local config, applies only for this table
  	col sep={&}, set decimal separator={,},
  	columns={col1, AvgTimeCCL,  AvgTimeICP },
  	columns/col1/.style={string type, column type=c, column name=Szene},
  	columns/AvgTimeCCL/.style={fixed zerofill, precision=3, column name=Laufzeit CCL},
  	columns/AvgTimeICP/.style={fixed zerofill, precision=3, column name=Laufzeit ICP},
  	%skip rows between index={8}{40} %, skip rows between index={7}{9}
  	]
  	{data/Daten.csv}
  	\caption{Daten aus CSV-Datei (\textit{data/Daten.csv}) geladen}
  	\label{tab:evalAlgTimeVergl}
  \end{table}
\end{frame}

\newcommand{\scr}[1]{\scriptsize #1}
\begin{frame}{Komplexe Tabelle}
  \makebox[\linewidth]{%  
  \small
  \begin{tabular}{c|cc|cc|cc}   %{|p{10cm}|p{5cm}|}
%    \toprule % \newcommand{\scr}[1]{\scriptsize #1}
    voxel grid & \multicolumn{2}{c}{iterations} & \multicolumn{2}{c}{runtime (\si{\milli\second})} & \multicolumn{2}{c}{error (\si{\centi\metre} /
    \si{\degree})}  \\  [-4pt]
    cell size (\si{\centi\metre}) & \scr{GICP} & \scr{color GICP} & \scr{GICP} & \scr{color GICP} & \scr{GICP} & \scr{color GICP} \\ [-2pt]
    \multicolumn{7}{l}{\scriptsize{freiburg2\_desk with 1977 pairs and 1s offset \hrulefill}} \\ [-3pt]% & \midrule
    - & 17.05 & 11.85 & 15544 & 22501 & 8.590 / 2.984 & 4.105 / 1.707 \\
    2 & 7.90 & 5.79 & 322  & 444 & 4.093 / 1.244 & 2.290 / 0.907 \\
    3 & 7.13 & 5.52 & 136 & 176 & 3.876 / 1.167 & 2.520 / 0.992 \\
    \multicolumn{7}{l}{\scriptsize{freiburg1\_room with 1323 pairs and 1/3s offset \hrulefill}} \\ [-3pt] % & \midrule
    - & 17.54 & 14.50 & 40797 & 72732 & 14.987 / 5.543 & 11.047 / 4.443 \\ 
    2 & 11.54 & 9.56 & 479 & 770 & 14.963 / 4.559 & 10.801 / 3.225 \\ 
    3 & 10.85 & 8.92 & 176 & 256 & 15.079 / 4.348 & 10.713 / 3.238 
  \end{tabular}
}
\end{frame}

\begin{frame}[fragile]{Quellcode}
Some Python code:
\begin{lstlisting}[language=python]
# Imports
import numpy as np
import tensorflow as tf
\end{lstlisting}
Some MATLAB code:
\lstinputlisting[language=Matlab, firstline=5, lastline=7]{source/makeMatlabPlots.m}
\end{frame}

\section{Referenzen}
\nocite{*} % Adds all references in bib-file to the bibliography
\begin{frame}[allowframebreaks]{Referenzen}
\printbibliography[heading=none]
\end{frame}


\end{document}
