main.tex.bak 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. % ------------------------------------------------------------------------
  2. \documentclass{llncs}
  3. \input{prelude}
  4. \begin{document}
  5. \title{Star Discrepancies for generalized Halton points}
  6. % \titlerunning{} % abbreviated title (for running head)
  7. % also used for the TOC unless
  8. % \toctitle is used
  9. \author{Thomas Espitau\inst{1} \and Olivier Marty\inst{1}}
  10. %
  11. % \authorrunning{} % abbreviated author list (for running head)
  12. %
  13. %%%% list of authors for the TOC (use if author list has to be modified)
  14. % \tocauthor{}
  15. %
  16. \institute{
  17. $\mbox{}^1$ ENS Cachan \qquad
  18. }
  19. \maketitle
  20. \makeatletter
  21. \makeatother
  22. \begin{abstract}
  23. \end{abstract}
  24. \section{Introduction}
  25. \section{General architecture of the tool}
  26. The testing tool is aimed to be modular: it is made of independents blocks that
  27. are interfaced trough a scheduler. More precisely a master wrapper is written
  28. in Python that calls a first layer which performs the chosen heuristic. This
  29. layer is written in C++ for performances. The given discrepancy algorithm
  30. --- written in C --- is called when evaluations of a state is needed.
  31. The wrapper dispatch the computations on the multi-core architecture of
  32. modern computers\footnote{for us, between 2 and 4 physical cores and 4 or 8
  33. virtual cores}. This basic architecture is described in figure~\ref{main_flow}.
  34. Experiments were conducted on two machines:
  35. \begin{itemize}
  36. \item 2.4 GHz Intel Dual Core i5 hyper-threaded to 2.8GHz, 8 Go 1600 MHz DDR3.
  37. \item 2.8 GHz Intel Quad Core i7 hyper-threaded to 3.1GHz, 8 Go 1600 MHz DDR3.
  38. \end{itemize}
  39. \begin{figure}
  40. \includegraphics[scale=0.6]{main_flow.pdf}
  41. \caption{Tool overview}
  42. \label{main_flow}
  43. \end{figure}
  44. On these machines, some basic profiling has make clear that
  45. the main bottleneck of the computations is hiding in the \emph{computation
  46. of the discrepancy}. The chosen algorithm and implantation of this
  47. cost function is the DEM-algorithm of \emph{Magnus Wahlstr\o m}.\medskip
  48. All the experiments has been conducted on dimension 2,3,4
  49. --- with a fixed Halton basis 7, 13, 29, 3 ---. Some minor tests have
  50. been made in order to discuss the dependency of the discrepancy and
  51. efficiency of the heuristics with regards to the values chosen for the
  52. prime base. The average results remains roughly identical when taking
  53. changing these primes and taking them in the range [2, 100]. For such
  54. a reason we decided to pursue the full computations with a fixed
  55. basis.
  56. \subsection{Algorithmic insights}
  57. To perform an experiment we made up a
  58. loop above the main algorithm which calls the chosen heuristic multiple
  59. times in order to smooth up the results and obtain more exploitable datas.
  60. Then an arithmetic mean of the result is performed on the values. In addition
  61. extremal values are also given in order to construct error bands graphs.
  62. A flowchart of the conduct of one experiment is described in the
  63. flowchart~\ref{insight_flow}. The number of iteration of the heuristic is
  64. I and the number of full restart is N. Th function Heuristic() correspond to
  65. a single step of the chosen heuristic. We now present an in-depth view of
  66. the implemented heuristics.
  67. \begin{figure}
  68. \begin{mdframed}
  69. \includegraphics[scale=0.4]{insight.pdf}
  70. \caption{Flowchart of a single experiment}
  71. \label{insight_flow}
  72. \end{mdframed}
  73. \end{figure}
  74. Graph are presentd not with the usual "mustache boxes" to show the
  75. error bounds, but in a more graphical way with error bands. The graph
  76. of the mean result is included inside a band of the same color which
  77. represents the incertitude with regards to the values obtained.
  78. \section{Heuristics developed}
  79. \subsection{Fully random search (Test case)}
  80. The first heuristic implemented is the random search. We generates
  81. random sets of Halton points and select the best set with regard to its
  82. discrepancy iteratively. The process is wrapped up in the
  83. flowchart~\ref{random_flow}. In order to generate at each step a random
  84. permutation, we transform it directly from the previous one.
  85. More precisely the permutation is a singleton object which have method
  86. random, built on the Knuth Fisher Yates shuffle. This algorithm allows
  87. us to generate an uniformly chosen permutation at each step. We recall
  88. this fact and detail the algorithm in the following section.
  89. \begin{figure}
  90. \begin{mdframed}
  91. \includegraphics[scale=0.4]{flow_rand.pdf}
  92. \caption{Flowchart of the random search}
  93. \label{random_flow}
  94. \end{mdframed}
  95. \end{figure}
  96. \subsubsection{The Knuth-Fisher-Yates shuffle}
  97. The Fisher–Yates shuffle is an algorithm for generating a random permutation
  98. of a finite sets. The Fisher–Yates shuffle is unbiased, so that every
  99. permutation is equally likely. We present here the Durstenfeld variant of
  100. the algorithm, presented by Knuth in \emph{The Art of Computer programming}.
  101. The algorithm's time complexity is here $O(n)$, compared to $O(n^2)$ of
  102. the naive implementation.
  103. \begin{algorithm}[H]
  104. \SetAlgoLined
  105. \SetKwFunction{Rand}{Rand}
  106. \SetKwFunction{Swap}{Swap}
  107. \KwData{A table T[1..n]}
  108. \KwResult{Same table T, shuffled}
  109. \For{$i\leftarrow 1$ \KwTo $n-1$}{
  110. $j \leftarrow$ \Rand{$[1,n-i]$}\;
  111. \Swap{$T[i], T[i+j]$}\;
  112. }
  113. \caption{KFY algorithm}
  114. \end{algorithm}
  115. \begin{lemma}
  116. The resulting permutation of KFY is unbiased.
  117. \end{lemma}
  118. \begin{proof}
  119. Let consider the set $[1,\ldots n]$ as the vertices of a random graph
  120. constructed as the trace of the execution of the algorithm:
  121. an edge $(i,j)$ exists in the graph if and only if the swap of $T[i]$ and
  122. $T[j]$ had been executed. This graph encodes the permutation represented by
  123. $T$. To be able to encode any permutation the considered graph must be
  124. connected --- in order to allow any pairs of points to be swapped ---.
  125. Since by construction every points is reached by an edge, and that there
  126. exists exactly $n-1$ edges, we can conclude directly that any permutation can
  127. be reached by the algorithm. Since the probability of getting a fixed graph
  128. of $n-1$ edges with every edges of degree at least one is $n!^{-1}$, the
  129. algorithm is thus unbiased.
  130. \end{proof}
  131. \subsubsection{Results and stability}
  132. We first want to analyze the dependence of the results on the number of
  133. iterations of the heuristic, in order to discuss its stability.
  134. The results are compiled in the figures~\ref{rand_iter2},~\ref{rand_iter3},
  135. restricted to a number of points between 80 and 180.
  136. We emphazies on the fact the lots of datas appears on the graphs,
  137. and the error bands representation make them a bit messy. These graphs
  138. were made for extensive internal experiments and parameters researches.
  139. The final wrap up graphs are much more lighter and only presents the best
  140. results obtained.
  141. As expected from a fully random search, the error bands are very large for
  142. low number of iterations ($15\%$ of the value for 400 iterations) and tends
  143. to shrink with a bigger number of iterations (around $5\%$ for 1600 iterations).
  144. This shrinkage is a direct consequence of well known concentrations bounds
  145. (Chernoff and Asuma-Hoeffding).
  146. The average results are quite stable, they decrease progressively with
  147. the growing number of iterations, but seems to get to a limits after 1000
  148. iterations. This value acts as a threshold for the interesting number of iterations.
  149. As such interesting results can be conducted with \emph{only} 1000 iterations,
  150. without altering too much the quality of the set with regards to its
  151. discrepancy and this heuristic.
  152. \begin{figure}
  153. \includegraphics[scale=0.3]{Results/random_iter.png}
  154. \caption{Dependence on iterations, dimension 2}
  155. \label{rand_iter2}
  156. \end{figure}
  157. \begin{figure}
  158. \includegraphics[scale=0.3]{Results/random_iter_3.png}
  159. \caption{Dependence on iterations, dimension 3}
  160. \label{rand_iter3}
  161. \end{figure}
  162. \subsection{Evolutionary heuristic: Simulated annealing and local search}
  163. The second heuristic implemented is a randomiezd local search with
  164. simmulated annealing. This heuristic is inspired by the physical
  165. process of annealing in metallurgy.
  166. Simulated annealing interprets the physical slow cooling as a
  167. slow decrease in the probability of accepting worse solutions as it
  168. explores the solution space.
  169. More precisely the neighbours are here the permutations which can be obtained
  170. by application of exactly one transposition of the current permutation.
  171. The selection phase is dependant on the current temperature:
  172. after applaying a random transposition on the current permutation, either
  173. the discrepency of the corresponding Halton set is decreased and the
  174. evolution is keeped, either it does not but is still keeped with
  175. a probability $e^{\frac{\delta}{T}}$ where $\delta$ is the difference
  176. between the old and new discrepancy, and $T$ the current temperature.
  177. The all algorithm is described in the flowchart~\ref{flow_rec}.
  178. \begin{figure}
  179. \begin{mdframed}
  180. \includegraphics[scale=0.4]{flow_recuit.pdf}
  181. \caption{Flowchart of the simulated annealing local search heuristic}
  182. \label{flow_rec}
  183. \end{mdframed}
  184. \end{figure}
  185. \subsubsection{Dependence on the temperature}
  186. First experiements were made to select the best initial temperature.
  187. Results are compiled in graphs~\ref{temp_2},~\ref{temp3},\ref{temp3_z}.
  188. Graphs~\ref{temp_2},~\ref{temp3} represents the results obtained respectively
  189. in dimension 2 and 3 between 10 and 500 points. The curve obtained is
  190. characteristic of the average evolution of the discrepancy optimisation
  191. algorithms for Halton points sets: a very fast decrease for low number of
  192. points --- roughly up to 80 points --- and then a very slow one after.
  193. The most intersting part of these results are concentred between 80 and 160
  194. points were the different curves splits. The graph~\ref{temp3_z} is a zoom
  195. of~\ref{temp3} in this window. We remark on that graph that the lower the
  196. temperature is, the best the results are.
  197. \begin{figure}
  198. \includegraphics[scale=0.3]{Results/resu_2_temp.png}
  199. \caption{Dependence on initial temperature: D=2}
  200. \label{temp_2}
  201. \end{figure}
  202. \begin{figure}
  203. \includegraphics[scale=0.3]{Results/resu_temp3.png}
  204. \caption{Dependence on initial temperature: D=3}
  205. \label{temp3}
  206. \end{figure}
  207. \begin{figure}
  208. \includegraphics[scale=0.3]{Results/resu_temp3_zoom.png}
  209. \caption{Dependence on initial temperature (zoom): D=3}
  210. \label{temp3_z}
  211. \end{figure}
  212. \subsubsection{Stability with regards to the number of iterations}
  213. As for the fully random search heursitic we invatigated the stability
  214. of the algorithm with regards to the number of iterations. We present here
  215. the result in dimension 3 in the graph~\ref{iter_sa}. Once again we
  216. resticted the window between 80 and 180 points were curves are splited.
  217. An interesting phenomena can be observed: the error rates are somehow
  218. invariant w.r.t.\ the number of iteration and once again the 1000 iterations
  219. threshold seems to appear --- point 145 is a light split between iteration
  220. 1600 and the others, but excpeted for that point, getting more than 1000
  221. iterations tends be be a waste of time. The error rate is for 80 points the
  222. biggest and is about $15\%$ of the value, which is similar to the error
  223. rates for fully random search with 400 iterations.
  224. \begin{figure}
  225. \includegraphics[scale=0.3]{Results/sa_iter.png}
  226. \caption{Dependence on iterations number for simmulated annealing : D=3}
  227. \label{iter_sa}
  228. \end{figure}
  229. \subsection{Genetic (5+5) search}
  230. \begin{figure}
  231. \begin{mdframed}
  232. \label{rand_flow}
  233. \includegraphics[scale=0.4]{crossover_flow.pdf}
  234. \caption{Flowchart of the crossover algorithm.}
  235. \end{mdframed}
  236. \end{figure}
  237. \begin{figure}
  238. \label{rand_flow}
  239. \includegraphics[scale=0.3]{Results/res_gen_2.png}
  240. \caption{Dependence on iterations number: D=3}
  241. \end{figure}
  242. \begin{figure}
  243. \label{rand_flow}
  244. \includegraphics[scale=0.3]{Results/res_gen_2_zoom.png}
  245. \caption{Dependence on iterations number: D=3}
  246. \end{figure}
  247. \begin{figure}
  248. \label{rand_flow}
  249. \includegraphics[scale=0.3]{Results/res_gen_3_zoom.png}
  250. \caption{Dependence on iterations number: D=3}
  251. \end{figure}
  252. \begin{figure}
  253. \label{rand_flow}
  254. \includegraphics[scale=0.3]{Results/res_gen_4_zoom.png}
  255. \caption{Dependence on iterations number: D=3}
  256. \end{figure}
  257. \section{Results}
  258. \section{Conclusion}
  259. \end{document}