tutorial.tex 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. \documentclass[a4paper]{scrreprt}
  2. \usepackage[utf8x]{inputenc}
  3. \usepackage[OT1]{fontenc}
  4. \usepackage[ngerman]{babel}
  5. \selectlanguage{ngerman}
  6. \usepackage{graphicx}
  7. \usepackage{geometry}
  8. \geometry{top=25mm,bottom=25mm,left=30mm,right=25mm}
  9. \usepackage{setspace}
  10. \onehalfspacing
  11. \usepackage{color}
  12. \usepackage{amsmath}
  13. \usepackage{amssymb}
  14. \usepackage[pdfpagelabels]{hyperref}
  15. \hypersetup{colorlinks=false,pdfborder= 0 0 0}
  16. \usepackage{booktabs}
  17. \include{notations}
  18. % define everything for a nice header
  19. \usepackage{scrpage2}
  20. \pagestyle{scrheadings}
  21. % header also on first page of new chapter
  22. \renewcommand*{\chapterpagestyle}{scrheadings}
  23. % font of header
  24. \renewcommand{\headfont}{\normalfont}
  25. % header
  26. \ihead{\includegraphics[width=0.1\linewidth]{img/hanfried-en-blue}}
  27. \chead{}
  28. \ohead{\includegraphics[width=0.3\linewidth]{img/fsuText-en}}
  29. \setlength{\headheight}{21mm} % height of header
  30. \title{Tutorial for GP-HIK-CORE}
  31. \author{Alexander Freytag, Erik Rodner \\ \url{firstname.lastname@uni-jena.de}}
  32. \setlength{\itemsep}{-0.5em}
  33. \newcommand{\confSection}[1]{\textit{Section: } #1}
  34. \newcommand{\variable}[1]{\textit{Variable: } #1}
  35. \newcommand{\variableType}[1]{\textit{Type: } #1}
  36. \newcommand{\default}[1]{\textit{Default: } #1}
  37. \newcommand{\infos}[4]{
  38. \begin{itemize}
  39. \setlength{\itemsep}{-0.5em}
  40. \item \confSection{#1}
  41. \item \variable{#2}
  42. \item \variableType{#3}
  43. \item \default{#4}
  44. \end{itemize}
  45. }
  46. \definecolor{darkred}{rgb}{0.5,0,0}
  47. \begin{document}
  48. \maketitle
  49. \setlength{\parindent}{0pt}
  50. \renewcommand{\chaptername}{chapter}
  51. \chapter{Preface}
  52. \label{chap:Preface}
  53. This document shall help to quickly use the modul gp-hik-core\footnote{\url{https://github.com/cvjena/gp-hik-core}} of our library NICE\footnote{\url{https://github.com/cvjena/nice-core}}.
  54. It is structured as follows:
  55. \paragraph{Chapter~\ref{chap:SetUp}: How to set-up the library} We briefly explain things to be regarded while setting up our library.
  56. \paragraph{Chapter~\ref{chap:ParamConfig}: Parameters and Configurations}
  57. In \chaptername~\ref{chap:ParamConfig} we give an overview of the majority of built-in parameters, explain their influence briefly and present default settings.
  58. \paragraph{Chapter~\ref{chap:DemoProgs}: Demo-Programs and how to use them}
  59. In \chaptername~\ref{chap:DemoProgs} we introduce some demo programs we created to show how to switch between some parameter settings.
  60. %--------------- setup --------------------
  61. \chapter{Setting up the library}
  62. \label{chap:SetUp}
  63. \textbf{Step 1: Obtain our main library}\newline
  64. \texttt{git clone https://github.com/cvjena/nice-core.git}
  65. \vspace{2em}
  66. \textbf{Step 2: configure everything}\newline
  67. \texttt{cd nice-core/} \newline
  68. \texttt{source setenv.sh}
  69. \vspace{2em}
  70. \textbf{Step 3: Obtain the gp-hik-core module}\newline
  71. \texttt{git clone https://github.com/cvjena/gp-hik-core.git}
  72. \vspace{2em}
  73. \textbf{Step 4: Build everything}\newline
  74. \texttt{cd cd gp-hik-core/} \newline
  75. \texttt{make}
  76. \vspace{2em}
  77. \textbf{Step 5: Verify that everything works properly}\newline
  78. \texttt{make check}
  79. %--------------- parameter configs --------------------
  80. \chapter{Parameter Configurations}
  81. \label{chap:ParamConfig}
  82. \section{Classification in general}
  83. \paragraph{Specify the interative linear solver}
  84. \infos{GPHIKClassifier}{ils\_method}{string}{CG}
  85. \begin{tabular}{ll}
  86. \textbf{Setting} & \textbf{Explanation} \\
  87. CG & the conjugate gradients method\\
  88. CGL & the conjugate gradients method using Lanczos process \\
  89. SYMMLQ & the symmetric LQ (SYMMLQ) method using Lanczos process\\
  90. MINRES & the minimum residual method using Lanczos process \\
  91. \end{tabular}
  92. \paragraph{Specify the optimization method}
  93. \infos{GPHIKClassifier}{optimization\_method}{string}{greedy}
  94. \begin{tabular}{ll}
  95. \textbf{Setting} & \textbf{Explanation} \\
  96. greedy & greedy 1D search in a pre-defined range\\
  97. downhillsimplex & DHS in multiple dimensions \\
  98. none & no optimization at all\\
  99. \end{tabular}
  100. \section{Classification with Quantization}
  101. \paragraph{(De-)Activate the Quantization}
  102. \infos{GPHIKClassifier}{use\_quantization}{bool}{false}
  103. \paragraph{Specify precision of quantization}
  104. \infos{GPHIKClassifier}{num\_bins}{integer}{$100$}
  105. \section{Uncertainty Prediction}
  106. \paragraph{Activate or de-active the computation of predictive uncertainties}
  107. \infos{GPHIKClassifier}{uncertaintyPredictionForClassification}{bool}{false}
  108. \paragraph{Specify how to compute predictive uncertainties}
  109. \infos{GPHIKClassifier}{varianceApproximation}{string}{approximate\_fine}
  110. \begin{tabular}{ll}
  111. \textbf{Setting} & \textbf{Explanation} \\
  112. approximate\_rough & use the RAPU method (perhaps with quantization, see our ACCV'12 paper)\\
  113. approximate\_fine & use the FAPU method \\
  114. exact & use the PUP method\\
  115. none & deactivate the computation \\
  116. \end{tabular}
  117. \section{Various}
  118. %
  119. \paragraph{Generalizations of HIK}
  120. \infos{GPHIKClassifier}{transform}{string}{absexp}
  121. \begin{tabular}{ll}
  122. \textbf{Setting} & \textbf{Explanation} \\
  123. absexp & absolute value and exponential operation -- pow(fabs(x), exponent)\\
  124. exp & exponential operation -- exp(fabs(x), exponent)\\
  125. MKL & weights for Multiple Kernel Learning approach\\
  126. WeightedDim & weights for each dimension\\
  127. \end{tabular}
  128. \paragraph{Useful Output}
  129. \infos{GPHIKClassifier}{verbose}{bool}{false}
  130. \paragraph{Computation Time Output}
  131. \infos{GPHIKClassifier}{verboseTime}{bool}{false}
  132. \paragraph{Useful Debug Output}
  133. \infos{GPHIKClassifier}{debug}{bool}{false}
  134. \section{GP related settings}
  135. \paragraph{Set the GP noise for model regularization}
  136. \infos{GPHIKClassifier}{noise}{double}{$0.01$}
  137. \paragraph{(De-)Activate balanced learning}
  138. \infos{GPHIKClassifier}{learn\_balanced}{bool}{false}
  139. \paragraph{(De-)Activate aumatic determination of noise}
  140. \infos{GPHIKClassifier}{optimize\_noise}{bool}{false}
  141. % \chapter{Class Structure}
  142. \chapter{Demo Programs}
  143. \label{chap:DemoProgs}
  144. \section{Toy Example for Classification}
  145. A simple toy example with synthetic data can be run with the program \texttt{toyExample}. You may call the program with a default configuration via
  146. \texttt{../BUILD\_x86\_64/gp-hik-core/progs/toyExample -config ./configs/toyExample.conf}.
  147. \paragraph{Usage and Accuracies}
  148. This program uses synthetic data of $3$ classes with $49$ dimensions. For training, $20$ examples per class are used, whereas we provide $50$ examples per class for testing.
  149. Without any changes, you should obtain an accuracy of $99.33\%$. If you activate the quantization approach (either in the config file or via
  150. \texttt{-GPHIKClassifier:use\_quantization true}) the accuracy drops to $89.33\%$ since the sampled features cover small ranges in the input space. However,
  151. when increasing the number of quantization steps to $1,000$, the resulting accuracy is again $99.33\%$.
  152. \paragraph{Quantization: Runtimes and Memory}
  153. When switching between with and without quantization, you should notice the differences in resulting runtimes. On our computer (single core, $3.4$GHz),
  154. we obtain the following results:
  155. \begin{center}
  156. \begin{tabular}{ccccc}
  157. \textbf{Quantization} & \textbf{Training [s]} & \textbf{Testing [s]} & \textbf{Memory [kB]} & \textbf{Accuracy [\%]}\\
  158. \hline
  159. no & $5.06$ & $0.19$ & $26,228$ & $99.33$\\
  160. yes, $100$ & $5.09$ & $0.01$ & $26,488$ & $89.33$ \\
  161. yes, $1,000$ & $5.13$ & $0.01$ & $27,540$ & $99.33$ \\
  162. \end{tabular}
  163. \end{center}
  164. \section{Evaluation of Fast Min Kernel}
  165. \begin{itemize}
  166. \item Name of Program
  167. \begin{itemize}
  168. \item[ ] \texttt{completeEvaluationFastMinkernel}
  169. \end{itemize}
  170. \item Input:
  171. \begin{itemize}
  172. \item[\texttt{-n}] number of examples
  173. \item[\texttt{-d}] number of dimensions
  174. \item[\texttt{-v}] additional output
  175. \end{itemize}
  176. \item Usage: three main parts
  177. \begin{enumerate}
  178. \item initialization (FMK vs. computation of $\kernelMatrix$)
  179. \item kernel multiplication $\kernelMatrix \cdot \alpha $
  180. \item kernel sum $\kernelVector^T \cdot \alpha $
  181. \end{enumerate}
  182. \end{itemize}
  183. \chapter{Closing words}
  184. This library was built to provide a fast and memory efficient possibility for bayesian inference in large-scale scenarios.
  185. The algorithms are published in the following papers.
  186. \vspace{1em}
  187. Large-scale classification (training, optimization, testing):
  188. \begin{itemize}
  189. \item \textbf{Large-Scale Gaussian Process Classification with Flexible Adaptive Histogram Kernels} by \textit{Erik Rodner and Alexander Freytag and Paul Bodesheim and Joachim Denzler} (ECCV 2012. 85--98) and
  190. \end{itemize}
  191. Rapid uncertainty computation, incremental and active learning:
  192. \begin{itemize}
  193. \item \textbf{Rapid Uncertainty Computation with Gaussian Processes and Histogram Intersection Kernels} by \textit{Alexander Freytag and Erik Rodner and Paul Bodesheim and Joachim Denzler} (ACCV 2012. ), which was awarded with the \textcolor{darkred}{\bf ``Best paper honorable mention''}.
  194. \end{itemize}
  195. In case of any problems or suggestions for improvement, don't hesitate to contact us.
  196. \vspace{10em}
  197. \begin{center}
  198. \includegraphics[width=0.5\linewidth]{img/logoV2blue}
  199. \end{center}
  200. \end{document}